From owner-svn-src-all@freebsd.org Sun Oct 18 00:27:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F869445ED5; Sun, 18 Oct 2020 00:27:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDLLf1RJ3z3XTX; Sun, 18 Oct 2020 00:27:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DF0A9FD3; Sun, 18 Oct 2020 00:27:22 +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 09I0RLvQ043604; Sun, 18 Oct 2020 00:27:21 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I0RKPL043599; Sun, 18 Oct 2020 00:27:20 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010180027.09I0RKPL043599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 18 Oct 2020 00:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366800 - in head: sbin/ifconfig sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net80211 X-SVN-Commit-Revision: 366800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 00:27:22 -0000 Author: bz Date: Sun Oct 18 00:27:20 2020 New Revision: 366800 URL: https://svnweb.freebsd.org/changeset/base/366800 Log: net80211: update for (more) VHT160 support Implement two macros IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ() and its 80+80 counter part to check in vhtcaps for appropriate levels of support and use the macros throughout the code. Add vht160_chan_ranges/is_vht160_valid_freq and handle analogue to vht80 in various parts of the code. Add ieee80211_add_channel_cbw() which also takes the CBW flag fields and make the former ieee80211_add_channel() a wrapper to it. With the CBW flags we can add HT/VHT channels passing them to getflags() for the 2/5ghz functions. In ifconfig(8) add the regdomain_addchans() support for VHT160 and VHT80P80. With this (+ regdoain.xml updates) VHT160 channels can be configured, listed, and pass regdomain where appropriate. Tested with: iwlwifi Reviewed by: adrian MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26712 Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_var.h head/sys/net80211/ieee80211_vht.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Oct 17 23:42:33 2020 (r366799) +++ head/sbin/ifconfig/ifieee80211.c Sun Oct 18 00:27:20 2020 (r366800) @@ -2405,7 +2405,31 @@ regdomain_makechannels( &dc->dc_chaninfo); } - /* XXX TODO: VHT80P80, VHT160 */ + /* VHT160 */ + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ( + dc->dc_vhtcaps)) { + regdomain_addchans(ci, &rd->bands_11ac, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT160, + &dc->dc_chaninfo); + regdomain_addchans(ci, &rd->bands_11ac, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT160, + &dc->dc_chaninfo); + } + + /* VHT80P80 */ + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ( + dc->dc_vhtcaps)) { + regdomain_addchans(ci, &rd->bands_11ac, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT80P80, + &dc->dc_chaninfo); + regdomain_addchans(ci, &rd->bands_11ac, reg, + IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT80P80, + &dc->dc_chaninfo); + } } if (!LIST_EMPTY(&rd->bands_11ng) && dc->dc_htcaps != 0) { Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Oct 17 23:42:33 2020 (r366799) +++ head/sys/net80211/ieee80211.c Sun Oct 18 00:27:20 2020 (r366800) @@ -1163,6 +1163,12 @@ struct vht_chan_range vht80_chan_ranges[] = { { 0, 0 } }; +struct vht_chan_range vht160_chan_ranges[] = { + { 5170, 5330 }, + { 5490, 5650 }, + { 0, 0 } +}; + static int set_vht_extchan(struct ieee80211_channel *c) { @@ -1177,8 +1183,24 @@ set_vht_extchan(struct ieee80211_channel *c) } if (IEEE80211_IS_CHAN_VHT160(c)) { - printf("%s: TODO VHT160 channel (ieee=%d, flags=0x%08x)\n", - __func__, c->ic_ieee, c->ic_flags); + for (i = 0; vht160_chan_ranges[i].freq_start != 0; i++) { + if (c->ic_freq >= vht160_chan_ranges[i].freq_start && + c->ic_freq < vht160_chan_ranges[i].freq_end) { + int midpoint; + + midpoint = vht160_chan_ranges[i].freq_start + 80; + 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); } if (IEEE80211_IS_CHAN_VHT80(c)) { @@ -1225,11 +1247,24 @@ set_vht_extchan(struct ieee80211_channel *c) /* * Return whether the current channel could possibly be a part of - * a VHT80 channel. + * a VHT80/VHT160 channel. * * This doesn't check that the whole range is in the allowed list * according to regulatory. */ +static bool +is_vht160_valid_freq(uint16_t freq) +{ + int i; + + for (i = 0; vht160_chan_ranges[i].freq_start != 0; i++) { + if (freq >= vht160_chan_ranges[i].freq_start && + freq < vht160_chan_ranges[i].freq_end) + return (true); + } + return (false); +} + static int is_vht80_valid_freq(uint16_t freq) { @@ -1410,18 +1445,17 @@ getflags(const uint8_t bands[], uint32_t flags[], int * Add one 20 MHz channel into specified channel list. * You MUST NOT mix bands when calling this. It will not add 5ghz * channels if you have any B/G/N band bit set. - * This also does not support 40/80/160/80+80. + * The _cbw() variant does also support HT40/VHT80/160/80+80. */ -/* XXX VHT */ int -ieee80211_add_channel(struct ieee80211_channel chans[], int maxchans, +ieee80211_add_channel_cbw(struct ieee80211_channel chans[], int maxchans, int *nchans, uint8_t ieee, uint16_t freq, int8_t maxregpower, - uint32_t chan_flags, const uint8_t bands[]) + uint32_t chan_flags, const uint8_t bands[], int cbw_flags) { uint32_t flags[IEEE80211_MODE_MAX]; int i, error; - getflags(bands, flags, 0); + getflags(bands, flags, cbw_flags); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); error = addchan(chans, maxchans, nchans, ieee, freq, maxregpower, @@ -1434,6 +1468,16 @@ ieee80211_add_channel(struct ieee80211_channel chans[] return (error); } +int +ieee80211_add_channel(struct ieee80211_channel chans[], int maxchans, + int *nchans, uint8_t ieee, uint16_t freq, int8_t maxregpower, + uint32_t chan_flags, const uint8_t bands[]) +{ + + return (ieee80211_add_channel_cbw(chans, maxchans, nchans, ieee, freq, + maxregpower, chan_flags, bands, 0)); +} + static struct ieee80211_channel * findchannel(struct ieee80211_channel chans[], int nchans, uint16_t freq, uint32_t flags) @@ -1573,7 +1617,11 @@ add_chanlist(struct ieee80211_channel chans[], int max is_vht = !! (flags[j] & IEEE80211_CHAN_VHT); /* XXX TODO FIXME VHT80P80. */ - /* XXX TODO FIXME VHT160. */ + + /* Test for VHT160 analogue to the VHT80 below. */ + if (is_vht && flags[j] & IEEE80211_CHAN_VHT160) + if (! is_vht160_valid_freq(freq)) + continue; /* * Test for VHT80. Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sat Oct 17 23:42:33 2020 (r366799) +++ head/sys/net80211/ieee80211.h Sun Oct 18 00:27:20 2020 (r366800) @@ -815,6 +815,13 @@ struct ieee80211_ie_vht_operation { #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ 2 #define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_RESERVED 3 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(_vhtcaps) \ + (_IEEE80211_MASKSHIFT(_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= \ + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ) +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(_vhtcaps) \ + (_IEEE80211_MASKSHIFT(_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == \ + IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ) + #define IEEE80211_VHTCAP_RXLDPC 0x00000010 #define IEEE80211_VHTCAP_RXLDPC_S 4 Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Sat Oct 17 23:42:33 2020 (r366799) +++ head/sys/net80211/ieee80211_regdomain.c Sun Oct 18 00:27:20 2020 (r366800) @@ -151,11 +151,10 @@ ieee80211_init_channels(struct ieee80211com *ic, if (isset(bands, IEEE80211_MODE_VHT_5GHZ)) { cbw_flags |= NET80211_CBW_FLAG_HT40; /* Make sure this is set; or assert? */ cbw_flags |= NET80211_CBW_FLAG_VHT80; - if (_IEEE80211_MASKSHIFT(ic->ic_vhtcaps, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(ic->ic_vhtcaps)) cbw_flags |= NET80211_CBW_FLAG_VHT160; - if (_IEEE80211_MASKSHIFT(ic->ic_vhtcaps, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ( + ic->ic_vhtcaps)) cbw_flags |= NET80211_CBW_FLAG_VHT80P80; ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Oct 17 23:42:33 2020 (r366799) +++ head/sys/net80211/ieee80211_var.h Sun Oct 18 00:27:20 2020 (r366800) @@ -772,6 +772,8 @@ int ieee80211_mhz2ieee(u_int, u_int); int ieee80211_chan2ieee(struct ieee80211com *, const struct ieee80211_channel *); u_int ieee80211_ieee2mhz(u_int, u_int); +int ieee80211_add_channel_cbw(struct ieee80211_channel[], int, int *, + uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[], int); int ieee80211_add_channel(struct ieee80211_channel[], int, int *, uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[]); int ieee80211_add_channel_ht40(struct ieee80211_channel[], int, int *, Modified: head/sys/net80211/ieee80211_vht.c ============================================================================== --- head/sys/net80211/ieee80211_vht.c Sat Oct 17 23:42:33 2020 (r366799) +++ head/sys/net80211/ieee80211_vht.c Sun Oct 18 00:27:20 2020 (r366800) @@ -153,13 +153,10 @@ ieee80211_vht_vattach(struct ieee80211vap *vap) IEEE80211_FVHT_VHT | IEEE80211_FVHT_USEVHT40 | IEEE80211_FVHT_USEVHT80; -#if 0 - /* XXX TODO: enable VHT80+80, VHT160 capabilities */ - if (XXX TODO FIXME) + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(vap->iv_vhtcaps)) vap->iv_flags_vht |= IEEE80211_FVHT_USEVHT160; - if (XXX TODO FIXME) + if (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(vap->iv_vhtcaps)) vap->iv_flags_vht |= IEEE80211_FVHT_USEVHT80P80; -#endif memcpy(&vap->iv_vht_mcsinfo, &ic->ic_vht_mcsinfo, sizeof(struct ieee80211_vht_mcs_info)); @@ -202,15 +199,11 @@ ieee80211_vht_announce(struct ieee80211com *ic) return; /* Channel width */ - ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz"); - if (_IEEE80211_MASKSHIFT(ic->ic_vhtcaps, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) - printf(" 160MHz"); - if (_IEEE80211_MASKSHIFT(ic->ic_vhtcaps, - IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) - printf(" 80+80MHz"); - printf("\n"); - + ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz%s%s\n", + (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ(ic->ic_vhtcaps)) ? + ", 160MHz" : "", + (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160_80P80MHZ(ic->ic_vhtcaps)) ? + ", 80+80MHz" : ""); /* Features */ ic_printf(ic, "[VHT] Features: %b\n", ic->ic_vhtcaps, IEEE80211_VHTCAP_BITS); From owner-svn-src-all@freebsd.org Sun Oct 18 01:09:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFF86446F89; Sun, 18 Oct 2020 01:09:56 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDMHm5ZnVz3ZGB; Sun, 18 Oct 2020 01:09:56 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2DAAA5E0; Sun, 18 Oct 2020 01:09:56 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09I19uPM068707; Sun, 18 Oct 2020 01:09:56 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I19t12068699; Sun, 18 Oct 2020 01:09:55 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010180109.09I19t12068699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 18 Oct 2020 01:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366801 - stable/12/contrib/tzdata X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/tzdata X-SVN-Commit-Revision: 366801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 01:09:56 -0000 Author: philip Date: Sun Oct 18 01:09:55 2020 New Revision: 366801 URL: https://svnweb.freebsd.org/changeset/base/366801 Log: MFC r366779: Import tzdata 2020c Modified: stable/12/contrib/tzdata/Makefile stable/12/contrib/tzdata/NEWS stable/12/contrib/tzdata/australasia stable/12/contrib/tzdata/europe stable/12/contrib/tzdata/version stable/12/contrib/tzdata/ziguard.awk Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tzdata/Makefile ============================================================================== --- stable/12/contrib/tzdata/Makefile Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/Makefile Sun Oct 18 01:09:55 2020 (r366801) @@ -1022,10 +1022,14 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti done sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version + : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. + touch -md 2020-10-12T22:53:00Z \ + tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ (cd tzdata$(VERSION)-rearguard.dir && \ - tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \ + tar $(TARFLAGS) -cf - \ + $(COMMON) $(DATA) $(MISC) pacificnew | \ gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ Modified: stable/12/contrib/tzdata/NEWS ============================================================================== --- stable/12/contrib/tzdata/NEWS Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/NEWS Sun Oct 18 01:09:55 2020 (r366801) @@ -1,5 +1,25 @@ News for the tz database +Release 2020c - 2020-10-16 11:15:53 -0700 + + Briefly: + Fiji starts DST later than usual, on 2020-12-20. + + Changes to future timestamps + + Fiji will start DST on 2020-12-20, instead of 2020-11-08 as + previously predicted. DST will still end on 2021-01-17. + (Thanks to Raymond Kumar and Alan Mintz.) Assume for now that + the later-than-usual start date is a one-time departure from the + recent pattern. + + Changes to build procedure + + Rearguard tarballs now contain an empty file pacificnew. + Some older downstream software expects this file to exist. + (Problem reported by Mike Cullinan.) + + Release 2020b - 2020-10-06 18:35:04 -0700 Briefly: Modified: stable/12/contrib/tzdata/australasia ============================================================================== --- stable/12/contrib/tzdata/australasia Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/australasia Sun Oct 18 01:09:55 2020 (r366801) @@ -381,6 +381,19 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # From Michael Deckers (2019-08-06): # https://www.laws.gov.fj/LawsAsMade/downloadfile/848 +# From Raymond Kumar (2020-10-08): +# [DST in Fiji] is from December 20th 2020, till 17th January 2021. +# From Alan Mintz (2020-10-08): +# https://www.laws.gov.fj/LawsAsMade/GetFile/1071 +# From Tim Parenti (2020-10-08): +# https://www.fijivillage.com/news/Daylight-saving-from-Dec-20th-this-year-to-Jan-17th-2021-8rf4x5/ +# "Minister for Employment, Parveen Bala says they had never thought of +# stopping daylight saving. He says it was just to decide on when it should +# start and end. Bala says it is a short period..." +# Since the end date is still in line with our ongoing predictions, assume for +# now that the later-than-usual start date is a one-time departure from the +# recent second Sunday in November pattern. + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - @@ -392,7 +405,9 @@ Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - -Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2020 only - Dec 20 2:00 1:00 - +Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 Modified: stable/12/contrib/tzdata/europe ============================================================================== --- stable/12/contrib/tzdata/europe Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/europe Sun Oct 18 01:09:55 2020 (r366801) @@ -1589,6 +1589,8 @@ Rule Hungary 1946 only - Oct 7 2:00 0 - # https://library.hungaricana.hu/hu/view/Zala_1948_09/?pg=64 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=53 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=160 +# https://library.hungaricana.hu/hu/view/UjSzo_1949_01-04/?pg=102 +# https://library.hungaricana.hu/hu/view/KeletMagyarorszag_1949_03/?pg=96 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1949_09/?pg=94 Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 S Rule Hungary 1947 1949 - Oct Sun>=1 2:00s 0 - @@ -1604,9 +1606,10 @@ Rule Hungary 1955 only - Oct 2 3:00 0 - # https://library.hungaricana.hu/hu/view/PestMegyeiHirlap_1957_09/?pg=143 Rule Hungary 1956 1957 - Jun Sun>=1 2:00 1:00 S Rule Hungary 1956 1957 - Sep lastSun 3:00 0 - -# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=189 Rule Hungary 1980 only - Apr 6 0:00 1:00 S Rule Hungary 1980 only - Sep 28 1:00 0 - +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1981_01/?pg=79 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1982/?pg=115 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1983/?pg=85 @@ -1617,6 +1620,7 @@ Rule Hungary 1981 1983 - Sep lastSun 1:00 0 - Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1 1:00 C-Eur CE%sT 1918 # https://library.hungaricana.hu/hu/view/OGYK_RT_1941/?pg=1204 +# https://library.hungaricana.hu/hu/view/OGYK_RT_1942/?pg=3955 1:00 Hungary CE%sT 1941 Apr 7 23:00 1:00 C-Eur CE%sT 1945 1:00 Hungary CE%sT 1984 Modified: stable/12/contrib/tzdata/version ============================================================================== --- stable/12/contrib/tzdata/version Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/version Sun Oct 18 01:09:55 2020 (r366801) @@ -1 +1 @@ -2020b +2020c Modified: stable/12/contrib/tzdata/ziguard.awk ============================================================================== --- stable/12/contrib/tzdata/ziguard.awk Sun Oct 18 00:27:20 2020 (r366800) +++ stable/12/contrib/tzdata/ziguard.awk Sun Oct 18 01:09:55 2020 (r366801) @@ -3,7 +3,14 @@ # Contributed by Paul Eggert. This file is in the public domain. # This is not a general-purpose converter; it is designed for current tzdata. +# It just converts from current source to main, vanguard, and rearguard forms. +# Although it might be nice for it to be idempotent, or to be useful +# for converting back and forth between vanguard and rearguard formats, +# it does not do these nonessential tasks now. # +# Although main and vanguard forms are currently equivalent, +# this need not always be the case. +# # When converting to vanguard form, the output can use negative SAVE # values. # @@ -28,7 +35,7 @@ DATAFORM != "main" { in_comment = /^#/ uncomment = comment_out = 0 - # If the line should differ due to Czechoslovakia using negative SAVE values, + # If this line should differ due to Czechoslovakia using negative SAVE values, # uncomment the desired version and comment out the undesired one. if (zone == "Europe/Prague" && /1947 Feb 23/) { if (($(in_comment + 2) != "-") == vanguard) { From owner-svn-src-all@freebsd.org Sun Oct 18 01:10:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4371446D40; Sun, 18 Oct 2020 01:10:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDMJ0152tz3ZDV; Sun, 18 Oct 2020 01:10:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D903EAA0D; Sun, 18 Oct 2020 01:10:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09I1A7wm068799; Sun, 18 Oct 2020 01:10:07 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I1A6LL068792; Sun, 18 Oct 2020 01:10:06 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010180110.09I1A6LL068792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 18 Oct 2020 01:10: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: r366802 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 366802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 01:10:08 -0000 Author: philip Date: Sun Oct 18 01:10:06 2020 New Revision: 366802 URL: https://svnweb.freebsd.org/changeset/base/366802 Log: MFC r366779: Import tzdata 2020c Modified: stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/version stable/11/contrib/tzdata/ziguard.awk Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/Makefile Sun Oct 18 01:10:06 2020 (r366802) @@ -1022,10 +1022,14 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti done sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version + : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. + touch -md 2020-10-12T22:53:00Z \ + tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ (cd tzdata$(VERSION)-rearguard.dir && \ - tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \ + tar $(TARFLAGS) -cf - \ + $(COMMON) $(DATA) $(MISC) pacificnew | \ gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/NEWS Sun Oct 18 01:10:06 2020 (r366802) @@ -1,5 +1,25 @@ News for the tz database +Release 2020c - 2020-10-16 11:15:53 -0700 + + Briefly: + Fiji starts DST later than usual, on 2020-12-20. + + Changes to future timestamps + + Fiji will start DST on 2020-12-20, instead of 2020-11-08 as + previously predicted. DST will still end on 2021-01-17. + (Thanks to Raymond Kumar and Alan Mintz.) Assume for now that + the later-than-usual start date is a one-time departure from the + recent pattern. + + Changes to build procedure + + Rearguard tarballs now contain an empty file pacificnew. + Some older downstream software expects this file to exist. + (Problem reported by Mike Cullinan.) + + Release 2020b - 2020-10-06 18:35:04 -0700 Briefly: Modified: stable/11/contrib/tzdata/australasia ============================================================================== --- stable/11/contrib/tzdata/australasia Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/australasia Sun Oct 18 01:10:06 2020 (r366802) @@ -381,6 +381,19 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # From Michael Deckers (2019-08-06): # https://www.laws.gov.fj/LawsAsMade/downloadfile/848 +# From Raymond Kumar (2020-10-08): +# [DST in Fiji] is from December 20th 2020, till 17th January 2021. +# From Alan Mintz (2020-10-08): +# https://www.laws.gov.fj/LawsAsMade/GetFile/1071 +# From Tim Parenti (2020-10-08): +# https://www.fijivillage.com/news/Daylight-saving-from-Dec-20th-this-year-to-Jan-17th-2021-8rf4x5/ +# "Minister for Employment, Parveen Bala says they had never thought of +# stopping daylight saving. He says it was just to decide on when it should +# start and end. Bala says it is a short period..." +# Since the end date is still in line with our ongoing predictions, assume for +# now that the later-than-usual start date is a one-time departure from the +# recent second Sunday in November pattern. + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - @@ -392,7 +405,9 @@ Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - -Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2020 only - Dec 20 2:00 1:00 - +Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 Modified: stable/11/contrib/tzdata/europe ============================================================================== --- stable/11/contrib/tzdata/europe Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/europe Sun Oct 18 01:10:06 2020 (r366802) @@ -1589,6 +1589,8 @@ Rule Hungary 1946 only - Oct 7 2:00 0 - # https://library.hungaricana.hu/hu/view/Zala_1948_09/?pg=64 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=53 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=160 +# https://library.hungaricana.hu/hu/view/UjSzo_1949_01-04/?pg=102 +# https://library.hungaricana.hu/hu/view/KeletMagyarorszag_1949_03/?pg=96 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1949_09/?pg=94 Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 S Rule Hungary 1947 1949 - Oct Sun>=1 2:00s 0 - @@ -1604,9 +1606,10 @@ Rule Hungary 1955 only - Oct 2 3:00 0 - # https://library.hungaricana.hu/hu/view/PestMegyeiHirlap_1957_09/?pg=143 Rule Hungary 1956 1957 - Jun Sun>=1 2:00 1:00 S Rule Hungary 1956 1957 - Sep lastSun 3:00 0 - -# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=189 Rule Hungary 1980 only - Apr 6 0:00 1:00 S Rule Hungary 1980 only - Sep 28 1:00 0 - +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1981_01/?pg=79 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1982/?pg=115 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1983/?pg=85 @@ -1617,6 +1620,7 @@ Rule Hungary 1981 1983 - Sep lastSun 1:00 0 - Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1 1:00 C-Eur CE%sT 1918 # https://library.hungaricana.hu/hu/view/OGYK_RT_1941/?pg=1204 +# https://library.hungaricana.hu/hu/view/OGYK_RT_1942/?pg=3955 1:00 Hungary CE%sT 1941 Apr 7 23:00 1:00 C-Eur CE%sT 1945 1:00 Hungary CE%sT 1984 Modified: stable/11/contrib/tzdata/version ============================================================================== --- stable/11/contrib/tzdata/version Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/version Sun Oct 18 01:10:06 2020 (r366802) @@ -1 +1 @@ -2020b +2020c Modified: stable/11/contrib/tzdata/ziguard.awk ============================================================================== --- stable/11/contrib/tzdata/ziguard.awk Sun Oct 18 01:09:55 2020 (r366801) +++ stable/11/contrib/tzdata/ziguard.awk Sun Oct 18 01:10:06 2020 (r366802) @@ -3,7 +3,14 @@ # Contributed by Paul Eggert. This file is in the public domain. # This is not a general-purpose converter; it is designed for current tzdata. +# It just converts from current source to main, vanguard, and rearguard forms. +# Although it might be nice for it to be idempotent, or to be useful +# for converting back and forth between vanguard and rearguard formats, +# it does not do these nonessential tasks now. # +# Although main and vanguard forms are currently equivalent, +# this need not always be the case. +# # When converting to vanguard form, the output can use negative SAVE # values. # @@ -28,7 +35,7 @@ DATAFORM != "main" { in_comment = /^#/ uncomment = comment_out = 0 - # If the line should differ due to Czechoslovakia using negative SAVE values, + # If this line should differ due to Czechoslovakia using negative SAVE values, # uncomment the desired version and comment out the undesired one. if (zone == "Europe/Prague" && /1947 Feb 23/) { if (($(in_comment + 2) != "-") == vanguard) { From owner-svn-src-all@freebsd.org Sun Oct 18 01:13:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 297E8447243; Sun, 18 Oct 2020 01:13:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDMN60HBzz3ZX2; Sun, 18 Oct 2020 01:13:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E09EDA939; Sun, 18 Oct 2020 01:13:41 +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 09I1DfeO074931; Sun, 18 Oct 2020 01:13:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I1Dftq074930; Sun, 18 Oct 2020 01:13:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010180113.09I1Dftq074930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 18 Oct 2020 01:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366803 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 01:13:42 -0000 Author: mav Date: Sun Oct 18 01:13:41 2020 New Revision: 366803 URL: https://svnweb.freebsd.org/changeset/base/366803 Log: MFC r366730: Fix nvmecontrol logpage -i parameter. Modified: stable/12/sbin/nvmecontrol/logpage.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/logpage.c ============================================================================== --- stable/12/sbin/nvmecontrol/logpage.c Sun Oct 18 01:10:06 2020 (r366802) +++ stable/12/sbin/nvmecontrol/logpage.c Sun Oct 18 01:13:41 2020 (r366803) @@ -84,7 +84,7 @@ static const struct opts logpage_opts[] = { "Page to dump"), OPT("lsp", 'f', arg_uint8, opt, lsp, "Log Specific Field"), - OPT("lsi", 'i', arg_uint16, opt, lsp, + OPT("lsi", 'i', arg_uint16, opt, lsi, "Log Specific Identifier"), OPT("rae", 'r', arg_none, opt, rae, "Retain Asynchronous Event"), From owner-svn-src-all@freebsd.org Sun Oct 18 01:57:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89191448AE4; Sun, 18 Oct 2020 01:57:50 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDNM2349fz3chn; Sun, 18 Oct 2020 01:57:50 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C892B297; Sun, 18 Oct 2020 01:57:50 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09I1vo1c099376; Sun, 18 Oct 2020 01:57:50 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I1vopP099375; Sun, 18 Oct 2020 01:57:50 GMT (envelope-from grog@FreeBSD.org) Message-Id: <202010180157.09I1vopP099375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Sun, 18 Oct 2020 01:57: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: r366804 - stable/10/usr.bin/calendar/calendars X-SVN-Group: stable-10 X-SVN-Commit-Author: grog X-SVN-Commit-Paths: stable/10/usr.bin/calendar/calendars X-SVN-Commit-Revision: 366804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 01:57:50 -0000 Author: grog Date: Sun Oct 18 01:57:49 2020 New Revision: 366804 URL: https://svnweb.freebsd.org/changeset/base/366804 Log: Correct location and date of the Boston Shoemakers' organization, which significantly predated the USA. Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html Modified: stable/10/usr.bin/calendar/calendars/calendar.history Modified: stable/10/usr.bin/calendar/calendars/calendar.history ============================================================================== --- stable/10/usr.bin/calendar/calendars/calendar.history Sun Oct 18 01:13:41 2020 (r366803) +++ stable/10/usr.bin/calendar/calendars/calendar.history Sun Oct 18 01:57:49 2020 (r366804) @@ -368,8 +368,8 @@ 10/14 Battle of Hastings won by William the Conqueror and the Normans, 1066 10/14 Chuck Yeager breaks sound barrier, 1947 10/15 First draft card burned, 1965 -10/18 Boston Shoemakers form first US labor org., 1648 10/18 Soviets announce their probe took photos of the Moon's far side, 1959 +10/19 Boston Shoemakers form first American labor organization, 1648 10/19 Mao Tse-tung establishes the People's Republic of China, 1949 10/19 Napoleon's beaten army begins the long retreat from Moscow, 1812 10/20 "Saturday Night Massacre", 1973 From owner-svn-src-all@freebsd.org Sun Oct 18 03:01:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F12F44BDDC; Sun, 18 Oct 2020 03:01:27 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDPmR0TMyz3yps; Sun, 18 Oct 2020 03:01:27 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9299C01C; Sun, 18 Oct 2020 03:01:26 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09I31Qae039876; Sun, 18 Oct 2020 03:01:26 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I31QDX039875; Sun, 18 Oct 2020 03:01:26 GMT (envelope-from grog@FreeBSD.org) Message-Id: <202010180301.09I31QDX039875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Sun, 18 Oct 2020 03:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366805 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 366805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 03:01:27 -0000 Author: grog Date: Sun Oct 18 03:01:26 2020 New Revision: 366805 URL: https://svnweb.freebsd.org/changeset/base/366805 Log: Correct location and date of the Boston Shoemakers' organization, which significantly predated the USA. Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Sun Oct 18 01:57:49 2020 (r366804) +++ head/usr.bin/calendar/calendars/calendar.history Sun Oct 18 03:01:26 2020 (r366805) @@ -582,9 +582,9 @@ 10/16 The Walt Disney Company is founded by Walt Disney and his brother, Roy Disney, 1923 10/17 Al Capone convicted of income tax evasion, 1931 -10/18 Boston Shoemakers form first US labor org., 1648 10/18 Soviets announce their probe took photos of the Moon's far side, 1959 10/18 The Grand Ole Opry opens its doors, 1925 +10/19 Boston Shoemakers form first American labor organization, 1648 10/19 Mao Tse-tung establishes the People's Republic of China, 1949 10/19 Napoleon's beaten army begins the long retreat from Moscow, 1812 10/20 "Saturday Night Massacre", 1973 From owner-svn-src-all@freebsd.org Sun Oct 18 03:02:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CF0944C094; Sun, 18 Oct 2020 03:02:36 +0000 (UTC) (envelope-from grog@lemis.com) Received: from lax.lemis.com (www.lemis.com [45.32.70.18]) by mx1.freebsd.org (Postfix) with ESMTP id 4CDPng6hyxz3ywp; Sun, 18 Oct 2020 03:02:31 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (aussie-gw.lemis.com [167.179.139.35]) by lax.lemis.com (Postfix) with ESMTP id AC5662809A; Sun, 18 Oct 2020 03:02:24 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 03A4B26359A; Sun, 18 Oct 2020 14:02:24 +1100 (AEDT) Date: Sun, 18 Oct 2020 14:02:24 +1100 From: Greg 'groggy' Lehey To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r366804 - stable/10/usr.bin/calendar/calendars Message-ID: <20201018030223.GA25933@eureka.lemis.com> References: <202010180157.09I1vopP099375@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <202010180157.09I1vopP099375@repo.freebsd.org> Organization: The FreeBSD Project Phone: +61-3-5309-0418 Mobile: +61-490-494-038. Use only as instructed. WWW-Home-Page: http://www.FreeBSD X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.6.1 (2016-04-27) X-Rspamd-Queue-Id: 4CDPng6hyxz3ywp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of grog@lemis.com has no SPF policy when checking 45.32.70.18) smtp.mailfrom=grog@lemis.com X-Spamd-Result: default: False [-2.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.878]; FREEFALL_USER(0.00)[grog]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.942]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; AUTH_NA(1.00)[]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_SHORT(-0.24)[-0.239]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[grog@FreeBSD.org,grog@lemis.com]; RCVD_NO_TLS_LAST(0.10)[]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:45.32.64.0/19, country:US]; FROM_NEQ_ENVFROM(0.00)[grog@FreeBSD.org,grog@lemis.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-stable-10,svn-src-stable]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 03:02:36 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sunday, 18 October 2020 at 1:57:50 +0000, Greg Lehey wrote: > Author: grog > > Log: > Correct location and date of the Boston Shoemakers' organization, > ... > > Modified: > stable/10/usr.bin/calendar/calendars/calendar.history Ugh. Wrong branch. Please ignore. I've committed to head. Greg -- Sent from my desktop computer. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAl+LsD8ACgkQIubykFB6QiOQRwCfedN/Iv+Tke0A9gJ/exZ+/ogg sZwAn2x3DE5fAmogJgSLLsUluanxpsRY =fQTk -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO-- From owner-svn-src-all@freebsd.org Sun Oct 18 08:58:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52AC942B6A1; Sun, 18 Oct 2020 08:58:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDYh71Xdnz4GHQ; Sun, 18 Oct 2020 08:58:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1937E10226; Sun, 18 Oct 2020 08:58: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 09I8wELT056575; Sun, 18 Oct 2020 08:58:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09I8wEOh056573; Sun, 18 Oct 2020 08:58:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010180858.09I8wEOh056573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 18 Oct 2020 08:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366806 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 366806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 08:58:15 -0000 Author: hselasky Date: Sun Oct 18 08:58:14 2020 New Revision: 366806 URL: https://svnweb.freebsd.org/changeset/base/366806 Log: Add new USB quirk. PR: 250422 Submitted by: vidwer+fbsdbugs@gmail.com MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 18 03:01:26 2020 (r366805) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Oct 18 08:58:14 2020 (r366806) @@ -224,6 +224,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), USB_QUIRK(CYPRESS, XX6830XX, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(EMTEC, DANEELEC4GB, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(DMI, CFSM_RW, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 18 03:01:26 2020 (r366805) +++ head/sys/dev/usb/usbdevs Sun Oct 18 08:58:14 2020 (r366806) @@ -1880,6 +1880,7 @@ product ELV USBI2C 0xe00f USB-I2C interface product EMS DUAL_SHOOTER 0x0003 PSX gun controller converter /* Emtec products */ +product EMTEC DANEELEC4GB 0x1e20 USB DISK Pro PMAP product EMTEC RUF2PS 0x2240 Flash Drive /* Encore products */ From owner-svn-src-all@freebsd.org Sun Oct 18 12:03:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A3B84303A7; Sun, 18 Oct 2020 12:03:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDdp12z9yz4Q1N; Sun, 18 Oct 2020 12:03:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4966F121C0; Sun, 18 Oct 2020 12:03:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IC3bgl072963; Sun, 18 Oct 2020 12:03:37 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IC3bYM072962; Sun, 18 Oct 2020 12:03:37 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010181203.09IC3bYM072962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 18 Oct 2020 12:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366807 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 12:03:37 -0000 Author: melifaro Date: Sun Oct 18 12:03:36 2020 New Revision: 366807 URL: https://svnweb.freebsd.org/changeset/base/366807 Log: Simplify NET_EPOCH_EXIT in inp_join_group(). Suggested by: kib Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sun Oct 18 08:58:14 2020 (r366806) +++ head/sys/netinet/in_mcast.c Sun Oct 18 12:03:36 2020 (r366807) @@ -2009,6 +2009,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt else ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqn.imr_address); + NET_EPOCH_EXIT(et); break; } case IP_ADD_SOURCE_MEMBERSHIP: { @@ -2032,6 +2033,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt NET_EPOCH_ENTER(et); ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); + NET_EPOCH_EXIT(et); CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", __func__, ntohl(mreqs.imr_interface.s_addr), ifp); break; @@ -2074,6 +2076,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt return (EADDRNOTAVAIL); NET_EPOCH_ENTER(et); ifp = ifnet_byindex_ref(gsr.gsr_interface); + NET_EPOCH_EXIT(et); break; default: @@ -2082,7 +2085,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt return (EOPNOTSUPP); break; } - NET_EPOCH_EXIT(et); if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) { if (ifp != NULL) From owner-svn-src-all@freebsd.org Sun Oct 18 15:56:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D587435F2C; Sun, 18 Oct 2020 15:56:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDkz36YvLz4fZJ; Sun, 18 Oct 2020 15:56:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C066A15106; Sun, 18 Oct 2020 15:56:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IFul3f018179; Sun, 18 Oct 2020 15:56:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IFulwC018178; Sun, 18 Oct 2020 15:56:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010181556.09IFulwC018178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 18 Oct 2020 15:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366808 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 366808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 15:56:48 -0000 Author: trasz Date: Sun Oct 18 15:56:47 2020 New Revision: 366808 URL: https://svnweb.freebsd.org/changeset/base/366808 Log: Slightly tweak linux ptrace(2) debug message; no functional changes. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26815 Modified: head/sys/amd64/linux/linux_ptrace.c Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Sun Oct 18 12:03:36 2020 (r366807) +++ head/sys/amd64/linux/linux_ptrace.c Sun Oct 18 15:56:47 2020 (r366808) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_GETSIGINFO 0x4202 #define LINUX_PTRACE_GETREGSET 0x4204 #define LINUX_PTRACE_SEIZE 0x4206 +#define LINUX_PTRACE_GET_SYSCALL_INFO 0x420e #define LINUX_PTRACE_EVENT_EXIT 6 @@ -557,6 +558,14 @@ linux_ptrace_seize(struct thread *td, pid_t pid, l_ulo return (EINVAL); } +static int +linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + linux_msg(td, "PTRACE_GET_SYSCALL_INFO not implemented; returning EINVAL"); + return (EINVAL); +} + int linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) { @@ -641,6 +650,9 @@ linux_ptrace(struct thread *td, struct linux_ptrace_ar break; case LINUX_PTRACE_SEIZE: error = linux_ptrace_seize(td, pid, uap->addr, uap->data); + break; + case LINUX_PTRACE_GET_SYSCALL_INFO: + error = linux_ptrace_get_syscall_info(td, pid, uap->addr, uap->data); break; default: linux_msg(td, "ptrace(%ld, ...) not implemented; " From owner-svn-src-all@freebsd.org Sun Oct 18 15:58:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0E05435FAA; Sun, 18 Oct 2020 15:58:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDl0n44VZz4fqt; Sun, 18 Oct 2020 15:58:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F3BB14CBD; Sun, 18 Oct 2020 15:58:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IFwHDT018291; Sun, 18 Oct 2020 15:58:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IFwGJZ018288; Sun, 18 Oct 2020 15:58:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010181558.09IFwGJZ018288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 18 Oct 2020 15:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366809 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 15:58:17 -0000 Author: trasz Date: Sun Oct 18 15:58:16 2020 New Revision: 366809 URL: https://svnweb.freebsd.org/changeset/base/366809 Log: Add compat.linux.dummy_rlimits, and disable by default. Turns out the dummy rlimits fix prlimit(1), but break su(8) (login-1:4.5-1ubuntu2) - although not sudo(8), for some reason. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26814 Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Sun Oct 18 15:56:47 2020 (r366808) +++ head/sys/compat/linux/linux_mib.c Sun Oct 18 15:58:16 2020 (r366809) @@ -77,6 +77,11 @@ SYSCTL_INT(_compat_linux, OID_AUTO, default_stacksize, &linux_default_stacksize, 0, "Default soft stack size resource limit, or -1 for unlimited"); +int linux_dummy_rlimits = 0; +SYSCTL_INT(_compat_linux, OID_AUTO, dummy_rlimits, CTLFLAG_RWTUN, + &linux_dummy_rlimits, 0, + "Return dummy values for unsupported Linux-specific rlimits"); + int linux_ignore_ip_recverr = 1; SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, &linux_ignore_ip_recverr, 0, "Ignore enabling IP_RECVERR"); Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Sun Oct 18 15:56:47 2020 (r366808) +++ head/sys/compat/linux/linux_mib.h Sun Oct 18 15:58:16 2020 (r366809) @@ -65,6 +65,7 @@ int linux_kernver(struct thread *td); extern int linux_debug; extern int linux_default_openfiles; extern int linux_default_stacksize; +extern int linux_dummy_rlimits; extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun Oct 18 15:56:47 2020 (r366808) +++ head/sys/compat/linux/linux_misc.c Sun Oct 18 15:58:16 2020 (r366809) @@ -1377,6 +1377,9 @@ static bool linux_get_dummy_limit(l_uint resource, struct rlimit *rlim) { + if (linux_dummy_rlimits == 0) + return (false); + switch (resource) { case LINUX_RLIMIT_LOCKS: case LINUX_RLIMIT_SIGPENDING: From owner-svn-src-all@freebsd.org Sun Oct 18 16:16:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4315443607C; Sun, 18 Oct 2020 16:16:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDlPg12Z6z4gYL; Sun, 18 Oct 2020 16:16:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 083321551F; Sun, 18 Oct 2020 16:16:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IGGMZt030566; Sun, 18 Oct 2020 16:16:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IGGMnk030565; Sun, 18 Oct 2020 16:16:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010181616.09IGGMnk030565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 18 Oct 2020 16:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366810 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 366810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 16:16:23 -0000 Author: trasz Date: Sun Oct 18 16:16:22 2020 New Revision: 366810 URL: https://svnweb.freebsd.org/changeset/base/366810 Log: Stop calling set_syscall_retval() from linux_set_syscall_retval(). The former clobbers some registers that shouldn't be touched. Reviewed by: kib (earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26406 Modified: head/sys/amd64/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Sun Oct 18 15:58:16 2020 (r366809) +++ head/sys/amd64/linux/linux_sysvec.c Sun Oct 18 16:16:22 2020 (r366810) @@ -206,24 +206,45 @@ linux_fetch_syscall_args(struct thread *td) static void linux_set_syscall_retval(struct thread *td, int error) { - struct trapframe *frame = td->td_frame; + struct trapframe *frame; - /* - * On Linux only %rcx and %r11 values are not preserved across - * the syscall. So, do not clobber %rdx and %r10. - */ - td->td_retval[1] = frame->tf_rdx; - if (error != EJUSTRETURN) - frame->tf_r10 = frame->tf_rcx; + frame = td->td_frame; - cpu_set_syscall_retval(td, error); + switch (error) { + case 0: + frame->tf_rax = td->td_retval[0]; + frame->tf_r10 = frame->tf_rcx; + break; - if (__predict_false(error != 0)) { - if (error != ERESTART && error != EJUSTRETURN) - frame->tf_rax = linux_to_bsd_errno(error); + case ERESTART: + /* + * Reconstruct pc, we know that 'syscall' is 2 bytes, + * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. + * We saved this in tf_err. + * + */ + frame->tf_rip -= frame->tf_err; + frame->tf_r10 = frame->tf_rcx; + break; + + case EJUSTRETURN: + break; + + default: + frame->tf_rax = linux_to_bsd_errno(error); + frame->tf_r10 = frame->tf_rcx; + break; } - /* Restore all registers. */ + /* + * Differently from FreeBSD native ABI, on Linux only %rcx + * and %r11 values are not preserved across the syscall. + * Require full context restore to get all registers except + * those two restored at return to usermode. + * + * XXX: Would be great to be able to avoid PCB_FULL_IRET + * for the error == 0 case. + */ set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } From owner-svn-src-all@freebsd.org Sun Oct 18 16:24:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43E0D436907; Sun, 18 Oct 2020 16:24:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDlZh1HQvz4ggk; Sun, 18 Oct 2020 16:24:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FCB415682; Sun, 18 Oct 2020 16:24:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IGOBV9036661; Sun, 18 Oct 2020 16:24:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IGO88U036637; Sun, 18 Oct 2020 16:24:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010181624.09IGO88U036637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 18 Oct 2020 16:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366811 - in head: share/man/man9 sys/geom sys/geom/bde sys/geom/cache sys/geom/concat sys/geom/journal sys/geom/label sys/geom/linux_lvm sys/geom/mirror sys/geom/mountver sys/geom/mult... X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man9 sys/geom sys/geom/bde sys/geom/cache sys/geom/concat sys/geom/journal sys/geom/label sys/geom/linux_lvm sys/geom/mirror sys/geom/mountver sys/geom/multipath sys/geom/raid sys/g... X-SVN-Commit-Revision: 366811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 16:24:12 -0000 Author: trasz Date: Sun Oct 18 16:24:08 2020 New Revision: 366811 URL: https://svnweb.freebsd.org/changeset/base/366811 Log: Make g_attach() return ENXIO for orphaned providers; update various classes to add missing error checking. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26658 Modified: head/share/man/man9/g_attach.9 head/sys/geom/bde/g_bde.c head/sys/geom/cache/g_cache.c head/sys/geom/concat/g_concat.c head/sys/geom/geom_dev.c head/sys/geom/geom_subr.c head/sys/geom/geom_vfs.c head/sys/geom/journal/g_journal.c head/sys/geom/label/g_label.c head/sys/geom/linux_lvm/g_linux_lvm.c head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror_ctl.c head/sys/geom/mountver/g_mountver.c head/sys/geom/multipath/g_multipath.c head/sys/geom/raid/g_raid.c head/sys/geom/raid3/g_raid3.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c head/sys/geom/virstor/g_virstor.c Modified: head/share/man/man9/g_attach.9 ============================================================================== --- head/share/man/man9/g_attach.9 Sun Oct 18 16:16:22 2020 (r366810) +++ head/share/man/man9/g_attach.9 Sun Oct 18 16:24:08 2020 (r366811) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd October 10, 2020 .Dt G_ATTACH 9 .Os .Sh NAME @@ -122,6 +122,8 @@ Possible errors: .Bl -tag -width Er .It Bq Er ELOOP The operation creates a topology loop. +.It Bq Er ENXIO +Provider got orphaned. .El .Sh SEE ALSO .Xr geom 4 , Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/bde/g_bde.c Sun Oct 18 16:24:08 2020 (r366811) @@ -131,7 +131,13 @@ g_bde_create_geom(struct gctl_req *req, struct g_class gp = g_new_geomf(mp, "%s.bde", pp->name); cp = g_new_consumer(gp); - g_attach(cp, pp); + error = g_attach(cp, pp); + if (error != 0) { + g_destroy_consumer(cp); + g_destroy_geom(gp); + gctl_error(req, "could not attach consumer"); + return; + } error = g_access(cp, 1, 1, 1); if (error) { g_detach(cp); Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/cache/g_cache.c Sun Oct 18 16:24:08 2020 (r366811) @@ -673,9 +673,11 @@ g_cache_taste(struct g_class *mp, struct g_provider *p gp->orphan = g_cache_orphan; gp->access = g_cache_access; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_cache_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_cache_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/concat/g_concat.c Sun Oct 18 16:24:08 2020 (r366811) @@ -718,9 +718,11 @@ g_concat_taste(struct g_class *mp, struct g_provider * gp->access = g_concat_access; gp->orphan = g_concat_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_concat_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_concat_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/geom_dev.c Sun Oct 18 16:24:08 2020 (r366811) @@ -346,7 +346,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, cp->private = sc; cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); - KASSERT(error == 0, + KASSERT(error == 0 || error == ENXIO, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); make_dev_args_init(&args); Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/geom_subr.c Sun Oct 18 16:24:08 2020 (r366811) @@ -896,6 +896,8 @@ g_attach(struct g_consumer *cp, struct g_provider *pp) G_VALID_PROVIDER(pp); g_trace(G_T_TOPOLOGY, "g_attach(%p, %p)", cp, pp); KASSERT(cp->provider == NULL, ("attach but attached")); + if ((pp->flags & (G_PF_ORPHAN | G_PF_WITHER)) != 0) + return (ENXIO); cp->provider = pp; cp->flags &= ~G_CF_ORPHAN; LIST_INSERT_HEAD(&pp->consumers, cp, consumers); Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/geom_vfs.c Sun Oct 18 16:24:08 2020 (r366811) @@ -260,7 +260,11 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, sc->sc_bo = bo; gp->softc = sc; cp = g_new_consumer(gp); - g_attach(cp, pp); + error = g_attach(cp, pp); + if (error) { + g_wither_geom(gp, ENXIO); + return (error); + } error = g_access(cp, 1, wr, wr); if (error) { g_wither_geom(gp, ENXIO); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/journal/g_journal.c Sun Oct 18 16:24:08 2020 (r366811) @@ -2483,9 +2483,11 @@ g_journal_taste(struct g_class *mp, struct g_provider /* This orphan function should be never called. */ gp->orphan = g_journal_taste_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_journal_metadata_read(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_journal_metadata_read(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/label/g_label.c Sun Oct 18 16:24:08 2020 (r366811) @@ -400,7 +400,8 @@ g_label_taste(struct g_class *mp, struct g_provider *p gp->access = g_label_access_taste; gp->orphan = g_label_orphan_taste; cp = g_new_consumer(gp); - g_attach(cp, pp); + if (g_attach(cp, pp) != 0) + goto end2; if (g_access(cp, 1, 0, 0) != 0) goto end; for (i = 0; g_labels[i] != NULL; i++) { @@ -425,6 +426,7 @@ g_label_taste(struct g_class *mp, struct g_provider *p g_access(cp, -1, 0, 0); end: g_detach(cp); +end2: g_destroy_consumer(cp); g_destroy_geom(gp); return (NULL); Modified: head/sys/geom/linux_lvm/g_linux_lvm.c ============================================================================== --- head/sys/geom/linux_lvm/g_linux_lvm.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/linux_lvm/g_linux_lvm.c Sun Oct 18 16:24:08 2020 (r366811) @@ -543,11 +543,13 @@ g_llvm_taste(struct g_class *mp, struct g_provider *pp /* This orphan function should be never called. */ gp->orphan = g_llvm_taste_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_llvm_read_label(cp, &ll); - if (!error) - error = g_llvm_read_md(cp, &md, &ll); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_llvm_read_label(cp, &ll); + if (error == 0) + error = g_llvm_read_md(cp, &md, &ll); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/mirror/g_mirror.c Sun Oct 18 16:24:08 2020 (r366811) @@ -3241,9 +3241,11 @@ g_mirror_taste(struct g_class *mp, struct g_provider * */ gp->orphan = g_mirror_taste_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_mirror_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_mirror_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/mirror/g_mirror_ctl.c Sun Oct 18 16:24:08 2020 (r366811) @@ -449,7 +449,11 @@ err: g_topology_unlock(); return; } - g_attach(cp, pp); + if (g_attach(cp, pp) != 0) { + G_MIRROR_DEBUG(1, "Can't attach disk %s.", pp->name); + gctl_error(req, "Can't attach disk %s.", pp->name); + goto err; + } if (g_access(cp, 1, 0, 0) != 0) { G_MIRROR_DEBUG(1, "Can't open disk %s.", pp->name); gctl_error(req, "Can't open disk %s.", pp->name); Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/mountver/g_mountver.c Sun Oct 18 16:24:08 2020 (r366811) @@ -586,7 +586,12 @@ g_mountver_taste(struct g_class *mp, struct g_provider return (NULL); cp = LIST_FIRST(&gp->consumer); - g_attach(cp, pp); + error = g_attach(cp, pp); + if (error != 0) { + G_MOUNTVER_DEBUG(0, "Cannot attach to %s; error = %d.", pp->name, error); + return (NULL); + } + error = g_mountver_ident_matches(gp); if (error != 0) { g_detach(cp); Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/multipath/g_multipath.c Sun Oct 18 16:24:08 2020 (r366811) @@ -823,9 +823,11 @@ g_multipath_taste(struct g_class *mp, struct g_provide gp->access = g_multipath_access; gp->orphan = g_multipath_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_multipath_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_multipath_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/raid/g_raid.c Sun Oct 18 16:24:08 2020 (r366811) @@ -2228,7 +2228,8 @@ g_raid_taste(struct g_class *mp, struct g_provider *pp gp->orphan = g_raid_taste_orphan; cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_RECEIVE; - g_attach(cp, pp); + if (g_attach(cp, pp) != 0) + goto ofail2; if (g_access(cp, 1, 0, 0) != 0) goto ofail; @@ -2251,6 +2252,7 @@ g_raid_taste(struct g_class *mp, struct g_provider *pp (void)g_access(cp, -1, 0, 0); ofail: g_detach(cp); +ofail2: g_destroy_consumer(cp); g_destroy_geom(gp); G_RAID_DEBUG(2, "Tasting provider %s done.", pp->name); Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/raid3/g_raid3.c Sun Oct 18 16:24:08 2020 (r366811) @@ -3315,9 +3315,11 @@ g_raid3_taste(struct g_class *mp, struct g_provider *p /* This orphan function should be never called. */ gp->orphan = g_raid3_taste_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_raid3_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_raid3_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/shsec/g_shsec.c ============================================================================== --- head/sys/geom/shsec/g_shsec.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/shsec/g_shsec.c Sun Oct 18 16:24:08 2020 (r366811) @@ -646,9 +646,11 @@ g_shsec_taste(struct g_class *mp, struct g_provider *p gp->access = g_shsec_access; gp->orphan = g_shsec_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_shsec_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_shsec_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/stripe/g_stripe.c Sun Oct 18 16:24:08 2020 (r366811) @@ -963,9 +963,11 @@ g_stripe_taste(struct g_class *mp, struct g_provider * gp->access = g_stripe_access; gp->orphan = g_stripe_orphan; cp = g_new_consumer(gp); - g_attach(cp, pp); - error = g_stripe_read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = g_stripe_read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); if (error != 0) Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sun Oct 18 16:16:22 2020 (r366810) +++ head/sys/geom/virstor/g_virstor.c Sun Oct 18 16:24:08 2020 (r366811) @@ -780,9 +780,11 @@ g_virstor_taste(struct g_class *mp, struct g_provider gp->orphan = (void *)invalid_call; /* I really want these to fail. */ cp = g_new_consumer(gp); - g_attach(cp, pp); - error = read_metadata(cp, &md); - g_detach(cp); + error = g_attach(cp, pp); + if (error == 0) { + error = read_metadata(cp, &md); + g_detach(cp); + } g_destroy_consumer(cp); g_destroy_geom(gp); From owner-svn-src-all@freebsd.org Sun Oct 18 16:30:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2127436A49; Sun, 18 Oct 2020 16:30:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDlkL3rqfz4hNv; Sun, 18 Oct 2020 16:30:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 691771568E; Sun, 18 Oct 2020 16:30:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IGUoM7037024; Sun, 18 Oct 2020 16:30:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IGUoOY037023; Sun, 18 Oct 2020 16:30:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010181630.09IGUoOY037023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 18 Oct 2020 16:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366812 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 366812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 16:30:50 -0000 Author: trasz Date: Sun Oct 18 16:30:49 2020 New Revision: 366812 URL: https://svnweb.freebsd.org/changeset/base/366812 Log: If the SIM freezes the queue at exactly the wrong moment, after another thread has started to send in a CCB and already checked the queue wasn't frozen, we would end up with iscsi_action() being called despite the queue is now frozen. Add a check to make sure this doesn't happen . Perhaps this should be fixed at the CAM level instead, but given how the send queue and SIM are governed by two separate mutexes, it is somewhat hard to do. Reviewed by: imp, mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26750 Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sun Oct 18 16:24:08 2020 (r366811) +++ head/sys/dev/iscsi/iscsi.c Sun Oct 18 16:30:49 2020 (r366812) @@ -367,8 +367,8 @@ iscsi_session_cleanup(struct iscsi_session *is, bool d xpt_async(AC_LOST_DEVICE, is->is_path, NULL); if (is->is_simq_frozen) { - xpt_release_simq(is->is_sim, 1); is->is_simq_frozen = false; + xpt_release_simq(is->is_sim, 1); } xpt_free_path(is->is_path); @@ -1479,8 +1479,8 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, KASSERT(is->is_simq_frozen, ("reconnect without frozen simq")); ISCSI_SESSION_LOCK(is); ISCSI_SESSION_DEBUG(is, "releasing"); - xpt_release_simq(is->is_sim, 1); is->is_simq_frozen = false; + xpt_release_simq(is->is_sim, 1); ISCSI_SESSION_UNLOCK(is); } else { @@ -2351,6 +2351,17 @@ iscsi_action(struct cam_sim *sim, union ccb *ccb) if (is->is_terminating || (is->is_connected == false && fail_on_disconnection)) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; + xpt_done(ccb); + return; + } + + /* + * Make sure CAM doesn't sneak in a CCB just after freezing the queue. + */ + if (is->is_simq_frozen == true) { + ccb->ccb_h.status &= ~(CAM_SIM_QUEUED | CAM_STATUS_MASK); + ccb->ccb_h.status |= CAM_REQUEUE_REQ; + /* Don't freeze the devq - the SIM queue is already frozen. */ xpt_done(ccb); return; } From owner-svn-src-all@freebsd.org Sun Oct 18 17:15:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C982B4377BB; Sun, 18 Oct 2020 17:15:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDmkJ5CY8z4jqd; Sun, 18 Oct 2020 17:15:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 781B015FD5; Sun, 18 Oct 2020 17:15:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IHFqPe067146; Sun, 18 Oct 2020 17:15:52 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IHFmMW067126; Sun, 18 Oct 2020 17:15:48 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010181715.09IHFmMW067126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 18 Oct 2020 17:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366813 - in head/sys: conf net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: conf net net/route netinet netinet6 X-SVN-Commit-Revision: 366813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 17:15:52 -0000 Author: melifaro Date: Sun Oct 18 17:15:47 2020 New Revision: 366813 URL: https://svnweb.freebsd.org/changeset/base/366813 Log: Implement flowid calculation for outbound connections to balance connections over multiple paths. Multipath routing relies on mbuf flowid data for both transit and outbound traffic. Current code fills mbuf flowid from inp_flowid for connection-oriented sockets. However, inp_flowid is currently not calculated for outbound connections. This change creates simple hashing functions and starts calculating hashes for TCP,UDP/UDP-Lite and raw IP if multipath routes are present in the system. Reviewed by: glebius (previous version),ae Differential Revision: https://reviews.freebsd.org/D26523 Modified: head/sys/conf/files head/sys/net/radix.c head/sys/net/route.h head/sys/net/route/mpath_ctl.c head/sys/net/route/route_var.h head/sys/netinet/in_fib.c head/sys/netinet/in_fib.h head/sys/netinet/in_pcb.c head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h head/sys/netinet/raw_ip.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_fib.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_rss.c head/sys/netinet6/in6_rss.h head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/conf/files Sun Oct 18 17:15:47 2020 (r366813) @@ -4180,7 +4180,7 @@ net/rss_config.c optional inet rss | inet6 rss net/rtsock.c standard net/slcompress.c optional netgraph_vjc | sppp | \ netgraph_sppp -net/toeplitz.c optional inet rss | inet6 rss +net/toeplitz.c optional inet rss | inet6 rss | route_mpath net/vnet.c optional vimage net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/net/radix.c Sun Oct 18 17:15:47 2020 (r366813) @@ -624,21 +624,6 @@ rn_addroute(void *v_arg, void *n_arg, struct radix_hea saved_tt = tt = rn_insert(v, head, &keyduplicated, treenodes); if (keyduplicated) { for (t = tt; tt; t = tt, tt = tt->rn_dupedkey) { -#ifdef RADIX_MPATH - /* permit multipath, if enabled for the family */ - if (rn_mpath_capable(head) && netmask == tt->rn_mask) { - /* - * go down to the end of multipaths, so that - * new entry goes into the end of rn_dupedkey - * chain. - */ - do { - t = tt; - tt = tt->rn_dupedkey; - } while (tt && t->rn_mask == tt->rn_mask); - break; - } -#endif if (tt->rn_mask == netmask) return (0); if (netmask == 0 || @@ -744,10 +729,8 @@ on2: if (m->rm_flags & RNF_NORMAL) { mmask = m->rm_leaf->rn_mask; if (tt->rn_flags & RNF_NORMAL) { -#if !defined(RADIX_MPATH) log(LOG_ERR, "Non-unique normal route, mask not entered\n"); -#endif return (tt); } } else Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/net/route.h Sun Oct 18 17:15:47 2020 (r366813) @@ -125,7 +125,41 @@ VNET_DECLARE(uint32_t, _rt_numfibs); /* number of exis #define rt_numfibs V_rt_numfibs VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ #define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) + +/* Calculate flowid for locally-originated packets */ +#define V_fib_hash_outbound VNET(fib_hash_outbound) +VNET_DECLARE(u_int, fib_hash_outbound); + +/* Outbound flowid generation rules */ +#ifdef RSS + +#define fib4_calc_packet_hash xps_proto_software_hash_v4 +#define fib6_calc_packet_hash xps_proto_software_hash_v6 +#define CALC_FLOWID_OUTBOUND_SENDTO true + +#ifdef ROUTE_MPATH +#define CALC_FLOWID_OUTBOUND V_fib_hash_outbound +#else +#define CALC_FLOWID_OUTBOUND false #endif + +#else /* !RSS */ + +#define fib4_calc_packet_hash fib4_calc_software_hash +#define fib6_calc_packet_hash fib6_calc_software_hash + +#ifdef ROUTE_MPATH +#define CALC_FLOWID_OUTBOUND_SENDTO V_fib_hash_outbound +#define CALC_FLOWID_OUTBOUND V_fib_hash_outbound +#else +#define CALC_FLOWID_OUTBOUND_SENDTO false +#define CALC_FLOWID_OUTBOUND false +#endif + +#endif /* RSS */ + + +#endif /* _KERNEL */ /* * We distinguish between routes to hosts and routes to networks, Modified: head/sys/net/route/mpath_ctl.c ============================================================================== --- head/sys/net/route/mpath_ctl.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/net/route/mpath_ctl.c Sun Oct 18 17:15:47 2020 (r366813) @@ -64,7 +64,21 @@ */ SYSCTL_DECL(_net_route); +VNET_DEFINE(u_int, fib_hash_outbound) = 0; +SYSCTL_UINT(_net_route, OID_AUTO, hash_outbound, CTLFLAG_RD | CTLFLAG_VNET, + &VNET_NAME(fib_hash_outbound), 0, + "Compute flowid for locally-originated packets"); +/* Default entropy to add to the hash calculation for the outbound connections*/ +uint8_t mpath_entropy_key[MPATH_ENTROPY_KEY_LEN] = { + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa, +}; + + /* * Tries to add @rnd_add nhop to the existing set of nhops (@nh_orig) for the * prefix specified by @rt. @@ -113,6 +127,17 @@ add_route_mpath(struct rib_head *rnh, struct rt_addrin if (error != EAGAIN) break; RTSTAT_INC(rts_add_retry); + } + + if (V_fib_hash_outbound == 0 && error == 0 && + NH_IS_NHGRP(rc->rc_nh_new)) { + /* + * First multipath route got installed. Enable local + * outbound connections hashing. + */ + if (bootverbose) + printf("FIB: enabled flowid calculation for locally-originated packets\n"); + V_fib_hash_outbound = 1; } return (error); Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/net/route/route_var.h Sun Oct 18 17:15:47 2020 (r366813) @@ -307,4 +307,8 @@ int nhgrp_get_addition_group(struct rib_head *rnh, void nhgrp_free(struct nhgrp_object *nhg); +/* Entropy data used for outbound hashing */ +#define MPATH_ENTROPY_KEY_LEN 40 +extern uint8_t mpath_entropy_key[MPATH_ENTROPY_KEY_LEN]; + #endif Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/in_fib.c Sun Oct 18 17:15:47 2020 (r366813) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,6 +62,40 @@ __FBSDID("$FreeBSD$"); /* Verify struct route compatiblity */ /* Assert 'struct route_in' is compatible with 'struct route' */ CHK_STRUCT_ROUTE_COMPAT(struct route_in, ro_dst4); + +#ifdef ROUTE_MPATH +struct _hash_5tuple_ipv4 { + struct in_addr src; + struct in_addr dst; + unsigned short src_port; + unsigned short dst_port; + char proto; + char spare[3]; +}; +_Static_assert(sizeof(struct _hash_5tuple_ipv4) == 16, + "_hash_5tuple_ipv4 size is wrong"); + + +uint32_t +fib4_calc_software_hash(struct in_addr src, struct in_addr dst, + unsigned short src_port, unsigned short dst_port, char proto, + uint32_t *phashtype) +{ + struct _hash_5tuple_ipv4 data; + + data.src = src; + data.dst = dst; + data.src_port = src_port; + data.dst_port = dst_port; + data.proto = proto; + data.spare[0] = data.spare[1] = data.spare[2] = 0; + + *phashtype = M_HASHTYPE_OPAQUE; + + return (toeplitz_hash(MPATH_ENTROPY_KEY_LEN, mpath_entropy_key, + sizeof(data), (uint8_t *)&data)); +} +#endif /* * Looks up path in fib @fibnum specified by @dst. Modified: head/sys/netinet/in_fib.h ============================================================================== --- head/sys/netinet/in_fib.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/in_fib.h Sun Oct 18 17:15:47 2020 (r366813) @@ -51,4 +51,7 @@ int fib4_check_urpf(uint32_t fibnum, struct in_addr ds uint32_t flags, const struct ifnet *src_if); struct nhop_object *fib4_lookup_debugnet(uint32_t fibnum, struct in_addr dst, uint32_t scopeid, uint32_t flags); +uint32_t fib4_calc_software_hash(struct in_addr src, struct in_addr dst, + unsigned short src_port, unsigned short dst_port, char proto, + uint32_t *phashtype); #endif Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/in_pcb.c Sun Oct 18 17:15:47 2020 (r366813) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ratelimit.h" #include "opt_pcbgroup.h" +#include "opt_route.h" #include "opt_rss.h" #include @@ -1327,7 +1328,17 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr lport = *lportp; faddr = sin->sin_addr; fport = sin->sin_port; +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_val, hash_type; + hash_val = fib4_calc_software_hash(laddr, faddr, 0, fport, + inp->inp_socket->so_proto->pr_protocol, &hash_type); + + inp->inp_flowid = hash_val; + inp->inp_flowtype = hash_type; + } +#endif if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { /* * If the destination address is INADDR_ANY, Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/in_rss.c Sun Oct 18 17:15:47 2020 (r366813) @@ -152,6 +152,48 @@ rss_proto_software_hash_v4(struct in_addr s, struct in } /* + * Calculate an appropriate ipv4 2-tuple or 4-tuple given the given + * IPv4 source/destination address, UDP or TCP source/destination ports + * and the protocol type. + * + * The protocol code may wish to do a software hash of the given + * tuple. This depends upon the currently configured RSS hash types. + * + * It assumes the packet source/destination address + * are in "outgoing" packet order (ie, destination is "far" address.) + */ +uint32_t +xps_proto_software_hash_v4(struct in_addr s, struct in_addr d, + u_short sp, u_short dp, int proto, uint32_t *hashtype) +{ + uint32_t hash; + + /* + * Next, choose the hash type depending upon the protocol + * identifier. + */ + if ((proto == IPPROTO_TCP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV4)) { + hash = rss_hash_ip4_4tuple(d, dp, s, sp); + *hashtype = M_HASHTYPE_RSS_TCP_IPV4; + return (hash); + } else if ((proto == IPPROTO_UDP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4)) { + hash = rss_hash_ip4_4tuple(d, dp, s, sp); + *hashtype = M_HASHTYPE_RSS_UDP_IPV4; + return (hash); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV4) { + /* RSS doesn't hash on other protocols like SCTP; so 2-tuple */ + hash = rss_hash_ip4_2tuple(d, s); + *hashtype = M_HASHTYPE_RSS_IPV4; + return (hash); + } + + *hashtype = M_HASHTYPE_NONE; + return (0); +} + +/* * Do a software calculation of the RSS for the given mbuf. * * This is typically used by the input path to recalculate the RSS after Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/in_rss.h Sun Oct 18 17:15:47 2020 (r366813) @@ -53,5 +53,7 @@ int rss_proto_software_hash_v4(struct in_addr src, uint32_t *hashtype); struct mbuf * rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid); +uint32_t xps_proto_software_hash_v4(struct in_addr s, struct in_addr d, + u_short sp, u_short dp, int proto, uint32_t *hashtype); #endif /* !_NETINET_IN_RSS_H_ */ Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/raw_ip.c Sun Oct 18 17:15:47 2020 (r366813) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_route.h" #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -484,6 +486,17 @@ rip_output(struct mbuf *m, struct socket *so, ...) ip->ip_len = htons(m->m_pkthdr.len); ip->ip_src = inp->inp_laddr; ip->ip_dst.s_addr = dst; +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_type, hash_val; + + hash_val = fib4_calc_software_hash(ip->ip_src, + ip->ip_dst, 0, 0, ip->ip_p, &hash_type); + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); + flags |= IP_NODEFAULTFLOWID; + } +#endif if (jailed(inp->inp_cred)) { /* * prison_local_ip4() would be good enough but would @@ -519,7 +532,17 @@ rip_output(struct mbuf *m, struct socket *so, ...) return (EINVAL); ip = mtod(m, struct ip *); } +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_type, hash_val; + hash_val = fib4_calc_software_hash(ip->ip_dst, + ip->ip_src, 0, 0, ip->ip_p, &hash_type); + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); + flags |= IP_NODEFAULTFLOWID; + } +#endif INP_RLOCK(inp); /* * Don't allow both user specified and setsockopt options, Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet/udp_usrreq.c Sun Oct 18 17:15:47 2020 (r366813) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_route.h" #include "opt_rss.h" #include @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1483,30 +1485,14 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s m->m_pkthdr.flowid = flowid; M_HASHTYPE_SET(m, flowtype); } -#ifdef RSS - else { +#if defined(ROUTE_MPATH) || defined(RSS) + else if (CALC_FLOWID_OUTBOUND_SENDTO) { uint32_t hash_val, hash_type; - /* - * Calculate an appropriate RSS hash for UDP and - * UDP Lite. - * - * The called function will take care of figuring out - * whether a 2-tuple or 4-tuple hash is required based - * on the currently configured scheme. - * - * Later later on connected socket values should be - * cached in the inpcb and reused, rather than constantly - * re-calculating it. - * - * UDP Lite is a different protocol number and will - * likely end up being hashed as a 2-tuple until - * RSS / NICs grow UDP Lite protocol awareness. - */ - if (rss_proto_software_hash_v4(faddr, laddr, fport, lport, - pr, &hash_val, &hash_type) == 0) { - m->m_pkthdr.flowid = hash_val; - M_HASHTYPE_SET(m, hash_type); - } + + hash_val = fib4_calc_packet_hash(laddr, faddr, + lport, fport, pr, &hash_type); + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); } /* Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/in6_fib.c Sun Oct 18 17:15:47 2020 (r366813) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -67,6 +68,39 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 CHK_STRUCT_ROUTE_COMPAT(struct route_in6, ro_dst); + +#ifdef ROUTE_MPATH +struct _hash_5tuple_ipv6 { + struct in6_addr src; + struct in6_addr dst; + unsigned short src_port; + unsigned short dst_port; + char proto; + char spare[3]; +}; +_Static_assert(sizeof(struct _hash_5tuple_ipv6) == 40, + "_hash_5tuple_ipv6 size is wrong"); + +uint32_t +fib6_calc_software_hash(const struct in6_addr *src, const struct in6_addr *dst, + unsigned short src_port, unsigned short dst_port, char proto, + uint32_t *phashtype) +{ + struct _hash_5tuple_ipv6 data; + + data.src = *src; + data.dst = *dst; + data.src_port = src_port; + data.dst_port = dst_port; + data.proto = proto; + data.spare[0] = data.spare[1] = data.spare[2] = 0; + + *phashtype = M_HASHTYPE_OPAQUE_HASH; + + return (toeplitz_hash(MPATH_ENTROPY_KEY_LEN, mpath_entropy_key, + sizeof(data), (uint8_t *)&data)); +} +#endif /* * Looks up path in fib @fibnum specified by @dst. Modified: head/sys/netinet6/in6_fib.h ============================================================================== --- head/sys/netinet6/in6_fib.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/in6_fib.h Sun Oct 18 17:15:47 2020 (r366813) @@ -39,4 +39,7 @@ int fib6_check_urpf(uint32_t fibnum, const struct in6_ uint32_t scopeid, uint32_t flags, const struct ifnet *src_if); struct nhop_object *fib6_lookup_debugnet(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid, uint32_t flags); +uint32_t fib6_calc_software_hash(const struct in6_addr *src, + const struct in6_addr *dst, unsigned short src_port, unsigned short dst_port, + char proto, uint32_t *phashtype); #endif Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/in6_pcb.c Sun Oct 18 17:15:47 2020 (r366813) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_pcbgroup.h" +#include "opt_route.h" #include "opt_rss.h" #include @@ -423,6 +424,17 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_type, hash_val; + + hash_val = fib6_calc_software_hash(&inp->in6p_laddr, + &sin6->sin6_addr, 0, sin6->sin6_port, + inp->inp_socket->so_proto->pr_protocol, &hash_type); + inp->inp_flowid = hash_val; + inp->inp_flowtype = hash_type; + } +#endif /* * Call inner routine, to assign local interface address. * in6_pcbladdr() may automatically fill in sin6_scope_id. Modified: head/sys/netinet6/in6_rss.c ============================================================================== --- head/sys/netinet6/in6_rss.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/in6_rss.c Sun Oct 18 17:15:47 2020 (r366813) @@ -153,6 +153,50 @@ rss_proto_software_hash_v6(const struct in6_addr *s, c } /* + * Calculate an appropriate ipv6 2-tuple or 4-tuple given the given + * IPv6 source/destination address, UDP or TCP source/destination ports + * and the protocol type. + * + * The protocol code may wish to do a software hash of the given + * tuple. This depends upon the currently configured RSS hash types. + * + * It assumes the packet source/destination address + * are in "outgoin" packet order (ie, destination is "far" address.) + */ +uint32_t +xps_proto_software_hash_v6(const struct in6_addr *s, const struct in6_addr *d, + u_short sp, u_short dp, int proto, uint32_t *hashtype) +{ + + uint32_t hash; + + /* + * Next, choose the hash type depending upon the protocol + * identifier. + */ + if ((proto == IPPROTO_TCP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + hash = rss_hash_ip6_4tuple(d, dp, s, sp); + *hashtype = M_HASHTYPE_RSS_TCP_IPV6; + return (hash); + } else if ((proto == IPPROTO_UDP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + hash = rss_hash_ip6_4tuple(d, dp, s, sp); + *hashtype = M_HASHTYPE_RSS_UDP_IPV6; + return (hash); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) { + /* RSS doesn't hash on other protocols like SCTP; so 2-tuple */ + hash = rss_hash_ip6_2tuple(d, s); + *hashtype = M_HASHTYPE_RSS_IPV6; + return (hash); + } + + *hashtype = M_HASHTYPE_NONE; + return (0); +} + + +/* * Do a software calculation of the RSS for the given mbuf. * * This is typically used by the input path to recalculate the RSS after Modified: head/sys/netinet6/in6_rss.h ============================================================================== --- head/sys/netinet6/in6_rss.h Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/in6_rss.h Sun Oct 18 17:15:47 2020 (r366813) @@ -54,5 +54,8 @@ int rss_proto_software_hash_v6(const struct in6_addr uint32_t *hashtype); struct mbuf * rss_soft_m2cpuid_v6(struct mbuf *m, uintptr_t source, u_int *cpuid); +uint32_t xps_proto_software_hash_v6(const struct in6_addr *s, + const struct in6_addr *d, u_short sp, u_short dp, + int proto, uint32_t *hashtype); #endif /* !_NETINET6_IN6_RSS_H_ */ Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/ip6_output.c Sun Oct 18 17:15:47 2020 (r366813) @@ -419,9 +419,6 @@ done: * * ifpp - XXX: just for statistics */ -/* - * XXX TODO: no flowid is assigned for outbound flows? - */ int ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct route_in6 *ro, int flags, struct ip6_moptions *im6o, @@ -775,7 +772,8 @@ again: } } - nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, 0); + nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, + m->m_pkthdr.flowid); if (nh == NULL) { IP6STAT_INC(ip6s_noroute); /* No ifp in6_ifstat_inc(ifp, ifs6_out_discard); */ Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/raw_ip6.c Sun Oct 18 17:15:47 2020 (r366813) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_inet6.h" +#include "opt_route.h" #include #include @@ -103,6 +104,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -462,6 +464,17 @@ rip6_output(struct mbuf *m, struct socket *so, ...) } ip6 = mtod(m, struct ip6_hdr *); +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_type, hash_val; + + hash_val = fib6_calc_software_hash(&inp->in6p_laddr, + &dstsock->sin6_addr, 0, 0, so->so_proto->pr_protocol, + &hash_type); + inp->inp_flowid = hash_val; + inp->inp_flowtype = hash_type; + } +#endif /* * Source address selection. */ Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Oct 18 16:30:49 2020 (r366812) +++ head/sys/netinet6/udp6_usrreq.c Sun Oct 18 17:15:47 2020 (r366813) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_route.h" #include "opt_rss.h" #include @@ -115,6 +116,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -954,42 +956,20 @@ udp6_output(struct socket *so, int flags_arg, struct m } flags = 0; -#ifdef RSS - { - uint32_t hash_val, hash_type; +#if defined(ROUTE_MPATH) || defined(RSS) + if (CALC_FLOWID_OUTBOUND_SENDTO) { + uint32_t hash_type, hash_val; uint8_t pr; pr = inp->inp_socket->so_proto->pr_protocol; - /* - * Calculate an appropriate RSS hash for UDP and - * UDP Lite. - * - * The called function will take care of figuring out - * whether a 2-tuple or 4-tuple hash is required based - * on the currently configured scheme. - * - * Later later on connected socket values should be - * cached in the inpcb and reused, rather than constantly - * re-calculating it. - * - * UDP Lite is a different protocol number and will - * likely end up being hashed as a 2-tuple until - * RSS / NICs grow UDP Lite protocol awareness. - */ - if (rss_proto_software_hash_v6(faddr, laddr, fport, - inp->inp_lport, pr, &hash_val, &hash_type) == 0) { - m->m_pkthdr.flowid = hash_val; - M_HASHTYPE_SET(m, hash_type); - } - /* - * Don't override with the inp cached flowid. - * - * Until the whole UDP path is vetted, it may actually - * be incorrect. - */ - flags |= IP_NODEFAULTFLOWID; + hash_val = fib6_calc_packet_hash(laddr, faddr, + inp->inp_lport, fport, pr, &hash_type); + m->m_pkthdr.flowid = hash_val; + M_HASHTYPE_SET(m, hash_type); } + /* do not use inp flowid */ + flags |= IP_NODEFAULTFLOWID; #endif UDPSTAT_INC(udps_opackets); From owner-svn-src-all@freebsd.org Sun Oct 18 17:31:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 960E14379CE; Sun, 18 Oct 2020 17:31:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDn3z3SSjz4krw; Sun, 18 Oct 2020 17:31:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B400160C8; Sun, 18 Oct 2020 17:31:11 +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 09IHVBju074596; Sun, 18 Oct 2020 17:31:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IHVB5Y074595; Sun, 18 Oct 2020 17:31:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010181731.09IHVB5Y074595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 18 Oct 2020 17:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366814 - head/contrib/llvm-project/libcxx/include X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/contrib/llvm-project/libcxx/include X-SVN-Commit-Revision: 366814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 17:31:11 -0000 Author: adrian Date: Sun Oct 18 17:31:10 2020 New Revision: 366814 URL: https://svnweb.freebsd.org/changeset/base/366814 Log: [libcxx] Fix atomic type for mips32 on gcc to work w/out needing libatomic When compiling this for mips32 on gcc-6.x, we'd hit issues where we don't have 64 bit atomics on mips32. gcc implements this using libatomic, which we don't currently include in our freebsd-gcc compiler packages. So for now add this work around so mips32 works. It's also fine for mips64. We can fix this later once we get libatomic included. Approved by: dim Differential Revision: https://reviews.freebsd.org/D26774 Modified: head/contrib/llvm-project/libcxx/include/atomic Modified: head/contrib/llvm-project/libcxx/include/atomic ============================================================================== --- head/contrib/llvm-project/libcxx/include/atomic Sun Oct 18 17:15:47 2020 (r366813) +++ head/contrib/llvm-project/libcxx/include/atomic Sun Oct 18 17:31:10 2020 (r366814) @@ -1480,11 +1480,11 @@ struct __cxx_atomic_impl : public _Base { : _Base(value) {} }; -#ifdef __linux__ +#if defined(__linux__) || (defined(__FreeBSD__) && defined(__mips__)) using __cxx_contention_t = int32_t; #else using __cxx_contention_t = int64_t; -#endif //__linux__ +#endif #if _LIBCPP_STD_VER >= 11 From owner-svn-src-all@freebsd.org Sun Oct 18 18:35:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F6B8438CAF; Sun, 18 Oct 2020 18:35:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDpV42sM0z4nNV; Sun, 18 Oct 2020 18:35:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4173516DD0; Sun, 18 Oct 2020 18:35:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IIZOTv016584; Sun, 18 Oct 2020 18:35:24 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IIZNe5016580; Sun, 18 Oct 2020 18:35:23 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010181835.09IIZNe5016580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sun, 18 Oct 2020 18:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366815 - in head: . usr.bin/mkimg/tests X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . usr.bin/mkimg/tests X-SVN-Commit-Revision: 366815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 18:35:24 -0000 Author: arichardson Date: Sun Oct 18 18:35:23 2020 New Revision: 366815 URL: https://svnweb.freebsd.org/changeset/base/366815 Log: Significantly speed up mkimg_test It turns out that the majority of the test time for the mkimg tests isn't mkimg itself but rather the use of jot and hexdump which can be quite slow on emulated platforms such as QEMU. On QEMU-RISC-V this reduces the time for `kyua test mkimg_test` from 655 seconds to 200. And for CheriBSD on QEMU-CHERI this saves 4-5 hours (25% of the time for the entire testsuite!) since jot ends up triggering slow functions inside the QEMU emulation a lot. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D26796 Modified: head/Makefile.inc1 head/usr.bin/mkimg/tests/Makefile head/usr.bin/mkimg/tests/mkimg_test.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Oct 18 17:31:10 2020 (r366814) +++ head/Makefile.inc1 Sun Oct 18 18:35:23 2020 (r366815) @@ -2342,6 +2342,8 @@ _other_bootstrap_tools+=tools/build/cross-build/fake_c .endif # mkfifo is used by sys/conf/newvers.sh _basic_bootstrap_tools+=usr.bin/mkfifo +# jot is needed for the mkimg tests +_basic_bootstrap_tools+=usr.bin/jot .if ${MK_BOOT} != "no" # md5 is used by boot/beri (and possibly others) Modified: head/usr.bin/mkimg/tests/Makefile ============================================================================== --- head/usr.bin/mkimg/tests/Makefile Sun Oct 18 17:31:10 2020 (r366814) +++ head/usr.bin/mkimg/tests/Makefile Sun Oct 18 18:35:23 2020 (r366815) @@ -15,9 +15,25 @@ $f: $f.hex sed -e '/^#.*/D' < ${.ALLSRC} > ${.TARGET} .endfor +# Note: Pre-generating this test file saves a lot of time when building on +# emulated platforms such as QEMU. It can take about 2-5 seconds to generate +# the test file using jot (depending on the emulated architecture) and this +# is done for each of the 168 test configurations. +# The effect is even more pronounced on CHERI-RISCV QEMU (emulating CHERI inside +# QEMU adds additional run-time overhead): Running the apm_1x1_512_raw without +# the pre-generated file takes about 108 seconds of which 102 seconds (over 95%) +# were spent running jot -b. It's even worse on CHERI-MIPS QEMU: 187 seconds +# for jot -b P 2097152 > /dev/null. By using a pre-generated 4MB file, the +# slowest test variant (vtoc8_63x255_4096_vhdx) now only takes 29 seconds (of +# which 26s are spent in hexdump -C) instead of previously 2min30s. +${PACKAGE}FILES+= partition_data_4M.bin +partition_data_4M.bin: Makefile + jot -b P 2097152 > ${.TARGET} || rm -f ${.TARGET} + CLEANFILES+= ${${PACKAGE}FILES}} -rebase: .PHONY - (cd ${.CURDIR}; /usr/libexec/atf-sh ${_REBASE_SCRIPT}.sh rebase) +rebase: partition_data_4M.bin ${_REBASE_SCRIPT} .PHONY + cd ${.CURDIR}; PATH=${.OBJDIR}/..:$${PATH}:/usr/bin:/bin \ + /usr/libexec/atf-sh ${.OBJDIR}/${_REBASE_SCRIPT} -s ${.OBJDIR} rebase .include Modified: head/usr.bin/mkimg/tests/mkimg_test.sh ============================================================================== --- head/usr.bin/mkimg/tests/mkimg_test.sh Sun Oct 18 17:31:10 2020 (r366814) +++ head/usr.bin/mkimg/tests/mkimg_test.sh Sun Oct 18 18:35:23 2020 (r366815) @@ -56,7 +56,7 @@ makeimage() if test -z "$partarg"; then local swap ufs swap="-p freebsd-swap::128K" - ufs="-p freebsd-ufs:=`mkcontents P 4194304`" + ufs="-p freebsd-ufs:=$(atf_get_srcdir)/partition_data_4M.bin" partarg="$ufs $swap" fi From owner-svn-src-all@freebsd.org Sun Oct 18 19:51:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 780A143A095; Sun, 18 Oct 2020 19:51:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDrB70ln0z4qym; Sun, 18 Oct 2020 19:51:42 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (unknown [IPv6:2601:646:8601:f4a:e670:b8ff:fe5c:4e69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 884DC47915; Sun, 18 Oct 2020 12:51:36 -0700 (PDT) Reply-To: d@delphij.net Subject: Re: svn commit: r366781 - in head: include lib/libc/stdlib To: Konstantin Belousov , Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010170414.09H4EdBF097521@repo.freebsd.org> <20201017065326.GY2643@kib.kiev.ua> From: Xin Li Organization: The FreeBSD Project Message-ID: <592395b1-3985-5416-a06a-44335321799f@delphij.net> Date: Sun, 18 Oct 2020 12:51:35 -0700 MIME-Version: 1.0 In-Reply-To: <20201017065326.GY2643@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CDrB70ln0z4qym X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.38 / 15.00]; HAS_REPLYTO(0.00)[d@delphij.net]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; RCPT_COUNT_FIVE(0.00)[5]; HAS_ORG_HEADER(0.00)[]; DKIM_TRACE(0.00)[delphij.net:+]; DMARC_POLICY_ALLOW(-0.50)[delphij.net,reject]; NEURAL_HAM_SHORT(-0.47)[-0.474]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:64.62.128.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.933]; R_DKIM_ALLOW(-0.20)[delphij.net:s=m7e2]; FREEFALL_USER(0.00)[delphij]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.973]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 19:51:44 -0000 Hi, Thanks very much for the feedback. I have created a new change for review at https://reviews.freebsd.org/D26845 , could you please take a look and let me know if it's satisfactory? On 10/16/20 11:53 PM, Konstantin Belousov wrote: [...]>> +int ptsname_r(int, char *, size_t); > This declaration appears in the __XSI_VISIBLE block, but I do not see the > function description in the IEEE Std 1003.1â„¢-2017 text (base issue 7). > > Review mentioned that the function is scheduled for issue 8, but shouldn't > it put under BSD_VISIBLE until specification is finalized ? Good point, fixed in the proposed change. [...] >> Modified: head/lib/libc/stdlib/Symbol.map >> ============================================================================== >> --- head/lib/libc/stdlib/Symbol.map Sat Oct 17 01:06:04 2020 (r366780) >> +++ head/lib/libc/stdlib/Symbol.map Sat Oct 17 04:14:38 2020 (r366781) >> @@ -125,6 +125,7 @@ FBSD_1.6 { >> qsort_s; >> rand; >> srand; >> + ptsname_r; > This is unsorted now. Fixed in the proposed change. [...] >> +{ >> + static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN]; > We usually write sizeof(_PATH_DEV). This was from previous code so I leave it as-is, but fixed in the proposed change. >> + >> + if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) > Since ptsname_r is non-standard and exported, userspace is allowed to > interpose the symbol, which would break ptsname(). Thanks for pointing it out -- I should have paid more attention here. Fixed in the proposed change. >> + return (pt_slave); >> + else > 'else' is redundand. Removed else and used a straight return instead. Cheers, From owner-svn-src-all@freebsd.org Sun Oct 18 20:54:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6225C43BA0A; Sun, 18 Oct 2020 20:54:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDsZJ1tvvz3SVS; Sun, 18 Oct 2020 20:54:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23F8618277; Sun, 18 Oct 2020 20:54:16 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09IKsGih004459; Sun, 18 Oct 2020 20:54:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IKsFHU004455; Sun, 18 Oct 2020 20:54:15 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010182054.09IKsFHU004455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 18 Oct 2020 20:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366816 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 366816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 20:54:16 -0000 Author: melifaro Date: Sun Oct 18 20:54:15 2020 New Revision: 366816 URL: https://svnweb.freebsd.org/changeset/base/366816 Log: MFC r363173: [ipfw] quieten maybe-uninitialized errors in ipfw. PR: 250434 Reported by: brndr Modified: stable/12/sbin/ipfw/dummynet.c stable/12/sbin/ipfw/ipfw2.c stable/12/sbin/ipfw/nat64lsn.c stable/12/sbin/ipfw/tables.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/dummynet.c ============================================================================== --- stable/12/sbin/ipfw/dummynet.c Sun Oct 18 18:35:23 2020 (r366815) +++ stable/12/sbin/ipfw/dummynet.c Sun Oct 18 20:54:15 2020 (r366816) @@ -1279,8 +1279,8 @@ ipfw_config_pipe(int ac, char **av) struct dn_profile *pf = NULL; struct ipfw_flow_id *mask = NULL; #ifdef NEW_AQM - struct dn_extra_parms *aqm_extra; - struct dn_extra_parms *sch_extra; + struct dn_extra_parms *aqm_extra = NULL; + struct dn_extra_parms *sch_extra = NULL; int lmax_extra; #endif Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Sun Oct 18 18:35:23 2020 (r366815) +++ stable/12/sbin/ipfw/ipfw2.c Sun Oct 18 20:54:15 2020 (r366816) @@ -1618,6 +1618,9 @@ print_instruction(struct buf_pr *bp, const struct form case O_TCPWIN: s = "tcpwin"; break; + default: + s = ""; + break; } bprintf(bp, " %s %u", s, cmd->arg1); } else @@ -4003,7 +4006,7 @@ chkarg: struct addrinfo *res; char *s, *end; int family; - u_short port_number; + u_short port_number = 0; NEED1("missing forward address[:port]"); @@ -5600,7 +5603,7 @@ ifinfo_cmp(const void *a, const void *b) static void ipfw_list_tifaces(void) { - ipfw_obj_lheader *olh; + ipfw_obj_lheader *olh = NULL; ipfw_iface_info *info; uint32_t i; int error; @@ -5608,7 +5611,6 @@ ipfw_list_tifaces(void) if ((error = ipfw_get_tracked_ifaces(&olh)) != 0) err(EX_OSERR, "Unable to request ipfw tracked interface list"); - qsort(olh + 1, olh->count, olh->objsize, ifinfo_cmp); info = (ipfw_iface_info *)(olh + 1); @@ -5625,7 +5627,3 @@ ipfw_list_tifaces(void) free(olh); } - - - - Modified: stable/12/sbin/ipfw/nat64lsn.c ============================================================================== --- stable/12/sbin/ipfw/nat64lsn.c Sun Oct 18 18:35:23 2020 (r366815) +++ stable/12/sbin/ipfw/nat64lsn.c Sun Oct 18 20:54:15 2020 (r366816) @@ -99,6 +99,7 @@ nat64lsn_print_states(void *buf) stg = (ipfw_nat64lsn_stg_v1 *)(od + 1); sz = od->head.length - sizeof(*od); next_idx = 0; + proto = NULL; while (sz > 0 && next_idx != 0xFF) { next_idx = stg->next.index; sz -= sizeof(*stg); Modified: stable/12/sbin/ipfw/tables.c ============================================================================== --- stable/12/sbin/ipfw/tables.c Sun Oct 18 18:35:23 2020 (r366815) +++ stable/12/sbin/ipfw/tables.c Sun Oct 18 20:54:15 2020 (r366816) @@ -847,7 +847,7 @@ table_show_info(ipfw_xtable_info *i, void *arg) static int table_show_one(ipfw_xtable_info *i, void *arg) { - ipfw_obj_header *oh; + ipfw_obj_header *oh = NULL; int error; int is_all; @@ -1179,7 +1179,7 @@ tentry_fill_key_type(char *arg, ipfw_obj_tentry *tentr struct servent *sent; int masklen; - masklen = 0; + mask = masklen = 0; af = 0; paddr = (struct in6_addr *)&tentry->k; From owner-svn-src-all@freebsd.org Sun Oct 18 21:34:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4576143D205; Sun, 18 Oct 2020 21:34:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDtSF13MQz3W3P; Sun, 18 Oct 2020 21:34:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0882619033; Sun, 18 Oct 2020 21:34:05 +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 09ILY4xf028987; Sun, 18 Oct 2020 21:34:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ILY4Jx028985; Sun, 18 Oct 2020 21:34:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010182134.09ILY4Jx028985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 18 Oct 2020 21:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366817 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 366817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 21:34:05 -0000 Author: bz Date: Sun Oct 18 21:34:04 2020 New Revision: 366817 URL: https://svnweb.freebsd.org/changeset/base/366817 Log: net80211: factor out the priv(9) checks into OS specifc code. Factor out the priv(9) checks into OS specifc code so other OSes can equally implement them. This sorts out those XXX in the net80211 code. We provide 3 arguments (cmd, vap, ifp) where available to the functions, in order to allow other OSes to use that data but also in case we'd add auditing to these check to have the information available. For now the arguments are marked __unused. PR: 249403 Reported by: martin(NetBSD) Reviewed by: adrian, martin(NetBSD) MFC after: 10 days Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26541 Modified: head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sun Oct 18 20:54:15 2020 (r366816) +++ head/sys/net80211/ieee80211_freebsd.c Sun Oct 18 21:34:04 2020 (r366817) @@ -75,6 +75,42 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ie static const char wlanname[] = "wlan"; static struct if_clone *wlan_cloner; +/* + * priv(9) NET80211 checks. + * Return 0 if operation is allowed, E* (usually EPERM) otherwise. + */ +int +ieee80211_priv_check_vap_getkey(u_long cmd __unused, + struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) +{ + + return (priv_check(curthread, PRIV_NET80211_VAP_GETKEY)); +} + +int +ieee80211_priv_check_vap_manage(u_long cmd __unused, + struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) +{ + + return (priv_check(curthread, PRIV_NET80211_VAP_MANAGE)); +} + +int +ieee80211_priv_check_vap_setmac(u_long cmd __unused, + struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) +{ + + return (priv_check(curthread, PRIV_NET80211_VAP_SETMAC)); +} + +int +ieee80211_priv_check_create_vap(u_long cmd __unused, + struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) +{ + + return (priv_check(curthread, PRIV_NET80211_CREATE_VAP)); +} + static int wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) { @@ -83,7 +119,7 @@ wlan_clone_create(struct if_clone *ifc, int unit, cadd struct ieee80211com *ic; int error; - error = priv_check(curthread, PRIV_NET80211_CREATE_VAP); + error = ieee80211_priv_check_create_vap(0, NULL, NULL); if (error) return error; Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun Oct 18 20:54:15 2020 (r366816) +++ head/sys/net80211/ieee80211_freebsd.h Sun Oct 18 21:34:04 2020 (r366817) @@ -43,6 +43,19 @@ #include /* + * priv(9) NET80211 checks. + */ +struct ieee80211vap; +int ieee80211_priv_check_vap_getkey(u_long, struct ieee80211vap *, + struct ifnet *); +int ieee80211_priv_check_vap_manage(u_long, struct ieee80211vap *, + struct ifnet *); +int ieee80211_priv_check_vap_setmac(u_long, struct ieee80211vap *, + struct ifnet *); +int ieee80211_priv_check_create_vap(u_long, struct ieee80211vap *, + struct ifnet *); + +/* * Common state locking definitions. */ typedef struct { Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Oct 18 20:54:15 2020 (r366816) +++ head/sys/net80211/ieee80211_ioctl.c Sun Oct 18 21:34:04 2020 (r366817) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -72,7 +71,8 @@ static int ieee80211_scanreq(struct ieee80211vap *, struct ieee80211_scan_req *); static int -ieee80211_ioctl_getkey(struct ieee80211vap *vap, struct ieee80211req *ireq) +ieee80211_ioctl_getkey(u_long cmd, struct ieee80211vap *vap, + struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; @@ -106,8 +106,7 @@ ieee80211_ioctl_getkey(struct ieee80211vap *vap, struc ik.ik_flags = wk->wk_flags & (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV); if (wk->wk_keyix == vap->iv_def_txkey) ik.ik_flags |= IEEE80211_KEY_DEFAULT; - /* XXX TODO: move priv check to ieee80211_freebsd.c */ - if (priv_check(curthread, PRIV_NET80211_VAP_GETKEY) == 0) { + if (ieee80211_priv_check_vap_getkey(cmd, vap, NULL) == 0) { /* NB: only root can read key data */ ik.ik_keyrsc = wk->wk_keyrsc[IEEE80211_NONQOS_TID]; ik.ik_keytsc = wk->wk_keytsc; @@ -822,8 +821,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_l return EINVAL; len = (u_int) vap->iv_nw_keys[kid].wk_keylen; /* NB: only root can read WEP keys */ - /* XXX TODO: move priv check to ieee80211_freebsd.c */ - if (priv_check(curthread, PRIV_NET80211_VAP_GETKEY) == 0) { + if (ieee80211_priv_check_vap_getkey(cmd, vap, NULL) == 0) { bcopy(vap->iv_nw_keys[kid].wk_key, tmpkey, len); } else { bzero(tmpkey, len); @@ -916,7 +914,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_l ireq->i_val = (vap->iv_flags & IEEE80211_F_NOBRIDGE) == 0; break; case IEEE80211_IOC_WPAKEY: - error = ieee80211_ioctl_getkey(vap, ireq); + error = ieee80211_ioctl_getkey(cmd, vap, ireq); break; case IEEE80211_IOC_CHANINFO: error = ieee80211_ioctl_getchaninfo(vap, ireq); @@ -3630,8 +3628,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t (struct ieee80211req *) data); break; case SIOCS80211: - /* XXX TODO: move priv check to ieee80211_freebsd.c */ - error = priv_check(curthread, PRIV_NET80211_VAP_MANAGE); + error = ieee80211_priv_check_vap_manage(cmd, vap, ifp); if (error == 0) error = ieee80211_ioctl_set80211(vap, cmd, (struct ieee80211req *) data); @@ -3677,8 +3674,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t } break; case SIOCSIFLLADDR: - /* XXX TODO: move priv check to ieee80211_freebsd.c */ - error = priv_check(curthread, PRIV_NET80211_VAP_SETMAC); + error = ieee80211_priv_check_vap_setmac(cmd, vap, ifp); if (error == 0) break; /* Fallthrough */ From owner-svn-src-all@freebsd.org Sun Oct 18 22:37:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB40543E25C; Sun, 18 Oct 2020 22:37:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDvsy5T17z3Xxp; Sun, 18 Oct 2020 22:37:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE5C19BBA; Sun, 18 Oct 2020 22:37:58 +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 09IMbwsF065912; Sun, 18 Oct 2020 22:37:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09IMbwGb065911; Sun, 18 Oct 2020 22:37:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010182237.09IMbwGb065911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 18 Oct 2020 22:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366818 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 22:37:58 -0000 Author: adrian Date: Sun Oct 18 22:37:58 2020 New Revision: 366818 URL: https://svnweb.freebsd.org/changeset/base/366818 Log: [zfs] Remove a non-existent directory in the build infra This directory doesn't exist and causes gcc-6.4 to complain about a non-existent include directory Approved by: kevans, imp Differential Revision: https://reviews.freebsd.org/D26846 Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sun Oct 18 21:34:04 2020 (r366817) +++ head/sys/conf/kmod.mk Sun Oct 18 22:37:58 2020 (r366818) @@ -540,7 +540,6 @@ OPENZFS_CFLAGS= \ -nostdinc \ -DSMP \ -I${ZINCDIR} \ - -I${ZINCDIR}/spl \ -I${ZINCDIR}/os/freebsd \ -I${ZINCDIR}/os/freebsd/spl \ -I${ZINCDIR}/os/freebsd/zfs \ From owner-svn-src-all@freebsd.org Sun Oct 18 23:32:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B93B43ED74; Sun, 18 Oct 2020 23:32:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDx5D38YNz3b8n; Sun, 18 Oct 2020 23:32:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5019D1A7F0; Sun, 18 Oct 2020 23:32:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09INWmt4002563; Sun, 18 Oct 2020 23:32:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09INWluw002559; Sun, 18 Oct 2020 23:32:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010182332.09INWluw002559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 18 Oct 2020 23:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366819 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 366819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 23:32:48 -0000 Author: kevans Date: Sun Oct 18 23:32:47 2020 New Revision: 366819 URL: https://svnweb.freebsd.org/changeset/base/366819 Log: libbe(3): const'ify a couple arguments libbe will never need to mutate these as we either process them into a local buffer or we just don't touch them and write to a separate out argument. MFC after: 1 week Modified: head/lib/libbe/be.h head/lib/libbe/be_access.c head/lib/libbe/be_info.c head/lib/libbe/libbe.3 Modified: head/lib/libbe/be.h ============================================================================== --- head/lib/libbe/be.h Sun Oct 18 22:37:58 2020 (r366818) +++ head/lib/libbe/be.h Sun Oct 18 23:32:47 2020 (r366819) @@ -112,8 +112,8 @@ typedef enum { BE_MNT_DEEP = 1 << 1, } be_mount_opt_t; -int be_mount(libbe_handle_t *, char *, char *, int, char *); -int be_unmount(libbe_handle_t *, char *, int); +int be_mount(libbe_handle_t *, const char *, const char *, int, char *); +int be_unmount(libbe_handle_t *, const char *, int); int be_mounted_at(libbe_handle_t *, const char *path, nvlist_t *); /* Error related functions: be_error.c */ @@ -125,7 +125,7 @@ void libbe_print_on_error(libbe_handle_t *, bool); int be_root_concat(libbe_handle_t *, const char *, char *); int be_validate_name(libbe_handle_t * __unused, const char *); int be_validate_snap(libbe_handle_t *, const char *); -int be_exists(libbe_handle_t *, char *); +int be_exists(libbe_handle_t *, const char *); int be_export(libbe_handle_t *, const char *, int fd); int be_import(libbe_handle_t *, const char *, int fd); Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Sun Oct 18 22:37:58 2020 (r366818) +++ head/lib/libbe/be_access.c Sun Oct 18 23:32:47 2020 (r366819) @@ -232,8 +232,8 @@ be_mounted_at(libbe_handle_t *lbh, const char *path, n * usage */ int -be_mount(libbe_handle_t *lbh, char *bootenv, char *mountpoint, int flags, - char *result_loc) +be_mount(libbe_handle_t *lbh, const char *bootenv, const char *mountpoint, + int flags, char *result_loc) { char be[BE_MAXPATHLEN]; char mnt_temp[BE_MAXPATHLEN]; @@ -288,7 +288,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou * usage */ int -be_unmount(libbe_handle_t *lbh, char *bootenv, int flags) +be_unmount(libbe_handle_t *lbh, const char *bootenv, int flags) { int err; char be[BE_MAXPATHLEN]; Modified: head/lib/libbe/be_info.c ============================================================================== --- head/lib/libbe/be_info.c Sun Oct 18 22:37:58 2020 (r366818) +++ head/lib/libbe/be_info.c Sun Oct 18 23:32:47 2020 (r366819) @@ -305,7 +305,7 @@ be_prop_list_free(nvlist_t *be_list) * Usage */ int -be_exists(libbe_handle_t *lbh, char *be) +be_exists(libbe_handle_t *lbh, const char *be) { char buf[BE_MAXPATHLEN]; Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Sun Oct 18 22:37:58 2020 (r366818) +++ head/lib/libbe/libbe.3 Sun Oct 18 23:32:47 2020 (r366819) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2020 +.Dd August 18, 2020 .Dt LIBBE 3 .Os .Sh NAME @@ -94,13 +94,13 @@ .\" BE_MNT_DEEP = 1 << 1, .\" } be_mount_opt_t .Ft int -.Fn be_mount "libbe_handle_t *hdl" "char *be_name" "char *mntpoint" "int flags" "char *result" +.Fn be_mount "libbe_handle_t *hdl" "const char *be_name" "const char *mntpoint" "int flags" "char *result" .Pp .Ft int .Fn be_mounted_at "libbe_handle_t *hdl" "const char *path" "nvlist_t *details" .Pp .Ft int -.Fn be_unmount "libbe_handle_t *hdl" "char *be_name" "int flags" +.Fn be_unmount "libbe_handle_t *hdl" "const char *be_name" "int flags" .Pp .Ft int .Fn libbe_errno "libbe_handle_t *hdl" @@ -121,7 +121,7 @@ .Fn be_validate_snap "libbe_handle_t *hdl" "const char *snap" .Pp .Ft int -.Fn be_exists "libbe_handle_t *hdl" "char *be_name" +.Fn be_exists "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int .Fn be_export "libbe_handle_t *hdl" "const char *be_name" "int fd" From owner-svn-src-all@freebsd.org Sun Oct 18 23:42:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32FBE43F317; Sun, 18 Oct 2020 23:42:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDxHs0cnfz3bNm; Sun, 18 Oct 2020 23:42:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECD091AC00; Sun, 18 Oct 2020 23:42:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09INg06g007801; Sun, 18 Oct 2020 23:42:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09INg0CX007800; Sun, 18 Oct 2020 23:42:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010182342.09INg0CX007800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 18 Oct 2020 23:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366820 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 366820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 23:42:01 -0000 Author: kevans Date: Sun Oct 18 23:42:00 2020 New Revision: 366820 URL: https://svnweb.freebsd.org/changeset/base/366820 Log: libbe(3): document be_snapshot() While toying around with lua bindings for libbe(3), I discovered that I apparently never documented this, despite having documented be_is_auto_snapshot_name that references it. MFC after: 1 week Modified: head/lib/libbe/libbe.3 Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Sun Oct 18 23:32:47 2020 (r366819) +++ head/lib/libbe/libbe.3 Sun Oct 18 23:42:00 2020 (r366820) @@ -58,6 +58,9 @@ .Ft const char * Ns .Fn be_root_path "libbe_handle_t *hdl" .Pp +.Ft int Ns +.Fn be_snapshot "libbe_handle_t *hdl" "const char *be_name" "const char *snap_name" "bool recursive" "char *result" +.Pp .Ft bool Ns .Fn be_is_auto_snapshot_name "libbe_handle_t *hdl" "const char *snap" .Pp @@ -218,6 +221,30 @@ active on reboot. The .Fn be_root_path function returns the boot environment root path. +.Pp +The +.Fn be_snapshot +function creates a snapshot of +.Fa be_name +named +.Fa snap_name . +A +.Dv NULL +.Fa snap_name +may be used, indicating that +.Fn be_snaphot +should derive the snapshot name from the current date and time. +If +.Fa recursive +is set, then +.Fn be_snapshot +will recursively snapshot the dataset. +If +.Fa result +is not +.Dv NULL , +then it will be populated with the final +.Dq Fa be_name Ns @ Ns Fa snap_name . .Pp The .Fn be_is_auto_snapshot_name From owner-svn-src-all@freebsd.org Sun Oct 18 23:58:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 216E043F2F4; Sun, 18 Oct 2020 23:58:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDxg46zZvz3bqy; Sun, 18 Oct 2020 23:58:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEEC11ABBA; Sun, 18 Oct 2020 23:58:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09INwePi014826; Sun, 18 Oct 2020 23:58:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09INwepp014824; Sun, 18 Oct 2020 23:58:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010182358.09INwepp014824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 18 Oct 2020 23:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366821 - in head: lib/libbe tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe tools/build/mk X-SVN-Commit-Revision: 366821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 23:58:41 -0000 Author: kevans Date: Sun Oct 18 23:58:40 2020 New Revision: 366821 URL: https://svnweb.freebsd.org/changeset/base/366821 Log: libbe(3): install MLINKS for all of the functions provided MFC after: 1 week Modified: head/lib/libbe/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/libbe/Makefile ============================================================================== --- head/lib/libbe/Makefile Sun Oct 18 23:42:00 2020 (r366820) +++ head/lib/libbe/Makefile Sun Oct 18 23:58:40 2020 (r366821) @@ -11,6 +11,41 @@ SHLIB_MINOR= 0 SRCS= be.c be_access.c be_error.c be_info.c INCS= be.h MAN= libbe.3 +MLINKS+= libbe.3 be_activate.3 +MLINKS+= libbe.3 be_active_name.3 +MLINKS+= libbe.3 be_active_path.3 +MLINKS+= libbe.3 be_create_depth.3 +MLINKS+= libbe.3 be_create_from_existing_snap.3 +MLINKS+= libbe.3 be_create_from_existing.3 +MLINKS+= libbe.3 be_create.3 +MLINKS+= libbe.3 be_deactivate.3 +MLINKS+= libbe.3 be_destroy.3 +MLINKS+= libbe.3 be_exists.3 +MLINKS+= libbe.3 be_export.3 +MLINKS+= libbe.3 be_get_bootenv_props.3 +MLINKS+= libbe.3 be_get_dataset_props.3 +MLINKS+= libbe.3 be_get_dataset_snapshots.3 +MLINKS+= libbe.3 be_import.3 +MLINKS+= libbe.3 be_is_auto_snapshot_name.3 +MLINKS+= libbe.3 be_mount.3 +MLINKS+= libbe.3 be_mounted_at.3 +MLINKS+= libbe.3 be_nextboot_name.3 +MLINKS+= libbe.3 be_nextboot_path.3 +MLINKS+= libbe.3 be_nicenum.3 +MLINKS+= libbe.3 be_prop_list_alloc.3 +MLINKS+= libbe.3 be_prop_list_free.3 +MLINKS+= libbe.3 be_rename.3 +MLINKS+= libbe.3 be_root_concat.3 +MLINKS+= libbe.3 be_root_path.3 +MLINKS+= libbe.3 be_snapshot.3 +MLINKS+= libbe.3 be_unmount.3 +MLINKS+= libbe.3 be_validate_name.3 +MLINKS+= libbe.3 be_validate_snap.3 +MLINKS+= libbe.3 libbe_close.3 +MLINKS+= libbe.3 libbe_errno.3 +MLINKS+= libbe.3 libbe_error_description.3 +MLINKS+= libbe.3 libbe_init.3 +MLINKS+= libbe.3 libbe_print_on_error.3 LIBADD+= zfs LIBADD+= nvpair Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Oct 18 23:42:00 2020 (r366820) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Oct 18 23:58:40 2020 (r366821) @@ -1172,6 +1172,41 @@ OLD_LIBS+=usr/lib32/libzpool.so.2 OLD_FILES+=usr/sbin/zfsd OLD_FILES+=usr/sbin/zhack OLD_FILES+=usr/sbin/zdb +OLD_FILES+=usr/share/man/man3/be_activate.3.gz +OLD_FILES+=usr/share/man/man3/be_active_name.3.gz +OLD_FILES+=usr/share/man/man3/be_active_path.3.gz +OLD_FILES+=usr/share/man/man3/be_create_depth.3.gz +OLD_FILES+=usr/share/man/man3/be_create_from_existing_snap.3.gz +OLD_FILES+=usr/share/man/man3/be_create_from_existing.3.gz +OLD_FILES+=usr/share/man/man3/be_create.3.gz +OLD_FILES+=usr/share/man/man3/be_deactivate.3.gz +OLD_FILES+=usr/share/man/man3/be_destroy.3.gz +OLD_FILES+=usr/share/man/man3/be_exists.3.gz +OLD_FILES+=usr/share/man/man3/be_export.3.gz +OLD_FILES+=usr/share/man/man3/be_get_bootenv_props.3.gz +OLD_FILES+=usr/share/man/man3/be_get_dataset_props.3.gz +OLD_FILES+=usr/share/man/man3/be_get_dataset_snapshots.3.gz +OLD_FILES+=usr/share/man/man3/be_import.3.gz +OLD_FILES+=usr/share/man/man3/be_is_auto_snapshot_name.3.gz +OLD_FILES+=usr/share/man/man3/be_mount.3.gz +OLD_FILES+=usr/share/man/man3/be_mounted_at.3.gz +OLD_FILES+=usr/share/man/man3/be_nextboot_name.3.gz +OLD_FILES+=usr/share/man/man3/be_nextboot_path.3.gz +OLD_FILES+=usr/share/man/man3/be_nicenum.3.gz +OLD_FILES+=usr/share/man/man3/be_prop_list_alloc.3.gz +OLD_FILES+=usr/share/man/man3/be_prop_list_free.3.gz +OLD_FILES+=usr/share/man/man3/be_rename.3.gz +OLD_FILES+=usr/share/man/man3/be_root_concat.3.gz +OLD_FILES+=usr/share/man/man3/be_root_path.3.gz +OLD_FILES+=usr/share/man/man3/be_snapshot.3.gz +OLD_FILES+=usr/share/man/man3/be_unmount.3.gz +OLD_FILES+=usr/share/man/man3/be_validate_name.3.gz +OLD_FILES+=usr/share/man/man3/be_validate_snap.3.gz +OLD_FILES+=usr/share/man/man3/libbe_close.3.gz +OLD_FILES+=usr/share/man/man3/libbe_errno.3.gz +OLD_FILES+=usr/share/man/man3/libbe_error_description.3.gz +OLD_FILES+=usr/share/man/man3/libbe_init.3.gz +OLD_FILES+=usr/share/man/man3/libbe_print_on_error.3.gz OLD_FILES+=usr/share/man/man3/libbe.3.gz OLD_FILES+=usr/share/man/man5/zpool-features.5.gz OLD_FILES+=usr/share/man/man8/bectl.8.gz From owner-svn-src-all@freebsd.org Mon Oct 19 01:16:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 927E5440BBF; Mon, 19 Oct 2020 01:16:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDzP43JnQz3fdG; Mon, 19 Oct 2020 01:16:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 550D71BA22; Mon, 19 Oct 2020 01:16:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09J1Ge6V063354; Mon, 19 Oct 2020 01:16:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09J1GeNt063353; Mon, 19 Oct 2020 01:16:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010190116.09J1GeNt063353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 19 Oct 2020 01:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366822 - in head: share/man/man5 usr.bin/login X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: share/man/man5 usr.bin/login X-SVN-Commit-Revision: 366822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 01:16:40 -0000 Author: imp Date: Mon Oct 19 01:16:39 2020 New Revision: 366822 URL: https://svnweb.freebsd.org/changeset/base/366822 Log: Add more explicit instructions about updating motd Not that you can regenerate the motd by editing motd.template and running 'service motd restart' rather than rebooting. Small wordsmithing by me, and updated the example from FreeBSD 2.1.6.1 release to 12.1 release. Submitted by: Dan Mack Modified: head/share/man/man5/motd.5 head/usr.bin/login/motd.template Modified: head/share/man/man5/motd.5 ============================================================================== --- head/share/man/man5/motd.5 Sun Oct 18 23:58:40 2020 (r366821) +++ head/share/man/man5/motd.5 Mon Oct 19 01:16:39 2020 (r366822) @@ -3,7 +3,7 @@ .\" This file is in the public domain. .\" $FreeBSD$ .\" -.Dd July 20, 2019 +.Dd October 18, 2020 .Dt MOTD 5 .Os .Sh NAME @@ -22,6 +22,14 @@ prepended to and the contents are written to .Pa /var/run/motd . .Pp +.Pa /var/run/motd +can be updated without a system reboot by manually restarting the +motd service after updating +.Pa /etc/motd.template: +.Bd -literal -offset -ident -compact +service motd restart +.Ed +.Pp Individual users may suppress the display of this file by creating a file named .Dq Pa .hushlogin @@ -39,7 +47,7 @@ Suppresses output of .El .Sh EXAMPLES .Bd -literal -FreeBSD 2.1.6.1-RELEASE (GENERIC) #0: Sun Dec 29 03:08:31 PST 1996 +FreeBSD 12.1-RELEASE (GENERIC) #0: Sun Dec 29 03:08:31 PST 2019 /home is full. Please cleanup your directories. .Ed Modified: head/usr.bin/login/motd.template ============================================================================== --- head/usr.bin/login/motd.template Sun Oct 18 23:58:40 2020 (r366821) +++ head/usr.bin/login/motd.template Mon Oct 19 01:16:39 2020 (r366822) @@ -17,4 +17,4 @@ Please include that output and any error messages when Introduction to manual pages: man man FreeBSD directory layout: man hier -Edit /etc/motd.template to change this login announcement. +To change this login announcement, see motd(5). From owner-svn-src-all@freebsd.org Mon Oct 19 06:44:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0A6C446E33; Mon, 19 Oct 2020 06:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF6fv5PqPz4BpZ; Mon, 19 Oct 2020 06:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CFD11F86A; Mon, 19 Oct 2020 06:44:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09J6i7Xc065825; Mon, 19 Oct 2020 06:44:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09J6i7lS065824; Mon, 19 Oct 2020 06:44:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202010190644.09J6i7lS065824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Oct 2020 06:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366826 - stable/12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/usb/controller X-SVN-Commit-Revision: 366826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 06:44:07 -0000 Author: avg Date: Mon Oct 19 06:44:07 2020 New Revision: 366826 URL: https://svnweb.freebsd.org/changeset/base/366826 Log: MFC r365401: musb/allwinner: add H3 support Modified: stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Mon Oct 19 02:12:32 2020 (r366825) +++ stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Mon Oct 19 06:44:07 2020 (r366826) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #endif #define DRD_EP_MAX 5 +#define DRD_EP_MAX_H3 4 #define MUSB2_REG_AWIN_VEND0 0x0043 #define VEND0_PIO_MODE 0 @@ -89,12 +90,13 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-musb", AWUSB_OKAY }, { "allwinner,sun6i-a31-musb", AWUSB_OKAY }, { "allwinner,sun8i-a33-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, + { "allwinner,sun8i-h3-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, { NULL, 0 } }; static const struct musb_otg_ep_cfg musbotg_ep_allwinner[] = { { - .ep_end = 5, + .ep_end = DRD_EP_MAX, .ep_fifosz_shift = 9, .ep_fifosz_reg = MUSB2_VAL_FIFOSZ_512, }, @@ -103,6 +105,17 @@ static const struct musb_otg_ep_cfg musbotg_ep_allwinn }, }; +static const struct musb_otg_ep_cfg musbotg_ep_allwinner_h3[] = { + { + .ep_end = DRD_EP_MAX_H3, + .ep_fifosz_shift = 9, + .ep_fifosz_reg = MUSB2_VAL_FIFOSZ_512, + }, + { + .ep_end = -1, + }, +}; + struct awusbdrd_softc { struct musbotg_softc sc; struct resource *res[2]; @@ -445,8 +458,13 @@ awusbdrd_attach(device_t dev) sc->sc.sc_id = 0; sc->sc.sc_platform_data = sc; sc->sc.sc_mode = MUSB2_HOST_MODE; /* XXX HOST vs DEVICE mode */ - sc->sc.sc_ep_max = DRD_EP_MAX; - sc->sc.sc_ep_cfg = musbotg_ep_allwinner; + if (ofw_bus_is_compatible(dev, "allwinner,sun8i-h3-musb")) { + sc->sc.sc_ep_cfg = musbotg_ep_allwinner_h3; + sc->sc.sc_ep_max = DRD_EP_MAX_H3; + } else { + sc->sc.sc_ep_cfg = musbotg_ep_allwinner; + sc->sc.sc_ep_max = DRD_EP_MAX; + } error = bus_setup_intr(dev, sc->res[1], INTR_MPSAFE | INTR_TYPE_BIO, NULL, awusbdrd_intr, sc, &sc->sc.sc_intr_hdl); From owner-svn-src-all@freebsd.org Mon Oct 19 07:03:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9EC644738A; Mon, 19 Oct 2020 07:03:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF74n3ntnz4CrM; Mon, 19 Oct 2020 07:03:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662A31F8F8; Mon, 19 Oct 2020 07:03:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09J735u7078466; Mon, 19 Oct 2020 07:03:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09J7358s078465; Mon, 19 Oct 2020 07:03:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202010190703.09J7358s078465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Oct 2020 07:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366827 - stable/12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/usb/controller X-SVN-Commit-Revision: 366827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 07:03:05 -0000 Author: avg Date: Mon Oct 19 07:03:04 2020 New Revision: 366827 URL: https://svnweb.freebsd.org/changeset/base/366827 Log: MFC r365402: musb/allwinner: add support for configuring phy as well as device mode At least on Orange Pi PC Plus even the host mode does not work without enabling the phy and setting it to the host mode. The driver will now parse dr_mode property and will try to configure itself and the phy accordingly. OTG mode is not supported yet, so it is treated as the device / peripheral mode. The phy is enabled -- powered on -- only for the host mode. The device mode requires support from a phy driver, e.g., aw_usbphy on Allwinner platform. aw_usbphy does not support the device mode, so it cannnot work yet. Modified: stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Mon Oct 19 06:44:07 2020 (r366826) +++ stable/12/sys/dev/usb/controller/musb_otg_allwinner.c Mon Oct 19 07:03:04 2020 (r366827) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #ifdef __arm__ #include @@ -121,6 +123,7 @@ struct awusbdrd_softc { struct resource *res[2]; clk_t clk; hwreset_t reset; + phy_t phy; struct bus_space bs; int flags; }; @@ -382,7 +385,10 @@ awusbdrd_probe(device_t dev) static int awusbdrd_attach(device_t dev) { + char usb_mode[24]; struct awusbdrd_softc *sc; + uint8_t musb_mode; + int phy_mode; int error; sc = device_get_softc(dev); @@ -392,6 +398,31 @@ awusbdrd_attach(device_t dev) if (error != 0) return (error); + musb_mode = MUSB2_HOST_MODE; /* default */ + phy_mode = PHY_USB_MODE_HOST; + if (OF_getprop(ofw_bus_get_node(dev), "dr_mode", + &usb_mode, sizeof(usb_mode)) > 0) { + usb_mode[sizeof(usb_mode) - 1] = 0; + if (strcasecmp(usb_mode, "host") == 0) { + musb_mode = MUSB2_HOST_MODE; + phy_mode = PHY_USB_MODE_HOST; + } else if (strcasecmp(usb_mode, "peripheral") == 0) { + musb_mode = MUSB2_DEVICE_MODE; + phy_mode = PHY_USB_MODE_DEVICE; + } else if (strcasecmp(usb_mode, "otg") == 0) { + /* + * XXX phy has PHY_USB_MODE_OTG, but MUSB does not have + * it. It's not clear how to propagate mode changes + * from phy layer (that detects them) to MUSB. + */ + musb_mode = MUSB2_DEVICE_MODE; + phy_mode = PHY_USB_MODE_DEVICE; + } else { + device_printf(dev, "Invalid FDT dr_mode: %s\n", + usb_mode); + } + } + /* AHB gate clock is required */ error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); if (error != 0) @@ -415,6 +446,24 @@ awusbdrd_attach(device_t dev) } } + /* XXX not sure if this is universally needed. */ + (void)phy_get_by_ofw_name(dev, 0, "usb", &sc->phy); + if (sc->phy != NULL) { + device_printf(dev, "setting phy mode %d\n", phy_mode); + if (musb_mode == MUSB2_HOST_MODE) { + error = phy_enable(sc->phy); + if (error != 0) { + device_printf(dev, "Could not enable phy\n"); + goto fail; + } + } + error = phy_usb_set_mode(sc->phy, phy_mode); + if (error != 0) { + device_printf(dev, "Could not set phy mode\n"); + goto fail; + } + } + sc->sc.sc_bus.parent = dev; sc->sc.sc_bus.devices = sc->sc.sc_devices; sc->sc.sc_bus.devices_max = MUSB2_MAX_DEVICES; @@ -457,7 +506,7 @@ awusbdrd_attach(device_t dev) device_set_ivars(sc->sc.sc_bus.bdev, &sc->sc.sc_bus); sc->sc.sc_id = 0; sc->sc.sc_platform_data = sc; - sc->sc.sc_mode = MUSB2_HOST_MODE; /* XXX HOST vs DEVICE mode */ + sc->sc.sc_mode = musb_mode; if (ofw_bus_is_compatible(dev, "allwinner,sun8i-h3-musb")) { sc->sc.sc_ep_cfg = musbotg_ep_allwinner_h3; sc->sc.sc_ep_max = DRD_EP_MAX_H3; @@ -497,8 +546,15 @@ awusbdrd_attach(device_t dev) return (0); fail: - if (sc->reset != NULL) + if (sc->phy != NULL) { + if (musb_mode == MUSB2_HOST_MODE) + (void)phy_disable(sc->phy); + phy_release(sc->phy); + } + if (sc->reset != NULL) { + hwreset_assert(sc->reset); hwreset_release(sc->reset); + } if (sc->clk != NULL) clk_release(sc->clk); bus_release_resources(dev, awusbdrd_spec, sc->res); @@ -527,8 +583,16 @@ awusbdrd_detach(device_t dev) usb_bus_mem_free_all(&sc->sc.sc_bus, NULL); - if (sc->reset != NULL) + if (sc->phy != NULL) { + if (sc->sc.sc_mode == MUSB2_HOST_MODE) + phy_disable(sc->phy); + phy_release(sc->phy); + } + if (sc->reset != NULL) { + if (hwreset_assert(sc->reset) != 0) + device_printf(dev, "failed to assert reset\n"); hwreset_release(sc->reset); + } if (sc->clk != NULL) clk_release(sc->clk); From owner-svn-src-all@freebsd.org Mon Oct 19 07:26:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCC6A447B27; Mon, 19 Oct 2020 07:26:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF7c251rbz4Dn1; Mon, 19 Oct 2020 07:26:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9080420168; Mon, 19 Oct 2020 07:26: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 09J7QgPw090965; Mon, 19 Oct 2020 07:26:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09J7Qg6m090964; Mon, 19 Oct 2020 07:26:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010190726.09J7Qg6m090964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 19 Oct 2020 07:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366828 - head/usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/pkg X-SVN-Commit-Revision: 366828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 07:26:42 -0000 Author: bapt Date: Mon Oct 19 07:26:42 2020 New Revision: 366828 URL: https://svnweb.freebsd.org/changeset/base/366828 Log: Use asprintf instead of sbuf Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Mon Oct 19 07:03:04 2020 (r366827) +++ head/usr.sbin/pkg/config.c Mon Oct 19 07:26:42 2020 (r366828) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include @@ -168,7 +168,7 @@ pkg_get_myabi(char *dest, size_t sz) static void subst_packagesite(const char *abi) { - struct sbuf *newval; + char *newval; const char *variable_string; const char *oldval; @@ -180,14 +180,14 @@ subst_packagesite(const char *abi) if ((variable_string = strstr(oldval, "${ABI}")) == NULL) return; - newval = sbuf_new_auto(); - sbuf_bcat(newval, oldval, variable_string - oldval); - sbuf_cat(newval, abi); - sbuf_cat(newval, variable_string + strlen("${ABI}")); - sbuf_finish(newval); + asprintf(&newval, "%.*s%s%s", + (int)(variable_string - oldval), oldval, abi, + variable_string + strlen("${ABI}")); + if (newval == NULL) + errx(EXIT_FAILURE, "asprintf"); free(c[PACKAGESITE].value); - c[PACKAGESITE].value = strdup(sbuf_data(newval)); + c[PACKAGESITE].value = newval; } static int From owner-svn-src-all@freebsd.org Mon Oct 19 09:52:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 496AF44AE9C; Mon, 19 Oct 2020 09:52:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFBrj1Fx7z4N8w; Mon, 19 Oct 2020 09:52:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E79221D19; Mon, 19 Oct 2020 09:52:53 +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 09J9qqrD083268; Mon, 19 Oct 2020 09:52:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09J9qqFi083267; Mon, 19 Oct 2020 09:52:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010190952.09J9qqFi083267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 19 Oct 2020 09:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366829 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 09:52:53 -0000 Author: mjg Date: Mon Oct 19 09:52:52 2020 New Revision: 366829 URL: https://svnweb.freebsd.org/changeset/base/366829 Log: cache: refactor negative promotion/demotion handling This will simplify policy changes. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Oct 19 07:26:42 2020 (r366828) +++ head/sys/kern/vfs_cache.c Mon Oct 19 09:52:52 2020 (r366829) @@ -908,11 +908,37 @@ cache_neg_init(struct namecache *ncp) counter_u64_add(neg_created, 1); } +static bool +cache_neg_hit_prep(struct namecache *ncp) +{ + struct negstate *ns; + + ns = NCP2NEGSTATE(ncp); + if ((ns->neg_flag & NEG_HOT) != 0) + return (true); + return (false); +} + /* + * Nothing to do here but it is provided for completeness as some + * cache_neg_hit_prep callers may end up returning without even + * trying to promote. + */ +#define cache_neg_hit_abort(ncp) do { } while (0) + +static void +cache_neg_hit_finish(struct namecache *ncp) +{ + + SDT_PROBE2(vfs, namecache, lookup, hit__negative, ncp->nc_dvp, ncp->nc_name); + counter_u64_add(numneghits, 1); +} + +/* * Move a negative entry to the hot list. */ static void -cache_neg_promote(struct namecache *ncp) +cache_neg_promote_locked(struct namecache *ncp) { struct neglist *nl; struct negstate *ns; @@ -929,6 +955,25 @@ cache_neg_promote(struct namecache *ncp) } /* + * Move a hot negative entry to the cold list. + */ +static void +cache_neg_demote_locked(struct namecache *ncp) +{ + struct neglist *nl; + struct negstate *ns; + + ns = NCP2NEGSTATE(ncp); + nl = NCP2NEGLIST(ncp); + mtx_assert(&nl->nl_lock, MA_OWNED); + MPASS(ns->neg_flag & NEG_HOT); + TAILQ_REMOVE(&nl->nl_hotlist, ncp, nc_dst); + TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst); + nl->nl_hotnum--; + ns->neg_flag &= ~NEG_HOT; +} + +/* * Move a negative entry to the hot list if it matches the lookup. * * We have to take locks, but they may be contended and in the worst @@ -996,10 +1041,8 @@ cache_neg_promote_cond(struct vnode *dvp, struct compo goto out_abort; } - cache_neg_promote(ncp); - - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - counter_u64_add(numneghits, 1); + cache_neg_promote_locked(ncp); + cache_neg_hit_finish(ncp); vfs_smr_exit(); mtx_unlock(&nl->nl_lock); return (true); @@ -1010,17 +1053,13 @@ out_abort: } static void -cache_neg_hit(struct namecache *ncp) +cache_neg_promote(struct namecache *ncp) { struct neglist *nl; - struct negstate *ns; - ns = NCP2NEGSTATE(ncp); - if ((ns->neg_flag & NEG_HOT) != 0) - return; nl = NCP2NEGLIST(ncp); mtx_lock(&nl->nl_lock); - cache_neg_promote(ncp); + cache_neg_promote_locked(ncp); mtx_unlock(&nl->nl_lock); } @@ -1094,11 +1133,7 @@ cache_neg_evict(void) mtx_lock(&nl->nl_lock); ncp = TAILQ_FIRST(&nl->nl_hotlist); if (ncp != NULL) { - ns = NCP2NEGSTATE(ncp); - TAILQ_REMOVE(&nl->nl_hotlist, ncp, nc_dst); - TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst); - nl->nl_hotnum--; - ns->neg_flag &= ~NEG_HOT; + cache_neg_demote_locked(ncp); } ncp = TAILQ_FIRST(&nl->nl_list); if (ncp == NULL) { @@ -1542,11 +1577,12 @@ negative_success: } } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - cache_out_ts(ncp, tsp, ticksp); - counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - cache_neg_hit(ncp); + cache_out_ts(ncp, tsp, ticksp); + if (cache_neg_hit_prep(ncp)) + cache_neg_promote(ncp); + else + cache_neg_hit_finish(ncp); mtx_unlock(dvlp); if (whiteout) cnp->cn_flags |= ISWHITEOUT; @@ -1653,11 +1689,12 @@ negative_success: } } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - cache_out_ts(ncp, tsp, ticksp); - counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - cache_neg_hit(ncp); + cache_out_ts(ncp, tsp, ticksp); + if (cache_neg_hit_prep(ncp)) + cache_neg_promote(ncp); + else + cache_neg_hit_finish(ncp); mtx_unlock(blp); if (whiteout) cnp->cn_flags |= ISWHITEOUT; @@ -1669,11 +1706,10 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st struct timespec *tsp, int *ticksp) { struct namecache *ncp; - struct negstate *ns; uint32_t hash; enum vgetstate vs; int error; - bool whiteout, neg_hot; + bool whiteout, neg_promote; u_short nc_flag; MPASS((tsp == NULL && ticksp == NULL) || (tsp != NULL && ticksp != NULL)); @@ -1752,19 +1788,18 @@ negative_success: cache_out_ts(ncp, tsp, ticksp); whiteout = (ncp->nc_flag & NCF_WHITE); - ns = NCP2NEGSTATE(ncp); - neg_hot = ((ns->neg_flag & NEG_HOT) != 0); + neg_promote = cache_neg_hit_prep(ncp); if (__predict_false(!cache_ncp_canuse(ncp))) { + cache_neg_hit_abort(ncp); vfs_smr_exit(); goto out_fallback; } - if (!neg_hot) { + if (neg_promote) { vfs_smr_exit(); if (!cache_neg_promote_cond(dvp, cnp, ncp, hash)) goto out_fallback; } else { - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - counter_u64_add(numneghits, 1); + cache_neg_hit_finish(ncp); vfs_smr_exit(); } if (whiteout) @@ -3917,12 +3952,9 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) static int __noinline cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash) { - struct negstate *ns; - struct vnode *dvp; u_char nc_flag; - bool neg_hot; + bool neg_promote; - dvp = fpl->dvp; nc_flag = atomic_load_char(&ncp->nc_flag); MPASS((nc_flag & NCF_NEGATIVE) != 0); /* @@ -3936,19 +3968,19 @@ cache_fplookup_neg(struct cache_fpl *fpl, struct namec */ return (cache_fpl_partial(fpl)); } - ns = NCP2NEGSTATE(ncp); - neg_hot = ((ns->neg_flag & NEG_HOT) != 0); + neg_promote = cache_neg_hit_prep(ncp); if (__predict_false(!cache_ncp_canuse(ncp))) { + cache_neg_hit_abort(ncp); return (cache_fpl_partial(fpl)); } if (__predict_false((nc_flag & NCF_WHITE) != 0)) { + cache_neg_hit_abort(ncp); return (cache_fpl_partial(fpl)); } - if (!neg_hot) { + if (neg_promote) { return (cache_fplookup_negative_promote(fpl, ncp, hash)); } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - counter_u64_add(numneghits, 1); + cache_neg_hit_finish(ncp); cache_fpl_smr_exit(fpl); return (cache_fpl_handled(fpl, ENOENT)); } From owner-svn-src-all@freebsd.org Mon Oct 19 10:38:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C038744B9AA; Mon, 19 Oct 2020 10:38:40 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFCsX4jNVz4QBq; Mon, 19 Oct 2020 10:38:40 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80A2B22465; Mon, 19 Oct 2020 10:38:40 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JAce1t008376; Mon, 19 Oct 2020 10:38:40 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JAcepX008375; Mon, 19 Oct 2020 10:38:40 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010191038.09JAcepX008375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 19 Oct 2020 10:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366830 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 366830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 10:38:40 -0000 Author: freqlabs Date: Mon Oct 19 10:38:40 2020 New Revision: 366830 URL: https://svnweb.freebsd.org/changeset/base/366830 Log: efibootmgr: Use returned error code for error message, not errno efivar_unix_path_to_device_path returns the error code, it does not set errno. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26852 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Mon Oct 19 09:52:52 2020 (r366829) +++ head/usr.sbin/efibootmgr/efibootmgr.c Mon Oct 19 10:38:40 2020 (r366830) @@ -674,11 +674,16 @@ make_boot_var(const char *label, const char *loader, c err(1, "bootvar creation"); if (loader == NULL) errx(1, "Must specify boot loader"); - if (efivar_unix_path_to_device_path(loader, &loaderdp) != 0) - err(1, "Cannot translate unix loader path '%s' to UEFI", loader); + ret = efivar_unix_path_to_device_path(loader, &loaderdp); + if (ret != 0) + errc(1, ret, "Cannot translate unix loader path '%s' to UEFI", + loader); if (kernel != NULL) { - if (efivar_unix_path_to_device_path(kernel, &kerneldp) != 0) - err(1, "Cannot translate unix kernel path '%s' to UEFI", kernel); + ret = efivar_unix_path_to_device_path(kernel, &kerneldp); + if (ret != 0) + errc(1, ret, + "Cannot translate unix kernel path '%s' to UEFI", + kernel); } else { kerneldp = NULL; } From owner-svn-src-all@freebsd.org Mon Oct 19 12:06:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 726E844E40C; Mon, 19 Oct 2020 12:06:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFFpd27w8z4Wcg; Mon, 19 Oct 2020 12:06:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C9C1231F0; Mon, 19 Oct 2020 12:06:17 +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 09JC6HYL063684; Mon, 19 Oct 2020 12:06:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JC6Gi0063682; Mon, 19 Oct 2020 12:06:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010191206.09JC6Gi0063682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 19 Oct 2020 12:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366831 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 12:06:17 -0000 Author: andrew Date: Mon Oct 19 12:06:16 2020 New Revision: 366831 URL: https://svnweb.freebsd.org/changeset/base/366831 Log: Move the arm64 userspace access checks to macros In the functions that copy between userspace and kernel space we check the user space address is valid before performing the copy. These are mostly identical within each type of function so create two macros to perform the check. Obtained from: CheriBSD Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/copyinout.S head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Mon Oct 19 10:38:40 2020 (r366830) +++ head/sys/arm64/arm64/copyinout.S Mon Oct 19 12:06:16 2020 (r366831) @@ -37,6 +37,14 @@ __FBSDID("$FreeBSD$"); #include "assym.inc" +.macro check_user_access user_arg, size_arg, bad_access_func + adds x6, x\user_arg, x\size_arg + b.cs \bad_access_func + ldr x7, =VM_MAXUSER_ADDRESS + cmp x6, x7 + b.hi \bad_access_func +.endm + /* * Fault handler for the copy{in,out} functions below. */ @@ -55,11 +63,7 @@ END(copyio_fault) */ ENTRY(copyout) cbz x2, 1f - adds x3, x1, x2 - b.cs copyio_fault_nopcb - ldr x4, =VM_MAXUSER_ADDRESS - cmp x3, x4 - b.hi copyio_fault_nopcb + check_user_access 1, 2, copyio_fault_nopcb b copycommon @@ -75,11 +79,7 @@ END(copyout) */ ENTRY(copyin) cbz x2, 1f - adds x3, x0, x2 - b.cs copyio_fault_nopcb - ldr x4, =VM_MAXUSER_ADDRESS - cmp x3, x4 - b.hi copyio_fault_nopcb + check_user_access 0, 2, copyio_fault_nopcb b copycommon Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Mon Oct 19 10:38:40 2020 (r366830) +++ head/sys/arm64/arm64/support.S Mon Oct 19 12:06:16 2020 (r366831) @@ -38,6 +38,12 @@ __FBSDID("$FreeBSD$"); #include "assym.inc" +.macro check_user_access user_arg, limit, bad_addr_func + ldr x7, =(\limit) + cmp x\user_arg, x7 + b.cs \bad_addr_func +.endm + /* * One of the fu* or su* functions failed, return -1. */ @@ -53,9 +59,7 @@ END(fsu_fault) * int casueword32(volatile uint32_t *, uint32_t, uint32_t *, uint32_t) */ ENTRY(casueword32) - ldr x4, =(VM_MAXUSER_ADDRESS-3) - cmp x0, x4 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-3), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ mov w5, #1 SET_FAULT_HANDLER(x6, x4) /* And set it */ @@ -75,9 +79,7 @@ END(casueword32) * int casueword(volatile u_long *, u_long, u_long *, u_long) */ ENTRY(casueword) - ldr x4, =(VM_MAXUSER_ADDRESS-7) - cmp x0, x4 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-7), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ mov w5, #1 SET_FAULT_HANDLER(x6, x4) /* And set it */ @@ -97,9 +99,7 @@ END(casueword) * int fubyte(volatile const void *) */ ENTRY(fubyte) - ldr x1, =VM_MAXUSER_ADDRESS - cmp x0, x1 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ ldtrb w0, [x0] /* Try loading the data */ @@ -111,9 +111,7 @@ END(fubyte) * int fuword(volatile const void *) */ ENTRY(fuword16) - ldr x1, =(VM_MAXUSER_ADDRESS-1) - cmp x0, x1 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-1), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x1) /* And set it */ ldtrh w0, [x0] /* Try loading the data */ @@ -125,9 +123,7 @@ END(fuword16) * int32_t fueword32(volatile const void *, int32_t *) */ ENTRY(fueword32) - ldr x2, =(VM_MAXUSER_ADDRESS-3) - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-3), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ ldtr w0, [x0] /* Try loading the data */ @@ -143,9 +139,7 @@ END(fueword32) */ ENTRY(fueword) EENTRY(fueword64) - ldr x2, =(VM_MAXUSER_ADDRESS-7) - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-7), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ ldtr x0, [x0] /* Try loading the data */ @@ -160,9 +154,7 @@ END(fueword) * int subyte(volatile void *, int) */ ENTRY(subyte) - ldr x2, =VM_MAXUSER_ADDRESS - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ sttrb w1, [x0] /* Try storing the data */ @@ -175,9 +167,7 @@ END(subyte) * int suword16(volatile void *, int) */ ENTRY(suword16) - ldr x2, =(VM_MAXUSER_ADDRESS-1) - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-1), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ sttrh w1, [x0] /* Try storing the data */ @@ -190,9 +180,7 @@ END(suword16) * int suword32(volatile void *, int) */ ENTRY(suword32) - ldr x2, =(VM_MAXUSER_ADDRESS-3) - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-3), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ sttr w1, [x0] /* Try storing the data */ @@ -206,9 +194,7 @@ END(suword32) */ ENTRY(suword) EENTRY(suword64) - ldr x2, =(VM_MAXUSER_ADDRESS-7) - cmp x0, x2 - b.cs fsu_fault_nopcb + check_user_access 0, (VM_MAXUSER_ADDRESS-7), fsu_fault_nopcb adr x6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(x6, x2) /* And set it */ sttr x1, [x0] /* Try storing the data */ From owner-svn-src-all@freebsd.org Mon Oct 19 12:46:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6346E44EF69; Mon, 19 Oct 2020 12:46:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFGhX1xD2z4YRL; Mon, 19 Oct 2020 12:46:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25AD023D31; Mon, 19 Oct 2020 12:46:04 +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 09JCk4YV088269; Mon, 19 Oct 2020 12:46:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JCk4YY088268; Mon, 19 Oct 2020 12:46:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010191246.09JCk4YY088268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 19 Oct 2020 12:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366832 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 12:46:04 -0000 Author: andrew Date: Mon Oct 19 12:46:03 2020 New Revision: 366832 URL: https://svnweb.freebsd.org/changeset/base/366832 Log: Split the common arm64 fu* and su* asm to a macro As these are mostly identical split out the common code to a macro. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Mon Oct 19 12:06:16 2020 (r366831) +++ head/sys/arm64/arm64/support.S Mon Oct 19 12:46:03 2020 (r366832) @@ -95,15 +95,19 @@ ENTRY(casueword) ret /* Return */ END(casueword) +.macro fsudata insn, ret_reg, user_arg + adr x7, fsu_fault /* Load the fault handler */ + SET_FAULT_HANDLER(x7, x6) /* And set it */ + \insn \ret_reg, [x\user_arg] /* Try accessing the data */ + SET_FAULT_HANDLER(xzr, x6) /* Reset the fault handler */ +.endm + /* * int fubyte(volatile const void *) */ ENTRY(fubyte) check_user_access 0, (VM_MAXUSER_ADDRESS), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldtrb w0, [x0] /* Try loading the data */ - SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ + fsudata ldtrb, w0, 0 ret /* Return */ END(fubyte) @@ -112,10 +116,7 @@ END(fubyte) */ ENTRY(fuword16) check_user_access 0, (VM_MAXUSER_ADDRESS-1), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x1) /* And set it */ - ldtrh w0, [x0] /* Try loading the data */ - SET_FAULT_HANDLER(xzr, x1) /* Reset the fault handler */ + fsudata ldtrh, w0, 0 ret /* Return */ END(fuword16) @@ -124,10 +125,7 @@ END(fuword16) */ ENTRY(fueword32) check_user_access 0, (VM_MAXUSER_ADDRESS-3), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - ldtr w0, [x0] /* Try loading the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata ldtr, w0, 0 str w0, [x1] /* Save the data in kernel space */ mov w0, #0 /* Success */ ret /* Return */ @@ -140,10 +138,7 @@ END(fueword32) ENTRY(fueword) EENTRY(fueword64) check_user_access 0, (VM_MAXUSER_ADDRESS-7), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - ldtr x0, [x0] /* Try loading the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata ldtr, x0, 0 str x0, [x1] /* Save the data in kernel space */ mov x0, #0 /* Success */ ret /* Return */ @@ -155,10 +150,7 @@ END(fueword) */ ENTRY(subyte) check_user_access 0, (VM_MAXUSER_ADDRESS), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - sttrb w1, [x0] /* Try storing the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata sttrb, w1, 0 mov x0, #0 /* Success */ ret /* Return */ END(subyte) @@ -168,10 +160,7 @@ END(subyte) */ ENTRY(suword16) check_user_access 0, (VM_MAXUSER_ADDRESS-1), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - sttrh w1, [x0] /* Try storing the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata sttrh, w1, 0 mov x0, #0 /* Success */ ret /* Return */ END(suword16) @@ -181,10 +170,7 @@ END(suword16) */ ENTRY(suword32) check_user_access 0, (VM_MAXUSER_ADDRESS-3), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - sttr w1, [x0] /* Try storing the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata sttr, w1, 0 mov x0, #0 /* Success */ ret /* Return */ END(suword32) @@ -195,10 +181,7 @@ END(suword32) ENTRY(suword) EENTRY(suword64) check_user_access 0, (VM_MAXUSER_ADDRESS-7), fsu_fault_nopcb - adr x6, fsu_fault /* Load the fault handler */ - SET_FAULT_HANDLER(x6, x2) /* And set it */ - sttr x1, [x0] /* Try storing the data */ - SET_FAULT_HANDLER(xzr, x2) /* Reset the fault handler */ + fsudata sttr, x1, 0 mov x0, #0 /* Success */ ret /* Return */ EEND(suword64) From owner-svn-src-all@freebsd.org Mon Oct 19 13:10:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CE3944FA2D; Mon, 19 Oct 2020 13:10:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFHDb0LXGz4Zmw; Mon, 19 Oct 2020 13:10:23 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4850240C8; Mon, 19 Oct 2020 13:10:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JDAMQb000959; Mon, 19 Oct 2020 13:10:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JDALHp000954; Mon, 19 Oct 2020 13:10:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010191310.09JDALHp000954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 19 Oct 2020 13:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366833 - in head/sys: dev/iommu kern sys X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu kern sys X-SVN-Commit-Revision: 366833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 13:10:23 -0000 Author: br Date: Mon Oct 19 13:10:21 2020 New Revision: 366833 URL: https://svnweb.freebsd.org/changeset/base/366833 Log: Manage MSI iommu pages. This allows the interrupt controller driver only need a small change to create a map for the page the device will write to raise an interrupt. Submitted by: andrew Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26705 Added: head/sys/dev/iommu/iommu_msi.h (contents, props changed) Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/kern/msi_if.m head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Mon Oct 19 12:46:03 2020 (r366832) +++ head/sys/dev/iommu/iommu.h Mon Oct 19 13:10:21 2020 (r366833) @@ -111,6 +111,9 @@ struct iommu_domain { iommu_gaddr_t end; /* (c) Highest address + 1 in the guest AS */ struct iommu_map_entry *first_place, *last_place; /* (d) */ + struct iommu_map_entry *msi_entry; /* (d) Arch-specific */ + iommu_gaddr_t msi_base; /* (d) Arch-specific */ + vm_paddr_t msi_phys; /* (d) Arch-specific */ u_int flags; /* (u) */ }; Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Mon Oct 19 12:46:03 2020 (r366832) +++ head/sys/dev/iommu/iommu_gas.c Mon Oct 19 13:10:21 2020 (r366833) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -722,6 +723,69 @@ iommu_map(struct iommu_domain *domain, ma, res); return (error); +} + +int +iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma) +{ + struct iommu_domain *domain; + struct iommu_map_entry *entry; + int error; + + error = 0; + domain = ctx->domain; + + /* Check if there is already an MSI page allocated */ + IOMMU_DOMAIN_LOCK(domain); + entry = domain->msi_entry; + IOMMU_DOMAIN_UNLOCK(domain); + + if (entry == NULL) { + error = iommu_gas_map(domain, &ctx->tag->common, size, offset, + eflags, flags, ma, &entry); + IOMMU_DOMAIN_LOCK(domain); + if (error == 0) { + if (domain->msi_entry == NULL) { + MPASS(domain->msi_base == 0); + MPASS(domain->msi_phys == 0); + + domain->msi_entry = entry; + domain->msi_base = entry->start; + domain->msi_phys = VM_PAGE_TO_PHYS(ma[0]); + } else { + /* + * We lost the race and already have an + * MSI page allocated. Free the unneeded entry. + */ + iommu_gas_free_entry(domain, entry); + } + } else if (domain->msi_entry != NULL) { + /* + * The allocation failed, but another succeeded. + * Return success as there is a valid MSI page. + */ + error = 0; + } + IOMMU_DOMAIN_UNLOCK(domain); + } + + return (error); +} + +void +iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr) +{ + + *addr = (*addr - domain->msi_phys) + domain->msi_base; + + KASSERT(*addr >= domain->msi_entry->start, + ("%s: Address is below the MSI entry start address (%jx < %jx)", + __func__, (uintmax_t)*addr, (uintmax_t)domain->msi_entry->start)); + + KASSERT(*addr + sizeof(*addr) <= domain->msi_entry->end, + ("%s: Address is above the MSI entry end address (%jx < %jx)", + __func__, (uintmax_t)*addr, (uintmax_t)domain->msi_entry->end)); } int Added: head/sys/dev/iommu/iommu_msi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/iommu_msi.h Mon Oct 19 13:10:21 2020 (r366833) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Andrew Turner + * + * This work was supported by Innovate UK project 105694, "Digital Security + * by Design (DSbD) Technology Platform Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IOMMU_IOMMU_MSI_H_ +#define _DEV_IOMMU_IOMMU_MSI_H_ + +#include + +struct iommu_unit; +struct iommu_domain; +struct iommu_ctx; + +void iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr); +int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, + u_int eflags, u_int flags, vm_page_t *ma); + +#endif /* !_DEV_IOMMU_IOMMU_MSI_H_ */ Modified: head/sys/kern/msi_if.m ============================================================================== --- head/sys/kern/msi_if.m Mon Oct 19 12:46:03 2020 (r366832) +++ head/sys/kern/msi_if.m Mon Oct 19 13:10:21 2020 (r366833) @@ -32,6 +32,9 @@ INTERFACE msi; HEADER { + #include + #include + struct intr_irqsrc; }; @@ -72,3 +75,8 @@ METHOD int map_msi { uint32_t *data; }; +METHOD int iommu_init { + device_t dev; + device_t child; + struct iommu_domain **domain; +}; Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon Oct 19 12:46:03 2020 (r366832) +++ head/sys/kern/subr_intr.c Mon Oct 19 13:10:21 2020 (r366833) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" +#include "opt_iommu.h" #include #include @@ -50,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -70,6 +73,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef IOMMU +#include +#endif + #include "pic_if.h" #include "msi_if.h" @@ -1290,6 +1297,9 @@ int intr_alloc_msi(device_t pci, device_t child, intptr_t xref, int count, int maxcount, int *irqs) { +#ifdef IOMMU + struct iommu_domain *domain; +#endif struct intr_irqsrc **isrc; struct intr_pic *pic; device_t pdev; @@ -1304,6 +1314,16 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); +#ifdef IOMMU + /* + * If this is the first time we have used this context ask the + * interrupt controller to map memory the msi source will need. + */ + err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain); + if (err != 0) + return (err); +#endif + isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); if (err != 0) { @@ -1312,9 +1332,13 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t } for (i = 0; i < count; i++) { +#ifdef IOMMU + isrc[i]->isrc_iommu = domain; +#endif msi = (struct intr_map_data_msi *)intr_alloc_map_data( INTR_MAP_DATA_MSI, sizeof(*msi), M_WAITOK | M_ZERO); msi-> isrc = isrc[i]; + irqs[i] = intr_map_irq(pic->pic_dev, xref, (struct intr_map_data *)msi); } @@ -1365,6 +1389,9 @@ intr_release_msi(device_t pci, device_t child, intptr_ int intr_alloc_msix(device_t pci, device_t child, intptr_t xref, int *irq) { +#ifdef IOMMU + struct iommu_domain *domain; +#endif struct intr_irqsrc *isrc; struct intr_pic *pic; device_t pdev; @@ -1379,10 +1406,23 @@ intr_alloc_msix(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); +#ifdef IOMMU + /* + * If this is the first time we have used this context ask the + * interrupt controller to map memory the msi source will need. + */ + err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain); + if (err != 0) + return (err); +#endif + err = MSI_ALLOC_MSIX(pic->pic_dev, child, &pdev, &isrc); if (err != 0) return (err); +#ifdef IOMMU + isrc->isrc_iommu = domain; +#endif msi = (struct intr_map_data_msi *)intr_alloc_map_data( INTR_MAP_DATA_MSI, sizeof(*msi), M_WAITOK | M_ZERO); msi->isrc = isrc; @@ -1444,6 +1484,12 @@ intr_map_msi(device_t pci, device_t child, intptr_t xr return (EINVAL); err = MSI_MAP_MSI(pic->pic_dev, child, isrc, addr, data); + +#ifdef IOMMU + if (isrc->isrc_iommu != NULL) + iommu_translate_msi(isrc->isrc_iommu, addr); +#endif + return (err); } Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Mon Oct 19 12:46:03 2020 (r366832) +++ head/sys/sys/intr.h Mon Oct 19 13:10:21 2020 (r366833) @@ -94,6 +94,8 @@ struct intr_irqsrc { intr_irq_filter_t * isrc_filter; void * isrc_arg; #endif + /* Used by MSI interrupts to store the iommu details */ + void * isrc_iommu; }; /* Intr interface for PIC. */ From owner-svn-src-all@freebsd.org Mon Oct 19 14:08:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29928429031 for ; Mon, 19 Oct 2020 14:08:37 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFJWm2G6Fz4dMQ for ; Mon, 19 Oct 2020 14:08:36 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f54.google.com with SMTP id d81so10462763wmc.1 for ; Mon, 19 Oct 2020 07:08:36 -0700 (PDT) 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=5R5pdH4R32/0k5o0GwSTPn6c4ahM8/mwab1+6Sr2TEg=; b=HsxjjuiWHkDwC+xPAO+9yMhDMR0iU0niQPnKjuXMJoRuDVvQozjgqe9XlAYoneDzPe SXRjqO/CCg9zQemuUPCOL5ejCOcjaXzIpXBv79CpOQegL031+KAJpxyPdMYjuHorSJB5 SXK9l7VhAvXjjaqvANoO1GZ1MNI+GqPsLf42mrKDyFdkbN+1rrOQsmZ5lvR7MLDMoFCV u0M7Rw6F5HsNN8UG4sdcx/VMyjM7/vjOpV1Gb8nvn9rlAp/n3KiD4d0vqJjnq+h0lEfp vL4NzqR0yj5LZg9ffAF1xMUAocxfCI2/dr4gETcFjRl3hj+KLEDlbjQArosfjcqrH9/O qjyA== X-Gm-Message-State: AOAM533CxDEQ9Dh0Z4eUB4Vt8SdFTKCykIIlUjLc8j2gO4+U6stLweg7 gbUEToosg+630NCKH1tgFoZnig== X-Google-Smtp-Source: ABdhPJw5edk7YKfNUtfB17P7Hxyex+v7PYB/rG5Ol7+SVnOzLn0NGs03BrUzNlKtvcg+ES+f6ONw5Q== X-Received: by 2002:a1c:7c09:: with SMTP id x9mr18455009wmc.181.1603116514494; Mon, 19 Oct 2020 07:08:34 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id j17sm17323727wrw.68.2020.10.19.07.08.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2020 07:08:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366833 - in head/sys: dev/iommu kern sys From: Jessica Clarke In-Reply-To: <202010191310.09JDALHp000954@repo.freebsd.org> Date: Mon, 19 Oct 2020 15:08:32 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <917B04A7-C9CA-439B-8334-C602F1E68005@freebsd.org> References: <202010191310.09JDALHp000954@repo.freebsd.org> To: Ruslan Bukin X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CFJWm2G6Fz4dMQ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.01 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.54)[-0.544]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.013]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.95)[-0.953]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.54:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.54:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 14:08:37 -0000 On 19 Oct 2020, at 14:10, Ruslan Bukin wrote: > > +#ifndef _DEV_IOMMU_IOMMU_MSI_H_ > +#define _DEV_IOMMU_IOMMU_MSI_H_ > + > +#include > + > +struct iommu_unit; This seems unused, perhaps left from a previous patch version? Jess From owner-svn-src-all@freebsd.org Mon Oct 19 15:24:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 679C342B971; Mon, 19 Oct 2020 15:24:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFLCT254Yz3VkW; Mon, 19 Oct 2020 15:24:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1142725C00; Mon, 19 Oct 2020 15:24: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 09JFOaa2086508; Mon, 19 Oct 2020 15:24:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JFOaDT086504; Mon, 19 Oct 2020 15:24:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191524.09JFOaDT086504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 15:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366834 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 366834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 15:24:37 -0000 Author: markj Date: Mon Oct 19 15:24:35 2020 New Revision: 366834 URL: https://svnweb.freebsd.org/changeset/base/366834 Log: vmx: Implement pmap (de)activation in C Rewrite the code that maintains pm_active and invalidates EPTP-tagged TLB entries in C. Previously this work was done in vmx_enter_guest(), in assembly, but there is no good reason for that and it makes the TLB invalidation algorithm for nested page tables harder to review. No functional change intended. Now, an error from the invept instruction results in a kernel panic rather than a vmexit. Such errors should occur only as a result of VMM bugs. Reviewed by: grehan, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26830 Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Mon Oct 19 13:10:21 2020 (r366833) +++ head/sys/amd64/vmm/intel/vmx.c Mon Oct 19 15:24:35 2020 (r366834) @@ -2835,7 +2835,6 @@ vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, str switch (rc) { case VMX_VMRESUME_ERROR: case VMX_VMLAUNCH_ERROR: - case VMX_INVEPT_ERROR: vmexit->u.vmx.inst_type = rc; break; default: @@ -2940,6 +2939,29 @@ vmx_dr_leave_guest(struct vmxctx *vmxctx) write_rflags(read_rflags() | vmxctx->host_tf); } +static __inline void +vmx_pmap_activate(struct vmx *vmx, pmap_t pmap) +{ + long eptgen; + int cpu; + + cpu = curcpu; + + CPU_SET_ATOMIC(cpu, &pmap->pm_active); + eptgen = atomic_load_long(&pmap->pm_eptgen); + if (eptgen != vmx->eptgen[cpu]) { + vmx->eptgen[cpu] = eptgen; + invept(INVEPT_TYPE_SINGLE_CONTEXT, + (struct invept_desc){ .eptp = vmx->eptp, ._res = 0 }); + } +} + +static __inline void +vmx_pmap_deactivate(struct vmx *vmx, pmap_t pmap) +{ + CPU_CLR_ATOMIC(curcpu, &pmap->pm_active); +} + static int vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap, struct vm_eventinfo *evinfo) @@ -3088,11 +3110,19 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm */ vmx_msr_guest_enter_tsc_aux(vmx, vcpu); - vmx_run_trace(vmx, vcpu); vmx_dr_enter_guest(vmxctx); + + /* + * Mark the EPT as active on this host CPU and invalidate + * EPTP-tagged TLB entries if required. + */ + vmx_pmap_activate(vmx, pmap); + + vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); - vmx_dr_leave_guest(vmxctx); + vmx_pmap_deactivate(vmx, pmap); + vmx_dr_leave_guest(vmxctx); vmx_msr_guest_exit_tsc_aux(vmx, vcpu); bare_lgdt(&gdtr); Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Mon Oct 19 13:10:21 2020 (r366833) +++ head/sys/amd64/vmm/intel/vmx.h Mon Oct 19 15:24:35 2020 (r366834) @@ -142,7 +142,6 @@ CTASSERT((offsetof(struct vmx, pir_desc[0]) & 63) == 0 #define VMX_GUEST_VMEXIT 0 #define VMX_VMRESUME_ERROR 1 #define VMX_VMLAUNCH_ERROR 2 -#define VMX_INVEPT_ERROR 3 int vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched); void vmx_call_isr(uintptr_t entry); Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Mon Oct 19 13:10:21 2020 (r366833) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Mon Oct 19 15:24:35 2020 (r366834) @@ -70,17 +70,12 @@ ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rs ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); -ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); -ASSYM(VMX_EPTGEN, offsetof(struct vmx, eptgen)); -ASSYM(VMX_EPTP, offsetof(struct vmx, eptp)); - ASSYM(VM_FAIL_INVALID, VM_FAIL_INVALID); ASSYM(VM_FAIL_VALID, VM_FAIL_VALID); ASSYM(VMX_GUEST_VMEXIT, VMX_GUEST_VMEXIT); ASSYM(VMX_VMRESUME_ERROR, VMX_VMRESUME_ERROR); ASSYM(VMX_VMLAUNCH_ERROR, VMX_VMLAUNCH_ERROR); -ASSYM(VMX_INVEPT_ERROR, VMX_INVEPT_ERROR); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Mon Oct 19 13:10:21 2020 (r366833) +++ head/sys/amd64/vmm/intel/vmx_support.S Mon Oct 19 15:24:35 2020 (r366834) @@ -148,33 +148,6 @@ ENTRY(vmx_enter_guest) */ VMX_HOST_SAVE - /* - * Activate guest pmap on this cpu. - */ - movq VMXCTX_PMAP(%rdi), %r11 - movl PCPU(CPUID), %eax - LK btsl %eax, PM_ACTIVE(%r11) - - /* - * If 'vmx->eptgen[curcpu]' is not identical to 'pmap->pm_eptgen' - * then we must invalidate all mappings associated with this EPTP. - */ - movq PM_EPTGEN(%r11), %r10 - cmpq %r10, VMX_EPTGEN(%rsi, %rax, 8) - je guest_restore - - /* Refresh 'vmx->eptgen[curcpu]' */ - movq %r10, VMX_EPTGEN(%rsi, %rax, 8) - - /* Setup the invept descriptor on the host stack */ - mov %rsp, %r11 - movq VMX_EPTP(%rsi), %rax - movq %rax, -16(%r11) - movq $0x0, -8(%r11) - mov $0x1, %eax /* Single context invalidate */ - invept -16(%r11), %rax - jbe invept_error /* Check invept instruction error */ - guest_restore: movl %edx, %r8d cmpb $0, guest_l1d_flush_sw(%rip) @@ -208,10 +181,6 @@ do_launch: movl $VMX_VMLAUNCH_ERROR, %eax jmp decode_inst_error -invept_error: - movl $VMX_INVEPT_ERROR, %eax - jmp decode_inst_error - decode_inst_error: movl $VM_FAIL_VALID, %r11d jz inst_error @@ -224,13 +193,6 @@ inst_error: * it as a scratch register beyond this point. */ - /* - * Deactivate guest pmap from this cpu. - */ - movq VMXCTX_PMAP(%rdi), %r11 - movl PCPU(CPUID), %r10d - LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE VLEAVE ret @@ -248,13 +210,6 @@ vmx_exit_guest_flush_rsb: */ VMX_GUEST_SAVE - /* - * Deactivate guest pmap from this cpu. - */ - movq VMXCTX_PMAP(%rdi), %r11 - movl PCPU(CPUID), %r10d - LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE VMX_GUEST_CLOBBER @@ -290,13 +245,6 @@ vmx_exit_guest: * Save guest state that is not automatically saved in the vmcs. */ VMX_GUEST_SAVE - - /* - * Deactivate guest pmap from this cpu. - */ - movq VMXCTX_PMAP(%rdi), %r11 - movl PCPU(CPUID), %r10d - LK btrl %r10d, PM_ACTIVE(%r11) VMX_HOST_RESTORE From owner-svn-src-all@freebsd.org Mon Oct 19 15:50:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6AC842C379; Mon, 19 Oct 2020 15:50:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFLnv5D0pz3Wt1; Mon, 19 Oct 2020 15:50:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9728525C56; Mon, 19 Oct 2020 15:50:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JFoxMZ000226; Mon, 19 Oct 2020 15:50:59 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JFoxph000223; Mon, 19 Oct 2020 15:50:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010191550.09JFoxph000223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 19 Oct 2020 15:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366835 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 366835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 15:50:59 -0000 Author: br Date: Mon Oct 19 15:50:58 2020 New Revision: 366835 URL: https://svnweb.freebsd.org/changeset/base/366835 Log: Assign the reserved apic region (GAS entry) to the iommu domain msi_entry. Requested by: kib Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26859 Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/x86/iommu/intel_ctx.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Mon Oct 19 15:24:35 2020 (r366834) +++ head/sys/dev/iommu/iommu.h Mon Oct 19 15:50:58 2020 (r366835) @@ -197,7 +197,7 @@ void iommu_gas_free_region(struct iommu_domain *domain int iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, - iommu_gaddr_t end); + iommu_gaddr_t end, struct iommu_map_entry **entry0); void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno); bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno); Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Mon Oct 19 15:24:35 2020 (r366834) +++ head/sys/dev/iommu/iommu_gas.c Mon Oct 19 15:50:58 2020 (r366835) @@ -677,7 +677,7 @@ iommu_gas_map_region(struct iommu_domain *domain, stru int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, - iommu_gaddr_t end) + iommu_gaddr_t end, struct iommu_map_entry **entry0) { struct iommu_map_entry *entry; int error; @@ -692,6 +692,8 @@ iommu_gas_reserve_region(struct iommu_domain *domain, IOMMU_DOMAIN_UNLOCK(domain); if (error != 0) iommu_gas_free_entry(domain, entry); + else if (entry0 != NULL) + *entry0 = entry; return (error); } Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Mon Oct 19 15:24:35 2020 (r366834) +++ head/sys/x86/iommu/intel_ctx.c Mon Oct 19 15:50:58 2020 (r366835) @@ -366,7 +366,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp goto fail; /* Disable local apic region access */ error = iommu_gas_reserve_region(iodom, 0xfee00000, - 0xfeefffff + 1); + 0xfeefffff + 1, &iodom->msi_entry); if (error != 0) goto fail; } From owner-svn-src-all@freebsd.org Mon Oct 19 15:52:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4D1C42CBCA; Mon, 19 Oct 2020 15:52:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFLqx1zy1z3XWV; Mon, 19 Oct 2020 15:52:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0170125BD2; Mon, 19 Oct 2020 15:52:42 +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 09JFqgx4005300; Mon, 19 Oct 2020 15:52:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JFqgLl005299; Mon, 19 Oct 2020 15:52:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010191552.09JFqgLl005299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 19 Oct 2020 15:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366836 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 15:52:45 -0000 Author: andrew Date: Mon Oct 19 15:52:42 2020 New Revision: 366836 URL: https://svnweb.freebsd.org/changeset/base/366836 Log: Remove unused labels from the arm64 casueword* These are unused so can be removed. While here renumber the remaining label to be 1. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Mon Oct 19 15:50:58 2020 (r366835) +++ head/sys/arm64/arm64/support.S Mon Oct 19 15:52:42 2020 (r366836) @@ -64,11 +64,11 @@ ENTRY(casueword32) mov w5, #1 SET_FAULT_HANDLER(x6, x4) /* And set it */ ENTER_USER_ACCESS(w6, x4) -1: ldxr w4, [x0] /* Load-exclusive the data */ + ldxr w4, [x0] /* Load-exclusive the data */ cmp w4, w1 /* Compare */ - b.ne 2f /* Not equal, exit */ + b.ne 1f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ -2: EXIT_USER_ACCESS(w6) +1: EXIT_USER_ACCESS(w6) SET_FAULT_HANDLER(xzr, x6) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov w0, w5 /* Result same as store status */ @@ -84,11 +84,11 @@ ENTRY(casueword) mov w5, #1 SET_FAULT_HANDLER(x6, x4) /* And set it */ ENTER_USER_ACCESS(w6, x4) -1: ldxr x4, [x0] /* Load-exclusive the data */ + ldxr x4, [x0] /* Load-exclusive the data */ cmp x4, x1 /* Compare */ - b.ne 2f /* Not equal, exit */ + b.ne 1f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ -2: EXIT_USER_ACCESS(w6) +1: EXIT_USER_ACCESS(w6) SET_FAULT_HANDLER(xzr, x6) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov w0, w5 /* Result same as store status */ From owner-svn-src-all@freebsd.org Mon Oct 19 16:52:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB8BE42E333; Mon, 19 Oct 2020 16:52:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFN8q4ZlPz3bks; Mon, 19 Oct 2020 16:52:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8092826AF5; Mon, 19 Oct 2020 16:52:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JGqRFx042045; Mon, 19 Oct 2020 16:52:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JGqRg5042044; Mon, 19 Oct 2020 16:52:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191652.09JGqRg5042044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 16:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366837 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 16:52:27 -0000 Author: markj Date: Mon Oct 19 16:52:27 2020 New Revision: 366837 URL: https://svnweb.freebsd.org/changeset/base/366837 Log: vmem: Simplify bt_fill() callers a bit No functional change intended. Reviewed by: alc, kib, rlibby MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26769 Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Oct 19 15:52:42 2020 (r366836) +++ head/sys/kern/subr_vmem.c Mon Oct 19 16:52:27 2020 (r366837) @@ -266,8 +266,8 @@ bt_isfree(bt_t *bt) * allocation will not fail once bt_fill() passes. To do so we cache * at least the maximum possible tag allocations in the arena. */ -static int -bt_fill(vmem_t *vm, int flags) +static __noinline int +_bt_fill(vmem_t *vm, int flags) { bt_t *bt; @@ -307,6 +307,14 @@ bt_fill(vmem_t *vm, int flags) return 0; } +static inline int +bt_fill(vmem_t *vm, int flags) +{ + if (vm->vm_nfreetags >= BT_MAXALLOC) + return (0); + return (_bt_fill(vm, flags)); +} + /* * Pop a tag off of the freetag stack. */ @@ -1104,7 +1112,7 @@ retry: /* * Make sure we have enough tags to complete the operation. */ - if (vm->vm_nfreetags < BT_MAXALLOC && bt_fill(vm, flags) != 0) + if (bt_fill(vm, flags) != 0) goto out; /* @@ -1387,11 +1395,9 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ * Make sure we have enough tags to complete the * operation. */ - if (vm->vm_nfreetags < BT_MAXALLOC && - bt_fill(vm, flags) != 0) { - error = ENOMEM; + error = bt_fill(vm, flags); + if (error != 0) break; - } /* * Scan freelists looking for a tag that satisfies the @@ -1510,13 +1516,12 @@ vmem_add(vmem_t *vm, vmem_addr_t addr, vmem_size_t siz { int error; - error = 0; flags &= VMEM_FLAGS; + VMEM_LOCK(vm); - if (vm->vm_nfreetags >= BT_MAXALLOC || bt_fill(vm, flags) == 0) + error = bt_fill(vm, flags); + if (error == 0) vmem_add1(vm, addr, size, BT_TYPE_SPAN_STATIC); - else - error = ENOMEM; VMEM_UNLOCK(vm); return (error); From owner-svn-src-all@freebsd.org Mon Oct 19 16:54:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53C2942E5B1; Mon, 19 Oct 2020 16:54:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFNBl1XpBz3bwX; Mon, 19 Oct 2020 16:54: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181CE269C2; Mon, 19 Oct 2020 16:54: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 09JGs6tJ042166; Mon, 19 Oct 2020 16:54:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JGs63o042165; Mon, 19 Oct 2020 16:54:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191654.09JGs63o042165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 16:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366838 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 16:54:07 -0000 Author: markj Date: Mon Oct 19 16:54:06 2020 New Revision: 366838 URL: https://svnweb.freebsd.org/changeset/base/366838 Log: vmem: Allocate btags before looping in vmem_xalloc() BT_MAXALLOC (4) is the number of boundary tags required to complete an allocation in the worst case: two to clip a free segment, and two to import from a parent arena. vmem_xalloc() preallocates four boundary tags before attempting a search to simplify the segment allocation code. It implements a loop that: 1) ensures that BT_MAXALLOC boundary tags are available, 2) attempts to find and clip a free segment satisfying the allocation constraints, and failing that, 3) attempts to import a segment. On !UMA_MD_SMALL_ALLOC platforms the btag zone has to handle recusion: it needs boundary tags to allocate boundary tags. Thus we reserve 2 * BT_MAXALLOC * mp_ncpus tags for use when recursing: the factor of 2 is because there are two layers of vmem arenas, the per-domain arena and global arena. For a single thread, 2 * BT_MAXALLOC tags should be sufficient. Because of the way the loop is structured, BT_MAXALLOC tags are not sufficient. The first bt_fill() call may allocate BT_MAXALLOC tags, then import a segment (consuming two tags), then attempt to top up the preallocation before carving into the imported free segment, thus requiring up to six tags in the worst case. Because we don't preallocate that many, this bug can cause deadlocks in rare scenarios. Fix the problem by moving the preallocation out the loop. This assumes that only a single import is ever required to satisfy an allocation request. Thanks to manu, emaste and lwhsu for helping test debug patches. Reported by: Jenkins (hardware CI lab) Reviewed by: alc, kib, rlibby MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26770 Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Oct 19 16:52:27 2020 (r366837) +++ head/sys/kern/subr_vmem.c Mon Oct 19 16:54:06 2020 (r366838) @@ -368,6 +368,24 @@ bt_free(vmem_t *vm, bt_t *bt) } /* + * Hide MAXALLOC tags before dropping the arena lock to ensure that a + * concurrent allocation attempt does not grab them. + */ +static void +bt_save(vmem_t *vm) +{ + KASSERT(vm->vm_nfreetags >= BT_MAXALLOC, + ("%s: insufficient free tags %d", __func__, vm->vm_nfreetags)); + vm->vm_nfreetags -= BT_MAXALLOC; +} + +static void +bt_restore(vmem_t *vm) +{ + vm->vm_nfreetags += BT_MAXALLOC; +} + +/* * freelist[0] ... [1, 1] * freelist[1] ... [2, 2] * : @@ -911,16 +929,11 @@ vmem_import(vmem_t *vm, vmem_size_t size, vmem_size_t if (vm->vm_limit != 0 && vm->vm_limit < vm->vm_size + size) return (ENOMEM); - /* - * Hide MAXALLOC tags so we're guaranteed to be able to add this - * span and the tag we want to allocate from it. - */ - MPASS(vm->vm_nfreetags >= BT_MAXALLOC); - vm->vm_nfreetags -= BT_MAXALLOC; + bt_save(vm); VMEM_UNLOCK(vm); error = (vm->vm_importfn)(vm->vm_arg, size, flags, &addr); VMEM_LOCK(vm); - vm->vm_nfreetags += BT_MAXALLOC; + bt_restore(vm); if (error) return (ENOMEM); @@ -1048,19 +1061,23 @@ vmem_try_fetch(vmem_t *vm, const vmem_size_t size, vme */ if (vm->vm_qcache_max != 0 || vm->vm_reclaimfn != NULL) { avail = vm->vm_size - vm->vm_inuse; + bt_save(vm); VMEM_UNLOCK(vm); if (vm->vm_qcache_max != 0) qc_drain(vm); if (vm->vm_reclaimfn != NULL) vm->vm_reclaimfn(vm, flags); VMEM_LOCK(vm); + bt_restore(vm); /* If we were successful retry even NOWAIT. */ if (vm->vm_size - vm->vm_inuse > avail) return (1); } if ((flags & M_NOWAIT) != 0) return (0); + bt_save(vm); VMEM_CONDVAR_WAIT(vm); + bt_restore(vm); return (1); } @@ -1108,13 +1125,14 @@ vmem_xalloc_nextfit(vmem_t *vm, const vmem_size_t size error = ENOMEM; VMEM_LOCK(vm); -retry: + /* * Make sure we have enough tags to complete the operation. */ if (bt_fill(vm, flags) != 0) goto out; +retry: /* * Find the next free tag meeting our constraints. If one is found, * perform the allocation. @@ -1390,15 +1408,14 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ */ first = bt_freehead_toalloc(vm, size, strat); VMEM_LOCK(vm); - for (;;) { - /* - * Make sure we have enough tags to complete the - * operation. - */ - error = bt_fill(vm, flags); - if (error != 0) - break; + /* + * Make sure we have enough tags to complete the operation. + */ + error = bt_fill(vm, flags); + if (error != 0) + goto out; + for (;;) { /* * Scan freelists looking for a tag that satisfies the * allocation. If we're doing BESTFIT we may encounter From owner-svn-src-all@freebsd.org Mon Oct 19 16:55:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DB9A42E2E1; Mon, 19 Oct 2020 16:55:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFNCr0wm9z3c58; Mon, 19 Oct 2020 16:55: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 030D726D7D; Mon, 19 Oct 2020 16:55: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 09JGt3Ba042306; Mon, 19 Oct 2020 16:55:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JGt36s042305; Mon, 19 Oct 2020 16:55:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191655.09JGt36s042305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 16:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366839 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 16:55:04 -0000 Author: markj Date: Mon Oct 19 16:55:03 2020 New Revision: 366839 URL: https://svnweb.freebsd.org/changeset/base/366839 Log: uma: Avoid depleting keg reserves when filling a bucket zone_import() fetches a free or partially free slab from the keg and then uses its items to populate an array, typically filling a bucket. If a single allocation causes the keg to drop below its minimum reserve, the inner loop ends. However, if the bucket is still not full and M_USE_RESERVE is specified, the outer loop will continue to fetch items from the keg. If M_USE_RESERVE is specified and the number of free items is below the reserved limit, we should return only a single item. Otherwise, if the bucket size is larger than the reserve, all of the reserved items may end up in a single per-CPU bucket, invisible to other CPUs. Reviewed by: rlibby MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26771 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Oct 19 16:54:06 2020 (r366838) +++ head/sys/vm/uma_core.c Mon Oct 19 16:55:03 2020 (r366839) @@ -3734,10 +3734,17 @@ zone_import(void *arg, void **bucket, int max, int dom stripe = howmany(max, vm_ndomains); #endif dom = &keg->uk_domain[slab->us_domain]; - while (slab->us_freecount && i < max) { + do { bucket[i++] = slab_alloc_item(keg, slab); - if (dom->ud_free_items <= keg->uk_reserve) - break; + if (dom->ud_free_items <= keg->uk_reserve) { + /* + * Avoid depleting the reserve after a + * successful item allocation, even if + * M_USE_RESERVE is specified. + */ + KEG_UNLOCK(keg, slab->us_domain); + goto out; + } #ifdef NUMA /* * If the zone is striped we pick a new slab for every @@ -3751,13 +3758,14 @@ zone_import(void *arg, void **bucket, int max, int dom vm_ndomains > 1 && --stripe == 0) break; #endif - } + } while (slab->us_freecount != 0 && i < max); KEG_UNLOCK(keg, slab->us_domain); + /* Don't block if we allocated any successfully. */ flags &= ~M_WAITOK; flags |= M_NOWAIT; } - +out: return i; } From owner-svn-src-all@freebsd.org Mon Oct 19 16:57:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 472E342E8A0; Mon, 19 Oct 2020 16:57:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFNGs1Gbcz3c8N; Mon, 19 Oct 2020 16:57:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1031E26B99; Mon, 19 Oct 2020 16:57:41 +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 09JGve7q042473; Mon, 19 Oct 2020 16:57:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JGveiu042472; Mon, 19 Oct 2020 16:57:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191657.09JGveiu042472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 16:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366840 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 16:57:41 -0000 Author: markj Date: Mon Oct 19 16:57:40 2020 New Revision: 366840 URL: https://svnweb.freebsd.org/changeset/base/366840 Log: uma: Respect uk_reserve in keg_drain() When a reserve of free items is configured for a zone, the reserve must not be reclaimed under memory pressure. Modify keg_drain() to simply respect the reserved pool. While here remove an always-false uk_freef == NULL check (kegs that shouldn't be drained should set _NOFREE instead), and make sure that the keg_drain() KTR statement does not reference an uninitialized variable. Reviewed by: alc, rlibby Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26772 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Oct 19 16:55:03 2020 (r366839) +++ head/sys/vm/uma_core.c Mon Oct 19 16:57:40 2020 (r366840) @@ -1415,47 +1415,81 @@ keg_free_slab(uma_keg_t keg, uma_slab_t slab, int star uma_total_dec(PAGE_SIZE * keg->uk_ppera); } -/* - * Frees pages from a keg back to the system. This is done on demand from - * the pageout daemon. - * - * Returns nothing. - */ static void -keg_drain(uma_keg_t keg) +keg_drain_domain(uma_keg_t keg, int domain) { struct slabhead freeslabs; uma_domain_t dom; uma_slab_t slab, tmp; - int i, n; + uint32_t i, stofree, stokeep, partial; - if (keg->uk_flags & UMA_ZONE_NOFREE || keg->uk_freef == NULL) - return; + dom = &keg->uk_domain[domain]; + LIST_INIT(&freeslabs); - for (i = 0; i < vm_ndomains; i++) { - CTR4(KTR_UMA, "keg_drain %s(%p) domain %d free items: %u", - keg->uk_name, keg, i, dom->ud_free_items); - dom = &keg->uk_domain[i]; - LIST_INIT(&freeslabs); + CTR4(KTR_UMA, "keg_drain %s(%p) domain %d free items: %u", + keg->uk_name, keg, i, dom->ud_free_items); - KEG_LOCK(keg, i); - if ((keg->uk_flags & UMA_ZFLAG_HASH) != 0) { - LIST_FOREACH(slab, &dom->ud_free_slab, us_link) - UMA_HASH_REMOVE(&keg->uk_hash, slab); - } - n = dom->ud_free_slabs; + KEG_LOCK(keg, domain); + + /* + * Are the free items in partially allocated slabs sufficient to meet + * the reserve? If not, compute the number of fully free slabs that must + * be kept. + */ + partial = dom->ud_free_items - dom->ud_free_slabs * keg->uk_ipers; + if (partial < keg->uk_reserve) { + stokeep = min(dom->ud_free_slabs, + howmany(keg->uk_reserve - partial, keg->uk_ipers)); + } else { + stokeep = 0; + } + stofree = dom->ud_free_slabs - stokeep; + + /* + * Partition the free slabs into two sets: those that must be kept in + * order to maintain the reserve, and those that may be released back to + * the system. Since one set may be much larger than the other, + * populate the smaller of the two sets and swap them if necessary. + */ + for (i = min(stofree, stokeep); i > 0; i--) { + slab = LIST_FIRST(&dom->ud_free_slab); + LIST_REMOVE(slab, us_link); + LIST_INSERT_HEAD(&freeslabs, slab, us_link); + } + if (stofree > stokeep) LIST_SWAP(&freeslabs, &dom->ud_free_slab, uma_slab, us_link); - dom->ud_free_slabs = 0; - dom->ud_free_items -= n * keg->uk_ipers; - dom->ud_pages -= n * keg->uk_ppera; - KEG_UNLOCK(keg, i); - LIST_FOREACH_SAFE(slab, &freeslabs, us_link, tmp) - keg_free_slab(keg, slab, keg->uk_ipers); + if ((keg->uk_flags & UMA_ZFLAG_HASH) != 0) { + LIST_FOREACH(slab, &freeslabs, us_link) + UMA_HASH_REMOVE(&keg->uk_hash, slab); } + dom->ud_free_items -= stofree * keg->uk_ipers; + dom->ud_free_slabs -= stofree; + dom->ud_pages -= stofree * keg->uk_ppera; + KEG_UNLOCK(keg, domain); + + LIST_FOREACH_SAFE(slab, &freeslabs, us_link, tmp) + keg_free_slab(keg, slab, keg->uk_ipers); } +/* + * Frees pages from a keg back to the system. This is done on demand from + * the pageout daemon. + * + * Returns nothing. + */ static void +keg_drain(uma_keg_t keg) +{ + int i; + + if ((keg->uk_flags & UMA_ZONE_NOFREE) != 0) + return; + for (i = 0; i < vm_ndomains; i++) + keg_drain_domain(keg, i); +} + +static void zone_reclaim(uma_zone_t zone, int waitok, bool drain) { @@ -2411,6 +2445,9 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "align", CTLFLAG_RD, &keg->uk_align, 0, "item alignment mask"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "reserve", CTLFLAG_RD, &keg->uk_reserve, 0, + "number of reserved items"); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "efficiency", CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, keg, 0, sysctl_handle_uma_slab_efficiency, "I", From owner-svn-src-all@freebsd.org Mon Oct 19 16:58:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EEE342E73D; Mon, 19 Oct 2020 16:58:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFNHD1w3Tz3cWZ; Mon, 19 Oct 2020 16:58:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24C53269C7; Mon, 19 Oct 2020 16:58:00 +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 09JGw0ZX042531; Mon, 19 Oct 2020 16:58:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JGw0vI042526; Mon, 19 Oct 2020 16:58:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191658.09JGw0vI042526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 16:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366841 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 16:58:00 -0000 Author: markj Date: Mon Oct 19 16:57:59 2020 New Revision: 366841 URL: https://svnweb.freebsd.org/changeset/base/366841 Log: link_elf_obj: Colour VM objects This will cause the VM to back sufficiently large .text sections, such as those in zfs.ko or amdgpu.ko on amd64, with superpage mappings when possible. Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26802 Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Mon Oct 19 16:57:40 2020 (r366840) +++ head/sys/kern/link_elf_obj.c Mon Oct 19 16:57:59 2020 (r366841) @@ -914,6 +914,9 @@ link_elf_load_file(linker_class_t cls, const char *fil error = ENOMEM; goto out; } +#if VM_NRESERVLEVEL > 0 + vm_object_color(ef->object, 0); +#endif /* * In order to satisfy amd64's architectural requirements on the From owner-svn-src-all@freebsd.org Mon Oct 19 17:07:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60B0942F036; Mon, 19 Oct 2020 17:07:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFNV11tf1z3dVH; Mon, 19 Oct 2020 17:07:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23BAD26C51; Mon, 19 Oct 2020 17:07:21 +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 09JH7LXd049022; Mon, 19 Oct 2020 17:07:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JH7KYw049017; Mon, 19 Oct 2020 17:07:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010191707.09JH7KYw049017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Oct 2020 17:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366842 - in head: sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sys/netinet sys/netinet6 usr.bin/netstat X-SVN-Commit-Revision: 366842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 17:07:21 -0000 Author: markj Date: Mon Oct 19 17:07:19 2020 New Revision: 366842 URL: https://svnweb.freebsd.org/changeset/base/366842 Log: icmp6: Count packets dropped due to an invalid hop limit Pad the icmp6stat structure so that we can add more counters in the future without breaking compatibility again, last done in r358620. Annotate the rarely executed error paths with __predict_false while here. Reviewed by: bz, melifaro Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26578 Modified: head/sys/netinet/icmp6.h head/sys/netinet6/icmp6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/usr.bin/netstat/inet6.c Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Mon Oct 19 16:57:59 2020 (r366841) +++ head/sys/netinet/icmp6.h Mon Oct 19 17:07:19 2020 (r366842) @@ -639,6 +639,8 @@ struct icmp6stat { uint64_t icp6s_overflowprfx; /* Too many prefixes. */ uint64_t icp6s_overflownndp; /* Too many neighbour entries. */ uint64_t icp6s_overflowredirect;/* Too many redirects. */ + uint64_t icp6s_invlhlim; /* Invalid hop limit. */ + uint64_t icp6s_spare[32]; }; #ifdef _KERNEL Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Mon Oct 19 16:57:59 2020 (r366841) +++ head/sys/netinet6/icmp6.c Mon Oct 19 17:07:19 2020 (r366842) @@ -2261,7 +2261,8 @@ icmp6_redirect_input(struct mbuf *m, int off) ip6_sprintf(ip6buf, &src6))); goto bad; } - if (ip6->ip6_hlim != 255) { + if (__predict_false(ip6->ip6_hlim != 255)) { + ICMP6STAT_INC(icp6s_invlhlim); nd6log((LOG_ERR, "ICMP6 redirect sent from %s rejected; " "hlim=%d (must be 255)\n", Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Oct 19 16:57:59 2020 (r366841) +++ head/sys/netinet6/nd6_nbr.c Mon Oct 19 17:07:19 2020 (r366842) @@ -136,7 +136,8 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_hlim != 255) { + if (__predict_false(ip6->ip6_hlim != 255)) { + ICMP6STAT_INC(icp6s_invlhlim); nd6log((LOG_ERR, "nd6_ns_input: invalid hlim (%d) from %s to %s on %s\n", ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), @@ -641,7 +642,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_hlim != 255) { + if (__predict_false(ip6->ip6_hlim != 255)) { + ICMP6STAT_INC(icp6s_invlhlim); nd6log((LOG_ERR, "nd6_na_input: invalid hlim (%d) from %s to %s on %s\n", ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Oct 19 16:57:59 2020 (r366841) +++ head/sys/netinet6/nd6_rtr.c Mon Oct 19 17:07:19 2020 (r366842) @@ -177,7 +177,8 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) /* Sanity checks */ ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_hlim != 255) { + if (__predict_false(ip6->ip6_hlim != 255)) { + ICMP6STAT_INC(icp6s_invlhlim); nd6log((LOG_ERR, "%s: invalid hlim (%d) from %s to %s on %s\n", __func__, ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), @@ -376,7 +377,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) goto freeit; ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_hlim != 255) { + if (__predict_false(ip6->ip6_hlim != 255)) { + ICMP6STAT_INC(icp6s_invlhlim); nd6log((LOG_ERR, "%s: invalid hlim (%d) from %s to %s on %s\n", __func__, ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Mon Oct 19 16:57:59 2020 (r366841) +++ head/usr.bin/netstat/inet6.c Mon Oct 19 17:07:19 2020 (r366842) @@ -1063,6 +1063,8 @@ icmp6_stats(u_long off, const char *name, int af1 __un "{N:/neighbour entries overflow%s}\n"); p(icp6s_overflowredirect, "\t{:redirect-overflows/%ju} " "{N:/redirect overflow%s}\n"); + p(icp6s_invlhlim, "\t{:dropped-invalid-hop-limit/%ju} " + "{N:/message%s with invalid hop limit}\n"); xo_close_container("errors"); p(icp6s_pmtuchg, "\t{:path-mtu-changes/%ju} {N:/path MTU change%s}\n"); #undef p From owner-svn-src-all@freebsd.org Mon Oct 19 17:35:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CD3D42F871; Mon, 19 Oct 2020 17:35:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFP6p3916z3fqg; Mon, 19 Oct 2020 17:35:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502D227533; Mon, 19 Oct 2020 17:35:46 +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 09JHZkx9067068; Mon, 19 Oct 2020 17:35:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JHZkqr067067; Mon, 19 Oct 2020 17:35:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010191735.09JHZkqr067067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Oct 2020 17:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366843 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 366843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 17:35:46 -0000 Author: jhb Date: Mon Oct 19 17:35:45 2020 New Revision: 366843 URL: https://svnweb.freebsd.org/changeset/base/366843 Log: Properly clear PCB_KERNNPX in fpu_kern_leave(). PR: 250423 Reported by: CI Tested by: lwhsu Modified: head/sys/i386/i386/npx.c Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Mon Oct 19 17:07:19 2020 (r366842) +++ head/sys/i386/i386/npx.c Mon Oct 19 17:35:45 2020 (r366843) @@ -1475,7 +1475,7 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) { pcb->pcb_flags |= PCB_NPXINITDONE; if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) - pcb->pcb_flags |= ~PCB_KERNNPX; + pcb->pcb_flags &= ~PCB_KERNNPX; } else if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) pcb->pcb_flags &= ~(PCB_NPXINITDONE | PCB_KERNNPX); } else { From owner-svn-src-all@freebsd.org Mon Oct 19 18:12:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E7BD4304E4; Mon, 19 Oct 2020 18:12:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFPxG44DNz3yWv; Mon, 19 Oct 2020 18:12:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09JICQUO047985 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 19 Oct 2020 21:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09JICQUO047985 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09JICQG9047984; Mon, 19 Oct 2020 21:12:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 19 Oct 2020 21:12:26 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366843 - head/sys/i386/i386 Message-ID: <20201019181226.GF2643@kib.kiev.ua> References: <202010191735.09JHZkqr067067@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010191735.09JHZkqr067067@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CFPxG44DNz3yWv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 18:12:35 -0000 On Mon, Oct 19, 2020 at 05:35:46PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Oct 19 17:35:45 2020 > New Revision: 366843 > URL: https://svnweb.freebsd.org/changeset/base/366843 > > Log: > Properly clear PCB_KERNNPX in fpu_kern_leave(). > > PR: 250423 > Reported by: CI > Tested by: lwhsu > > Modified: > head/sys/i386/i386/npx.c > > Modified: head/sys/i386/i386/npx.c > ============================================================================== > --- head/sys/i386/i386/npx.c Mon Oct 19 17:07:19 2020 (r366842) > +++ head/sys/i386/i386/npx.c Mon Oct 19 17:35:45 2020 (r366843) > @@ -1475,7 +1475,7 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx > if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) { > pcb->pcb_flags |= PCB_NPXINITDONE; > if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) > - pcb->pcb_flags |= ~PCB_KERNNPX; > + pcb->pcb_flags &= ~PCB_KERNNPX; > } else if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) > pcb->pcb_flags &= ~(PCB_NPXINITDONE | PCB_KERNNPX); > } else { My bad, thank you for fixing this. From owner-svn-src-all@freebsd.org Mon Oct 19 18:21:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD401430C3D; Mon, 19 Oct 2020 18:21:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFQ7p5ZrGz4075; Mon, 19 Oct 2020 18:21:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A401327BB5; Mon, 19 Oct 2020 18:21:42 +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 09JILgLc094348; Mon, 19 Oct 2020 18:21:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JILgdU094346; Mon, 19 Oct 2020 18:21:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010191821.09JILgdU094346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Oct 2020 18:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366844 - in head: share/man/man4 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 sys/opencrypto X-SVN-Commit-Revision: 366844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 18:21:42 -0000 Author: jhb Date: Mon Oct 19 18:21:41 2020 New Revision: 366844 URL: https://svnweb.freebsd.org/changeset/base/366844 Log: Mark asymmetric cryptography via OCF deprecated for 14.0. Only one MIPS-specific driver implements support for one of the asymmetric operations. There are no in-kernel users besides /dev/crypto. The only known user of the /dev/crypto interface was the engine in OpenSSL releases before 1.1.0. 1.1.0 includes a rewritten engine that does not use the asymmetric operations due to lack of documentation. Reviewed by: cem, markj MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26810 Modified: head/share/man/man4/crypto.4 head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.c Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Mon Oct 19 17:35:45 2020 (r366843) +++ head/share/man/man4/crypto.4 Mon Oct 19 18:21:41 2020 (r366844) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2020 +.Dd October 19, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -108,6 +108,11 @@ both asymmetric-key (public-key/private-key) requests modular arithmetic (for Diffie-Hellman key exchange and other cryptographic protocols). The two modes are described separately below. +.Sh DEPRECATION NOTICE +The asymmetric-key operations supported by this interface will not be +present in +.Fx 14.0 +and later. .Sh THEORY OF OPERATION Regardless of whether symmetric-key or asymmetric-key operations are to be performed, use of the device requires a basic series of steps: Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon Oct 19 17:35:45 2020 (r366843) +++ head/sys/opencrypto/crypto.c Mon Oct 19 18:21:41 2020 (r366844) @@ -1142,6 +1142,7 @@ crypto_kregister(u_int32_t driverid, int kalg, u_int32 , kalg , flags ); + gone_in_dev(cap->cc_dev, 14, "asymmetric crypto"); err = 0; } else err = EINVAL; Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon Oct 19 17:35:45 2020 (r366843) +++ head/sys/opencrypto/cryptodev.c Mon Oct 19 18:21:41 2020 (r366844) @@ -346,6 +346,11 @@ SYSCTL_BOOL(_kern_crypto, OID_AUTO, cryptodev_separate &use_separate_aad, 0, "Use separate AAD buffer for /dev/crypto requests."); +static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; +SYSCTL_TIMEVAL_SEC(_kern, OID_AUTO, cryptodev_warn_interval, CTLFLAG_RW, + &warninterval, + "Delay in seconds between warnings of deprecated /dev/crypto algorithms"); + static int cryptof_ioctl(struct file *, u_long, void *, struct ucred *, struct thread *); static int cryptof_stat(struct file *, struct stat *, @@ -419,6 +424,7 @@ cryptof_ioctl( struct ucred *active_cred, struct thread *td) { + static struct timeval keywarn, featwarn; struct crypto_session_params csp; struct fcrypt *fcr = fp->f_data; struct csession *cse; @@ -818,6 +824,10 @@ bail: break; case CIOCKEY: case CIOCKEY2: + if (ratecheck(&keywarn, &warninterval)) + gone_in(14, + "Asymmetric crypto operations via /dev/crypto"); + if (!crypto_userasymcrypto) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EPERM); /* XXX compat? */ @@ -833,6 +843,10 @@ bail: mtx_unlock(&Giant); break; case CIOCASYMFEAT: + if (ratecheck(&featwarn, &warninterval)) + gone_in(14, + "Asymmetric crypto features via /dev/crypto"); + if (!crypto_userasymcrypto) { /* * NB: if user asym crypto operations are From owner-svn-src-all@freebsd.org Mon Oct 19 18:24:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE06A430E20; Mon, 19 Oct 2020 18:24:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFQBZ56mRz403n; Mon, 19 Oct 2020 18:24:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9447B27BC1; Mon, 19 Oct 2020 18:24:06 +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 09JIO60V097801; Mon, 19 Oct 2020 18:24:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JIO66a097800; Mon, 19 Oct 2020 18:24:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010191824.09JIO66a097800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Oct 2020 18:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366845 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 18:24:06 -0000 Author: jhb Date: Mon Oct 19 18:24:06 2020 New Revision: 366845 URL: https://svnweb.freebsd.org/changeset/base/366845 Log: Check TF_TOE not the tod pointer to determine if TOE is active. The TF_TOE flag is the check used in the rest of the network stack to determine if TOE is active on a socket. There is at least one path in the cxgbe(4) TOE driver that can leave the tod pointer non-NULL on a socket not using TOE. Reported by: Sony Arpita Das Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26803 Modified: head/sys/kern/uipc_ktls.c Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Mon Oct 19 18:21:41 2020 (r366844) +++ head/sys/kern/uipc_ktls.c Mon Oct 19 18:24:06 2020 (r366845) @@ -734,7 +734,7 @@ ktls_try_toe(struct socket *so, struct ktls_session *t return (ECONNRESET); } tp = intotcpcb(inp); - if (tp->tod == NULL) { + if (!(tp->t_flags & TF_TOE)) { INP_WUNLOCK(inp); return (EOPNOTSUPP); } From owner-svn-src-all@freebsd.org Mon Oct 19 18:51:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA1E9431557; Mon, 19 Oct 2020 18:51:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFQpb53w4z41lk; Mon, 19 Oct 2020 18:51:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91542850C; Mon, 19 Oct 2020 18:51:51 +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 09JIppSW016436; Mon, 19 Oct 2020 18:51:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JIpp1G016435; Mon, 19 Oct 2020 18:51:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010191851.09JIpp1G016435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 19 Oct 2020 18:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366846 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 18:51:51 -0000 Author: mjg Date: Mon Oct 19 18:51:51 2020 New Revision: 366846 URL: https://svnweb.freebsd.org/changeset/base/366846 Log: cache: promote negative entries based on more than one hit During tinderbox and similar workloads negative entries get at least one hit before they get evicted. In the current scheme this avoidably promotes them. Be conservative and stick to 2 hits for now. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Oct 19 18:24:06 2020 (r366845) +++ head/sys/kern/vfs_cache.c Mon Oct 19 18:51:51 2020 (r366846) @@ -129,6 +129,7 @@ SDT_PROBE_DECLARE(vfs, namei, lookup, return); */ struct negstate { u_char neg_flag; + u_char neg_hit; }; _Static_assert(sizeof(struct negstate) <= sizeof(struct vnode *), "the state must fit in a union with a pointer without growing it"); @@ -905,18 +906,27 @@ cache_neg_init(struct namecache *ncp) ncp->nc_flag |= NCF_NEGATIVE; ns = NCP2NEGSTATE(ncp); ns->neg_flag = 0; + ns->neg_hit = 0; counter_u64_add(neg_created, 1); } +#define CACHE_NEG_PROMOTION_THRESH 2 + static bool cache_neg_hit_prep(struct namecache *ncp) { struct negstate *ns; + u_char n; ns = NCP2NEGSTATE(ncp); - if ((ns->neg_flag & NEG_HOT) != 0) - return (true); - return (false); + n = atomic_load_char(&ns->neg_hit); + for (;;) { + if (n >= CACHE_NEG_PROMOTION_THRESH) + return (false); + if (atomic_fcmpset_8(&ns->neg_hit, &n, n + 1)) + break; + } + return (n + 1 == CACHE_NEG_PROMOTION_THRESH); } /* @@ -971,6 +981,7 @@ cache_neg_demote_locked(struct namecache *ncp) TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst); nl->nl_hotnum--; ns->neg_flag &= ~NEG_HOT; + atomic_store_char(&ns->neg_hit, 0); } /* @@ -1098,7 +1109,7 @@ cache_neg_remove(struct namecache *ncp) } static struct neglist * -cache_neg_evict_select(void) +cache_neg_evict_select_list(void) { struct neglist *nl; u_int c; @@ -1112,6 +1123,33 @@ cache_neg_evict_select(void) return (nl); } +static struct namecache * +cache_neg_evict_select_entry(struct neglist *nl) +{ + struct namecache *ncp, *lncp; + struct negstate *ns, *lns; + int i; + + mtx_assert(&nl->nl_evict_lock, MA_OWNED); + mtx_assert(&nl->nl_lock, MA_OWNED); + ncp = TAILQ_FIRST(&nl->nl_list); + if (ncp == NULL) + return (NULL); + lncp = ncp; + lns = NCP2NEGSTATE(lncp); + for (i = 1; i < 4; i++) { + ncp = TAILQ_NEXT(ncp, nc_dst); + if (ncp == NULL) + break; + ns = NCP2NEGSTATE(ncp); + if (ns->neg_hit < lns->neg_hit) { + lncp = ncp; + lns = ns; + } + } + return (lncp); +} + static bool cache_neg_evict(void) { @@ -1125,7 +1163,7 @@ cache_neg_evict(void) u_char nlen; bool evicted; - nl = cache_neg_evict_select(); + nl = cache_neg_evict_select_list(); if (nl == NULL) { return (false); } @@ -1135,7 +1173,7 @@ cache_neg_evict(void) if (ncp != NULL) { cache_neg_demote_locked(ncp); } - ncp = TAILQ_FIRST(&nl->nl_list); + ncp = cache_neg_evict_select_entry(nl); if (ncp == NULL) { counter_u64_add(neg_evict_skipped_empty, 1); mtx_unlock(&nl->nl_lock); From owner-svn-src-all@freebsd.org Mon Oct 19 18:54:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD28E43156A; Mon, 19 Oct 2020 18:54:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFQsx48kHz41y0; Mon, 19 Oct 2020 18:54:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71F4F8783; Mon, 19 Oct 2020 18:54:45 +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 09JIsjmv016631; Mon, 19 Oct 2020 18:54:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JIsjti016630; Mon, 19 Oct 2020 18:54:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010191854.09JIsjti016630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Oct 2020 18:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366847 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 18:54:45 -0000 Author: emaste Date: Mon Oct 19 18:54:44 2020 New Revision: 366847 URL: https://svnweb.freebsd.org/changeset/base/366847 Log: uma: fix KTR message after r366840 Reported by: bz Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Oct 19 18:51:51 2020 (r366846) +++ head/sys/vm/uma_core.c Mon Oct 19 18:54:44 2020 (r366847) @@ -1427,7 +1427,7 @@ keg_drain_domain(uma_keg_t keg, int domain) LIST_INIT(&freeslabs); CTR4(KTR_UMA, "keg_drain %s(%p) domain %d free items: %u", - keg->uk_name, keg, i, dom->ud_free_items); + keg->uk_name, keg, domain, dom->ud_free_items); KEG_LOCK(keg, domain); From owner-svn-src-all@freebsd.org Mon Oct 19 19:20:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78F7B43211F; Mon, 19 Oct 2020 19:20:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFRRX2g4Nz43Gm; Mon, 19 Oct 2020 19:20:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D848746; Mon, 19 Oct 2020 19:20:24 +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 09JJKOe0029899; Mon, 19 Oct 2020 19:20:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JJKOva029898; Mon, 19 Oct 2020 19:20:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010191920.09JJKOva029898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Oct 2020 19:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366848 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 19:20:24 -0000 Author: kib Date: Mon Oct 19 19:20:23 2020 New Revision: 366848 URL: https://svnweb.freebsd.org/changeset/base/366848 Log: vgonel(): avoid recursing into VOP_INACTIVE(). It is a common pattern for filesystems' VOP_INACTIVE() implementation to forcibly reclaim the vnode when its state is final. For instance, UFS vnode with zero link count is removed, and since it is inactivated, the last open reference on it is dropped. On the other hand, vnode might get spurious usecount reference for many reasons. If the spurious reference exists while vgonel() checks for active state of the vnode, it would recurse into VOP_INACTIVE(). Fix it by checking and not doing inactivation when vgone() was called from inactive VOP. Reported and tested by: pho Discussed with: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Oct 19 18:54:44 2020 (r366847) +++ head/sys/kern/vfs_subr.c Mon Oct 19 19:20:23 2020 (r366848) @@ -1794,6 +1794,8 @@ freevnode(struct vnode *vp) VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for ..")); VNASSERT(TAILQ_EMPTY(&vp->v_rl.rl_waiters), vp, ("Dangling rangelock waiters")); + VNASSERT((vp->v_iflag & (VI_DOINGINACT | VI_OWEINACT)) == 0, vp, + ("Leaked inactivation")); VI_UNLOCK(vp); #ifdef MAC mac_vnode_destroy(vp); @@ -3803,7 +3805,7 @@ vgonel(struct vnode *vp) struct thread *td; struct mount *mp; vm_object_t object; - bool active, oweinact; + bool active, doinginact, oweinact; ASSERT_VOP_ELOCKED(vp, "vgonel"); ASSERT_VI_LOCKED(vp, "vgonel"); @@ -3825,11 +3827,17 @@ vgonel(struct vnode *vp) vp->v_irflag |= VIRF_DOOMED; /* - * Check to see if the vnode is in use. If so, we have to call - * VOP_CLOSE() and VOP_INACTIVE(). + * Check to see if the vnode is in use. If so, we have to + * call VOP_CLOSE() and VOP_INACTIVE(). + * + * It could be that VOP_INACTIVE() requested reclamation, in + * which case we should avoid recursion, so check + * VI_DOINGINACT. This is not precise but good enough. */ active = vp->v_usecount > 0; oweinact = (vp->v_iflag & VI_OWEINACT) != 0; + doinginact = (vp->v_iflag & VI_DOINGINACT) != 0; + /* * If we need to do inactive VI_OWEINACT will be set. */ @@ -3850,7 +3858,7 @@ vgonel(struct vnode *vp) */ if (active) VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); - if (oweinact || active) { + if ((oweinact || active) && !doinginact) { VI_LOCK(vp); vinactivef(vp); VI_UNLOCK(vp); From owner-svn-src-all@freebsd.org Mon Oct 19 19:23:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC50A4323C9; Mon, 19 Oct 2020 19:23:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFRVy4YM7z43RW; Mon, 19 Oct 2020 19:23:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F88586FC; Mon, 19 Oct 2020 19:23:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JJNMhY035420; Mon, 19 Oct 2020 19:23:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JJNMaV035419; Mon, 19 Oct 2020 19:23:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010191923.09JJNMaV035419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Oct 2020 19:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366849 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 366849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 19:23:22 -0000 Author: kib Date: Mon Oct 19 19:23:22 2020 New Revision: 366849 URL: https://svnweb.freebsd.org/changeset/base/366849 Log: nullfs: ensure correct lock is taken after bypass. If lower VOP relocked the lower vnode, it is possible that nullfs vnode was reclaimed meantime. In this case nullfs vnode no longer shares lock with lower vnode, which breaks locking protocol. Check for the condition and acquire nullfs vnode lock if detected. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Mon Oct 19 19:20:23 2020 (r366848) +++ head/sys/fs/nullfs/null_vnops.c Mon Oct 19 19:23:22 2020 (r366849) @@ -227,6 +227,7 @@ null_bypass(struct vop_generic_args *ap) struct vnode *old_vps[VDESC_MAX_VPS]; struct vnode **vps_p[VDESC_MAX_VPS]; struct vnode ***vppp; + struct vnode *lvp; struct vnodeop_desc *descp = ap->a_desc; int reles, i; @@ -295,6 +296,23 @@ null_bypass(struct vop_generic_args *ap) if (descp->vdesc_vp_offsets[i] == VDESC_NO_OFFSET) break; /* bail out at end of list */ if (old_vps[i]) { + lvp = *(vps_p[i]); + + /* + * If lowervp was unlocked during VOP + * operation, nullfs upper vnode could have + * been reclaimed, which changes its v_vnlock + * back to private v_lock. In this case we + * must move lock ownership from lower to + * upper (reclaimed) vnode. + */ + if (lvp != NULLVP && + VOP_ISLOCKED(lvp) == LK_EXCLUSIVE && + old_vps[i]->v_vnlock != lvp->v_vnlock) { + VOP_UNLOCK(lvp); + VOP_LOCK(old_vps[i], LK_EXCLUSIVE | LK_RETRY); + } + *(vps_p[i]) = old_vps[i]; #if 0 if (reles & VDESC_VP0_WILLUNLOCK) From owner-svn-src-all@freebsd.org Mon Oct 19 19:50:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5F16432D66; Mon, 19 Oct 2020 19:50:59 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFS6q5stjz44dR; Mon, 19 Oct 2020 19:50:59 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACB2C9104; Mon, 19 Oct 2020 19:50:59 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JJoxQT048363; Mon, 19 Oct 2020 19:50:59 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JJovqR048351; Mon, 19 Oct 2020 19:50:57 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010191950.09JJovqR048351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 19 Oct 2020 19:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366850 - in head/lib/googletest: gmock gmock/tests gmock_main gmock_main/tests gtest gtest/tests gtest_main gtest_main/tests tests tests/gmock tests/gmock_main tests/gtest tests/gtest_... X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/lib/googletest: gmock gmock/tests gmock_main gmock_main/tests gtest gtest/tests gtest_main gtest_main/tests tests tests/gmock tests/gmock_main tests/gtest tests/gtest_main X-SVN-Commit-Revision: 366850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 19:51:00 -0000 Author: arichardson Date: Mon Oct 19 19:50:57 2020 New Revision: 366850 URL: https://svnweb.freebsd.org/changeset/base/366850 Log: Major improvement to build parallelism for googletest internal tests Currently the googletest internal tests build after the matching library. However, each of these is serialized at the top level makefile. Additionally some of the tests (e.g. the gmock-matches-test) take up to 90 seconds to build with clang -O2. Having to wait for this test to complete before continuing to the next directory seriously slows down the parllelism of a -j32 build. Before this change running `make -C lib/googletest -j32 -s` in buildenv took 202 seconds, now it's 153 due to improved parallelism. Reviewed By: emaste (no objection) Differential Revision: https://reviews.freebsd.org/D26748 Added: head/lib/googletest/tests/Makefile.inc (contents, props changed) head/lib/googletest/tests/gmock/ head/lib/googletest/tests/gmock/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gmock/tests/Makefile head/lib/googletest/tests/gmock_main/ head/lib/googletest/tests/gmock_main/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gmock_main/tests/Makefile head/lib/googletest/tests/gtest/ head/lib/googletest/tests/gtest/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gtest/tests/Makefile head/lib/googletest/tests/gtest_main/ head/lib/googletest/tests/gtest_main/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gtest_main/tests/Makefile Deleted: head/lib/googletest/gmock/tests/Makefile head/lib/googletest/gmock_main/tests/Makefile head/lib/googletest/gtest/tests/Makefile head/lib/googletest/gtest_main/tests/Makefile Modified: head/lib/googletest/gmock/Makefile head/lib/googletest/gmock_main/Makefile head/lib/googletest/gtest/Makefile head/lib/googletest/gtest_main/Makefile head/lib/googletest/tests/Makefile Modified: head/lib/googletest/gmock/Makefile ============================================================================== --- head/lib/googletest/gmock/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gmock/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -42,7 +42,4 @@ INTERNAL_CUSTOM_INCS+= gmock/internal/custom/gmock-gen SRCS+= gmock-all.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include Modified: head/lib/googletest/gmock_main/Makefile ============================================================================== --- head/lib/googletest/gmock_main/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gmock_main/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -19,7 +19,4 @@ LDFLAGS+= -L${LIBGMOCKDIR} SRCS+= gmock_main.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include Modified: head/lib/googletest/gtest/Makefile ============================================================================== --- head/lib/googletest/gtest/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gtest/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -47,7 +47,4 @@ SRCS+= gtest-all.cc LIBADD+= pthread regex -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include Modified: head/lib/googletest/gtest_main/Makefile ============================================================================== --- head/lib/googletest/gtest_main/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gtest_main/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -17,7 +17,4 @@ LDFLAGS+= -L${LIBGTESTDIR} SRCS+= gtest_main.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include Modified: head/lib/googletest/tests/Makefile ============================================================================== --- head/lib/googletest/tests/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/tests/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -3,4 +3,10 @@ .PATH: ${SRCTOP}/tests KYUAFILE= yes +# Note: we start the gmock_main and gmock tests first since those take up to +# 60 seconds to build, so starting them late seriously reduces build parallism. +SUBDIR= gmock_main gmock gtest_main gtest + +SUBDIR_PARALLEL= + .include Added: head/lib/googletest/tests/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/googletest/tests/Makefile.inc Mon Oct 19 19:50:57 2020 (r366850) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.include "../Makefile.inc" +# Keep the existing tests directory structure (with subdirs per component) +# rather than installing all of them to /usr/tests/lib/googletest +TESTSDIR= ${TESTSBASE}/lib/googletest/${.CURDIR:T} Copied and modified: head/lib/googletest/tests/gmock/Makefile (from r366849, head/lib/googletest/gmock/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gmock_main/Makefile (from r366849, head/lib/googletest/gmock_main/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gtest/Makefile (from r366849, head/lib/googletest/gtest/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gtest_main/Makefile (from r366849, head/lib/googletest/gtest_main/tests/Makefile) ============================================================================== From owner-svn-src-all@freebsd.org Mon Oct 19 19:51:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB5F3432D6F; Mon, 19 Oct 2020 19:51:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFS6w4nc1z44yQ; Mon, 19 Oct 2020 19:51:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F3298F9D; Mon, 19 Oct 2020 19:51:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JJp4rj048420; Mon, 19 Oct 2020 19:51:04 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JJp4LG048419; Mon, 19 Oct 2020 19:51:04 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010191951.09JJp4LG048419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 19 Oct 2020 19:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366851 - head/lib/googletest X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/googletest X-SVN-Commit-Revision: 366851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 19:51:05 -0000 Author: arichardson Date: Mon Oct 19 19:51:03 2020 New Revision: 366851 URL: https://svnweb.freebsd.org/changeset/base/366851 Log: Enable SUBDIR_PARALLEL for lib/googletest This saves a few seconds in a parallel build since we can build the gtest_main and gmock subdirectories in parallel. Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D26760 Modified: head/lib/googletest/Makefile Modified: head/lib/googletest/Makefile ============================================================================== --- head/lib/googletest/Makefile Mon Oct 19 19:50:57 2020 (r366850) +++ head/lib/googletest/Makefile Mon Oct 19 19:51:03 2020 (r366851) @@ -3,12 +3,16 @@ .include SUBDIR+= gtest -SUBDIR+= .WAIT SUBDIR+= gmock -SUBDIR+= .WAIT SUBDIR+= gmock_main SUBDIR+= gtest_main SUBDIR.${MK_TESTS}+= tests + +SUBDIR_DEPEND_gtest_main= gtest +SUBDIR_DEPEND_gmock= gtest +SUBDIR_DEPEND_gmock_main= gmock +SUBDIR_DEPEND_tests= gmock_main +SUBDIR_PARALLEL= .include From owner-svn-src-all@freebsd.org Mon Oct 19 20:04:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EB57432DFD; Mon, 19 Oct 2020 20:04:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFSPv6k5Qz45nf; Mon, 19 Oct 2020 20:04:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA06F926C; Mon, 19 Oct 2020 20:04:03 +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 09JK43c4060056; Mon, 19 Oct 2020 20:04:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JK43Rt060055; Mon, 19 Oct 2020 20:04:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010192004.09JK43Rt060055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Oct 2020 20:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366852 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 366852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:04:04 -0000 Author: jhb Date: Mon Oct 19 20:04:03 2020 New Revision: 366852 URL: https://svnweb.freebsd.org/changeset/base/366852 Log: Fix a couple of bugs for asym crypto introduced in r359374. - Check for null pointers in the crypto_drivers[] array when checking for empty slots in crypto_select_kdriver(). - Handle the case where crypto_kdone() is invoked on a request where krq_cap is NULL due to not finding a matching driver. Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26811 Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon Oct 19 19:51:03 2020 (r366851) +++ head/sys/opencrypto/crypto.c Mon Oct 19 20:04:03 2020 (r366852) @@ -1540,7 +1540,7 @@ again: * match), then skip. */ cap = crypto_drivers[hid]; - if (cap->cc_dev == NULL || + if (cap == NULL || (cap->cc_flags & match) == 0) continue; @@ -1880,15 +1880,18 @@ crypto_kdone(struct cryptkop *krp) if (krp->krp_status != 0) CRYPTOSTAT_INC(cs_kerrs); - CRYPTO_DRIVER_LOCK(); cap = krp->krp_cap; - KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0")); - cap->cc_koperations--; - if (cap->cc_koperations == 0 && cap->cc_flags & CRYPTOCAP_F_CLEANUP) - wakeup(cap); - CRYPTO_DRIVER_UNLOCK(); - krp->krp_cap = NULL; - cap_rele(cap); + if (cap != NULL) { + CRYPTO_DRIVER_LOCK(); + KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0")); + cap->cc_koperations--; + if (cap->cc_koperations == 0 && + cap->cc_flags & CRYPTOCAP_F_CLEANUP) + wakeup(cap); + CRYPTO_DRIVER_UNLOCK(); + krp->krp_cap = NULL; + cap_rele(cap); + } ret_worker = CRYPTO_RETW(0); From owner-svn-src-all@freebsd.org Mon Oct 19 20:08:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80D1A433702; Mon, 19 Oct 2020 20:08:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFSWN2shMz45vd; Mon, 19 Oct 2020 20:08:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AA78FD2; Mon, 19 Oct 2020 20:08:48 +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 09JK8m17060338; Mon, 19 Oct 2020 20:08:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JK8mni060337; Mon, 19 Oct 2020 20:08:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010192008.09JK8mni060337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 19 Oct 2020 20:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366853 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 366853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:08:48 -0000 Author: np Date: Mon Oct 19 20:08:47 2020 New Revision: 366853 URL: https://svnweb.freebsd.org/changeset/base/366853 Log: cxgbe(4): Fix page fault in t4_get_lb_stats with 2 port T5 cards. PR: 250449 Reported by: freqlabs@ MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Oct 19 20:04:03 2020 (r366852) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Oct 19 20:08:47 2020 (r366853) @@ -6957,7 +6957,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, */ void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p) { - u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map; #define GET_STAT(name) \ t4_read_reg64(adap, \ @@ -6982,14 +6981,18 @@ void t4_get_lb_stats(struct adapter *adap, int idx, st p->frames_1519_max = GET_STAT(1519B_MAX); p->drop = GET_STAT(DROP_FRAMES); - p->ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; - p->ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; - p->ovflow2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_DROP_FRAME) : 0; - p->ovflow3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_DROP_FRAME) : 0; - p->trunc0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_TRUNC_FRAME) : 0; - p->trunc1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_TRUNC_FRAME) : 0; - p->trunc2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_LB_TRUNC_FRAME) : 0; - p->trunc3 = (bgmap & 8) ? GET_STAT_COM(RX_BG_3_LB_TRUNC_FRAME) : 0; + if (idx < adap->params.nports) { + u32 bg = adap2pinfo(adap, idx)->mps_bg_map; + + p->ovflow0 = (bg & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; + p->ovflow1 = (bg & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; + p->ovflow2 = (bg & 4) ? GET_STAT_COM(RX_BG_2_LB_DROP_FRAME) : 0; + p->ovflow3 = (bg & 8) ? GET_STAT_COM(RX_BG_3_LB_DROP_FRAME) : 0; + p->trunc0 = (bg & 1) ? GET_STAT_COM(RX_BG_0_LB_TRUNC_FRAME) : 0; + p->trunc1 = (bg & 2) ? GET_STAT_COM(RX_BG_1_LB_TRUNC_FRAME) : 0; + p->trunc2 = (bg & 4) ? GET_STAT_COM(RX_BG_2_LB_TRUNC_FRAME) : 0; + p->trunc3 = (bg & 8) ? GET_STAT_COM(RX_BG_3_LB_TRUNC_FRAME) : 0; + } #undef GET_STAT #undef GET_STAT_COM From owner-svn-src-all@freebsd.org Mon Oct 19 20:08:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 021064332C6; Mon, 19 Oct 2020 20:08:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFSWR6MmMz463s; Mon, 19 Oct 2020 20:08:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE37592AA; Mon, 19 Oct 2020 20:08:51 +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 09JK8pxg060404; Mon, 19 Oct 2020 20:08:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JK8oLZ060398; Mon, 19 Oct 2020 20:08:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010192008.09JK8oLZ060398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 19 Oct 2020 20:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366854 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 366854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:08:52 -0000 Author: jhb Date: Mon Oct 19 20:08:50 2020 New Revision: 366854 URL: https://svnweb.freebsd.org/changeset/base/366854 Log: Re-enable receive flow control for TOE TLS sockets. Flow control was disabled during initial TOE TLS development to workaround a hang (and to match the Linux TOE TLS support for T6). The rest of the TOE TLS code maintained credits as if flow control was enabled which was inherited from before the workaround was added with the exception that the receive window was allowed to go negative. This negative receive window handling (rcv_over) was because I hadn't realized the full implications of disabling flow control. To clean this up, re-enable flow control on TOE TLS sockets. The existing TPF_FORCE_CREDITS workaround is sufficient for the original hang. Now that flow control is enabled, remove the rcv_over workaround and instead assert that the receive window never goes negative matching plain TCP TOE sockets. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26799 Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tls.h head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 19 20:08:47 2020 (r366853) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 19 20:08:50 2020 (r366854) @@ -446,16 +446,6 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) SOCKBUF_LOCK_ASSERT(sb); rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; - if (ulp_mode(toep) == ULP_MODE_TLS) { - if (toep->tls.rcv_over >= rx_credits) { - toep->tls.rcv_over -= rx_credits; - rx_credits = 0; - } else { - rx_credits -= toep->tls.rcv_over; - toep->tls.rcv_over = 0; - } - } - if (rx_credits > 0 && (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Mon Oct 19 20:08:47 2020 (r366853) +++ head/sys/dev/cxgbe/tom/t4_tls.c Mon Oct 19 20:08:50 2020 (r366854) @@ -2045,11 +2045,9 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head #endif tp->rcv_nxt += pdu_length; - if (tp->rcv_wnd < pdu_length) { - toep->tls.rcv_over += pdu_length - tp->rcv_wnd; - tp->rcv_wnd = 0; - } else - tp->rcv_wnd -= pdu_length; + KASSERT(tp->rcv_wnd >= pdu_length, + ("%s: negative window size", __func__)); + tp->rcv_wnd -= pdu_length; /* XXX: Not sure what to do about urgent data. */ Modified: head/sys/dev/cxgbe/tom/t4_tls.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.h Mon Oct 19 20:08:47 2020 (r366853) +++ head/sys/dev/cxgbe/tom/t4_tls.h Mon Oct 19 20:08:50 2020 (r366854) @@ -276,7 +276,6 @@ struct tls_ofld_info { enum tls_mode mode; struct callout handshake_timer; u_int sb_off; - u_int rcv_over; }; struct tls_key_req { Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Mon Oct 19 20:08:47 2020 (r366853) +++ head/sys/dev/cxgbe/tom/t4_tom.c Mon Oct 19 20:08:50 2020 (r366854) @@ -1036,8 +1036,6 @@ calc_options2(struct vi_info *vi, struct conn_params * if (cp->ulp_mode == ULP_MODE_TCPDDP) opt2 |= F_RX_FC_DDP; #endif - if (cp->ulp_mode == ULP_MODE_TLS) - opt2 |= F_RX_FC_DISABLE; return (htobe32(opt2)); } From owner-svn-src-all@freebsd.org Mon Oct 19 20:26:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38E4F43366F; Mon, 19 Oct 2020 20:26:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFSvy0l31z46bg; Mon, 19 Oct 2020 20:26:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0DED9634; Mon, 19 Oct 2020 20:26:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JKQbJU072756; Mon, 19 Oct 2020 20:26:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKQbvQ072753; Mon, 19 Oct 2020 20:26:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010192026.09JKQbvQ072753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Oct 2020 20:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366855 - in head/sys/geom: . uzip X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys/geom: . uzip X-SVN-Commit-Revision: 366855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:26:38 -0000 Author: trasz Date: Mon Oct 19 20:26:37 2020 New Revision: 366855 URL: https://svnweb.freebsd.org/changeset/base/366855 Log: Fix fallout from r366811. PR: 250442 Reported by: lwhsu Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26855 Modified: head/sys/geom/geom_dev.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Mon Oct 19 20:08:50 2020 (r366854) +++ head/sys/geom/geom_dev.c Mon Oct 19 20:26:37 2020 (r366855) @@ -346,9 +346,15 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, cp->private = sc; cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); - KASSERT(error == 0 || error == ENXIO, - ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); - + if (error != 0) { + printf("%s: g_dev_taste(%s) failed to g_attach, error=%d\n", + __func__, pp->name, error); + g_destroy_consumer(cp); + g_destroy_geom(gp); + mtx_destroy(&sc->sc_mtx); + g_free(sc); + return (NULL); + } make_dev_args_init(&args); args.mda_flags = MAKEDEV_CHECKNAME | MAKEDEV_WAITOK; args.mda_devsw = &g_dev_cdevsw; Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Mon Oct 19 20:08:50 2020 (r366854) +++ head/sys/geom/uzip/g_uzip.c Mon Oct 19 20:26:37 2020 (r366855) @@ -707,11 +707,11 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp gp = g_new_geomf(mp, GUZ_DEV_NAME("%s"), pp->name); cp = g_new_consumer(gp); error = g_attach(cp, pp); - if (error == 0) - error = g_access(cp, 1, 0, 0); - if (error) { + if (error != 0) + goto e0; + error = g_access(cp, 1, 0, 0); + if (error) goto e1; - } g_topology_unlock(); /* @@ -942,6 +942,7 @@ e2: g_access(cp, -1, 0, 0); e1: g_detach(cp); +e0: g_destroy_consumer(cp); g_destroy_geom(gp); From owner-svn-src-all@freebsd.org Mon Oct 19 20:37:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8E9243402F; Mon, 19 Oct 2020 20:37:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFT813ybdz47gH; Mon, 19 Oct 2020 20:37:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C5679657; Mon, 19 Oct 2020 20:37:05 +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 09JKb5Pe079233; Mon, 19 Oct 2020 20:37:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKb5Zq079232; Mon, 19 Oct 2020 20:37:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010192037.09JKb5Zq079232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 19 Oct 2020 20:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366856 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:37:05 -0000 Author: mav Date: Mon Oct 19 20:37:04 2020 New Revision: 366856 URL: https://svnweb.freebsd.org/changeset/base/366856 Log: MFC r352212 (by imp): Assume all the short args have optional args so allocate space for the ':'. It's slightly wasteful, but much easier (and the savings in bytes at runtime would be tiny, but the code to do it larger). Modified: stable/12/sbin/nvmecontrol/comnd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/comnd.c ============================================================================== --- stable/12/sbin/nvmecontrol/comnd.c Mon Oct 19 20:26:37 2020 (r366855) +++ stable/12/sbin/nvmecontrol/comnd.c Mon Oct 19 20:37:04 2020 (r366856) @@ -189,7 +189,7 @@ arg_parse(int argc, char * const * argv, const struct lopts = malloc((n + 2) * sizeof(struct option)); if (lopts == NULL) err(1, "option memory"); - p = shortopts = malloc((n + 3) * sizeof(char)); + p = shortopts = malloc((2 * n + 3) * sizeof(char)); if (shortopts == NULL) err(1, "shortopts memory"); idx = 0; From owner-svn-src-all@freebsd.org Mon Oct 19 20:37:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CC99434206; Mon, 19 Oct 2020 20:37:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFT8g1bQQz47rX; Mon, 19 Oct 2020 20:37:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3BFD97E3; Mon, 19 Oct 2020 20:37:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JKbcvN079309; Mon, 19 Oct 2020 20:37:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKbcAY079308; Mon, 19 Oct 2020 20:37:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202010192037.09JKbcAY079308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 19 Oct 2020 20:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366857 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 366857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:37:39 -0000 Author: cy Date: Mon Oct 19 20:37:38 2020 New Revision: 366857 URL: https://svnweb.freebsd.org/changeset/base/366857 Log: Destroy cloned interfaces at netif stop, netif restart and shutdown. This is especially important during shutdown because a child interface of lagg with WOL enabled will not enable WOL at interface shutdown and thus no WOL to wake up the device (and machine). PR: 158734, 109980 Reported by: Antonio Huete Jimenez Marat N.Afanasyev reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26797 Modified: head/libexec/rc/rc.d/netif Modified: head/libexec/rc/rc.d/netif ============================================================================== --- head/libexec/rc/rc.d/netif Mon Oct 19 20:37:04 2020 (r366856) +++ head/libexec/rc/rc.d/netif Mon Oct 19 20:37:38 2020 (r366857) @@ -28,7 +28,7 @@ # PROVIDE: netif # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: hostid ipfs -# KEYWORD: nojailvnet +# KEYWORD: nojailvnet shutdown . /etc/rc.subr . /etc/network.subr From owner-svn-src-all@freebsd.org Mon Oct 19 20:39:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2F0043428A; Mon, 19 Oct 2020 20:39:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFTBG3rHrz48W2; Mon, 19 Oct 2020 20:39: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D16798EE; Mon, 19 Oct 2020 20:39:01 +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 09JKd13O079449; Mon, 19 Oct 2020 20:39:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKd15x079448; Mon, 19 Oct 2020 20:39:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010192039.09JKd15x079448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 19 Oct 2020 20:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366858 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:39:02 -0000 Author: mav Date: Mon Oct 19 20:39:00 2020 New Revision: 366858 URL: https://svnweb.freebsd.org/changeset/base/366858 Log: MFC r352665 (by imp): After my comnd changes, the number of threads and size weren't set. In addition, the flags are optional, but were made to be mandatory. Set these things, as well as santiy check the specified size. Modified: stable/12/sbin/nvmecontrol/perftest.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/perftest.c ============================================================================== --- stable/12/sbin/nvmecontrol/perftest.c Mon Oct 19 20:37:38 2020 (r366857) +++ stable/12/sbin/nvmecontrol/perftest.c Mon Oct 19 20:39:00 2020 (r366858) @@ -143,9 +143,9 @@ perftest(const struct cmd *f, int argc, char *argv[]) if (arg_parse(argc, argv, f)) return; - if (opt.flags == NULL || opt.op == NULL) + if (opt.op == NULL) arg_help(argc, argv, f); - if (strcmp(opt.flags, "refthread") == 0) + if (opt.flags != NULL && strcmp(opt.flags, "refthread") == 0) io_test.flags |= NVME_TEST_FLAG_REFTHREAD; if (opt.intr != NULL) { if (strcmp(opt.intr, "bio") == 0 || @@ -163,6 +163,7 @@ perftest(const struct cmd *f, int argc, char *argv[]) fprintf(stderr, "Bad number of threads %d\n", opt.threads); arg_help(argc, argv, f); } + io_test.num_threads = opt.threads; if (strcasecmp(opt.op, "read") == 0) io_test.opc = NVME_OPC_READ; else if (strcasecmp(opt.op, "write") == 0) @@ -176,6 +177,11 @@ perftest(const struct cmd *f, int argc, char *argv[]) arg_help(argc, argv, f); } io_test.time = opt.time; + if (opt.size < 0) { + fprintf(stderr, "Invalid size.\n"); + arg_help(argc, argv, f); + } + io_test.size = opt.size; open_dev(opt.dev, &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) err(1, "ioctl NVME_IO_TEST failed"); From owner-svn-src-all@freebsd.org Mon Oct 19 20:40:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2530A43448A; Mon, 19 Oct 2020 20:40:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFTCT2xmrz48lw; Mon, 19 Oct 2020 20:40:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC9F396C6; Mon, 19 Oct 2020 20:40: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 09JKe4nR079595; Mon, 19 Oct 2020 20:40:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKe4MC079594; Mon, 19 Oct 2020 20:40:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010192040.09JKe4MC079594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 19 Oct 2020 20:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366859 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:40:06 -0000 Author: mav Date: Mon Oct 19 20:40:03 2020 New Revision: 366859 URL: https://svnweb.freebsd.org/changeset/base/366859 Log: MFC r352671 (by imp): Size is unsigned, so remove the test entirely. The kernel won't crash if you have a bad value and I'd rather not have nvmecontrol know the internal details about how the nvme driver limits the transfer size. Modified: stable/12/sbin/nvmecontrol/perftest.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/perftest.c ============================================================================== --- stable/12/sbin/nvmecontrol/perftest.c Mon Oct 19 20:39:00 2020 (r366858) +++ stable/12/sbin/nvmecontrol/perftest.c Mon Oct 19 20:40:03 2020 (r366859) @@ -177,10 +177,6 @@ perftest(const struct cmd *f, int argc, char *argv[]) arg_help(argc, argv, f); } io_test.time = opt.time; - if (opt.size < 0) { - fprintf(stderr, "Invalid size.\n"); - arg_help(argc, argv, f); - } io_test.size = opt.size; open_dev(opt.dev, &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) From owner-svn-src-all@freebsd.org Mon Oct 19 20:42:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48566434575; Mon, 19 Oct 2020 20:42:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFTFk11Vcz49XY; Mon, 19 Oct 2020 20:42: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E06039B25; Mon, 19 Oct 2020 20:42:01 +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 09JKg12s079793; Mon, 19 Oct 2020 20:42:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKg12N079791; Mon, 19 Oct 2020 20:42:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010192042.09JKg12N079791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 19 Oct 2020 20:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366860 - stable/12/sbin/nvmecontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/nvmecontrol X-SVN-Commit-Revision: 366860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:42:02 -0000 Author: mav Date: Mon Oct 19 20:42:01 2020 New Revision: 366860 URL: https://svnweb.freebsd.org/changeset/base/366860 Log: MFC r360546, r360547 (by imp): Various improvements to this man page: o Be consistent about device-id and namespace-id o Use consistent arg markup for these o document you can use disk names too o document nsid command better o document the idenntify command o add a couple of examples. Modified: stable/12/sbin/nvmecontrol/nvmecontrol.8 stable/12/sbin/nvmecontrol/passthru.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- stable/12/sbin/nvmecontrol/nvmecontrol.8 Mon Oct 19 20:40:03 2020 (r366859) +++ stable/12/sbin/nvmecontrol/nvmecontrol.8 Mon Oct 19 20:42:01 2020 (r366860) @@ -1,4 +1,5 @@ .\" +.\" Copyright (c) 2020 Warner Losh .\" Copyright (c) 2018-2019 Alexander Motin .\" Copyright (c) 2012 Intel Corporation .\" All rights reserved. @@ -34,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2019 +.Dd April 30, 2020 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -47,8 +48,8 @@ .Ic identify .Op Fl v .Op Fl x -.Aq device id -.Aq namespace id +.Op Fl n Ar nsid +.Aq Ar device-id | Ar namespace-id .Nm .Ic perftest .Aq Fl n Ar num_threads @@ -56,10 +57,10 @@ .Op Fl p .Aq Fl s Ar size_in_bytes .Aq Fl t Ar time_in_sec -.Aq namespace id +.Aq Ar namespace-id .Nm .Ic reset -.Aq controller id +.Aq Ar device-id .Nm .Ic logpage .Aq Fl p Ar page_id @@ -69,26 +70,25 @@ .Op Fl f Ar LSP .Op Fl i Ar LSI .Op Fl r -.Aq device id -.Aq namespace id +.Aq Ar device-id | Ar namespace-id .Nm .Ic ns active -.Aq device id +.Aq Ar device-id .Nm .Ic ns allocated -.Aq device id +.Aq Ar device-id .Nm .Ic ns attach .Aq Fl n Ar nsid .Aq Fl c Ar cntid -.Aq device id +.Aq Ar device-id .Nm .Ic ns attached .Aq Fl n Ar nsid -.Aq device id +.Aq Ar device-id .Nm .Ic ns controllers -.Aq device id +.Aq Ar device-id .Nm .Ic ns create .Aq Fl s Ar nsze @@ -100,33 +100,32 @@ .Op Fl l Ar pil .Op Fl L Ar flbas .Op Fl d Ar dps -.Aq device id +.Aq Ar device-id .Nm .Ic ns delete .Aq Fl n Ar nsid -.Aq device id +.Aq Ar device-id .Nm .Ic ns detach .Aq Fl n Ar nsid .Aq Fl c Ar cntid -.Aq device id +.Aq Ar device-id .Nm .Ic ns identify .Op Fl v .Op Fl x .Aq Fl n Ar nsid -.Aq device id +.Aq Ar device-id .Nm .Ic nsid -.Aq device id -.Aq namespace id +.Aq Ar device-id | Ar namespace-id .Nm .Ic resv acquire .Aq Fl c Ar crkey .Op Fl p Ar prkey .Aq Fl t Ar rtype .Aq Fl a Ar racqa -.Aq namespace id +.Aq Ar namespace-id .Nm .Ic resv register .Op Fl c Ar crkey @@ -134,25 +133,25 @@ .Aq Fl r Ar rrega .Op Fl i Ar iekey .Op Fl p Ar cptpl -.Aq namespace id +.Aq Ar namespace-id .Nm .Ic resv release .Aq Fl c Ar crkey .Aq Fl t Ar rtype .Aq Fl a Ar rrela -.Aq namespace id +.Aq Ar namespace-id .Nm .Ic resv report .Op Fl e .Op Fl v .Op Fl x -.Aq namespace id +.Aq Ar namespace-id .Nm .Ic firmware .Op Fl s Ar slot .Op Fl f Ar path_to_firmware .Op Fl a -.Aq device id +.Aq Ar device-id .Nm .Ic format .Op Fl f Ar fmt @@ -161,8 +160,7 @@ .Op Fl l Ar pil .Op Fl E .Op Fl C -.Aq device id -.Aq namespace id +.Aq Ar device-id | Ar namespace-id .Nm .Ic sanitize .Aq Fl a Ar sanact @@ -172,7 +170,7 @@ .Op Fl r .Op Fl I .Op Fl U -.Aq device id +.Aq Ar device-id .Nm .Ic power .Op Fl l @@ -181,25 +179,65 @@ .Nm .Ic wdc cap-diag .Op Fl o path_template -.Aq device id +.Aq Ar device-id .Nm .Ic wdc drive-log .Op Fl o path_template -.Aq device id +.Aq Ar device-id .Nm .Ic wdc get-crash-dump .Op Fl o path_template -.Aq device id +.Aq Ar device-id .\" .Nm .\" .Ic wdc purge -.\" .Aq device id +.\" .Aq device-id .\" .Nm .\" .Ic wdc purge-monitor -.\" .Aq device id +.\" .Aq device-id +.Nm +.Ic admin-passthru +.Op args +.Aq Ar device-id +.Nm +.Ic io-passthru +.Op args +.Aq Ar namespace-id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. .Pp +.Ss identify +The identify commands reports information from the drive's +.Dv IDENTIFY_CONTROLLER +if a +.Ar device-id +is specified. +It reports +.Dv IDENTIFY_NAMESPACE +data if a +.Ar namespace-id +is specified. +When used with disk names, the +.Dv IDENTIFY_NAMESPACE +data is reported, unless the namespace +.Ar nsid +is overridden with the +.Fl n +flag. +Then that namespace's data is reported, if it exists. +The command accepts the following parameters: +.Bl -tag -width 6n +.It Fl n +The namespace +.Aq nsid +to use instead of the namespace associated with the device. +A +.Ar nsid +of +.Dq 0 +is used to retrieve the +.Dv IDENTIFY_CONTROLLER +data associated with that drive. .Ss logpage The logpage command knows how to print log pages of various types. It also knows about vendor specific log pages from hgst/wdc and intel. @@ -250,6 +288,12 @@ will set Retain Asynchronous Event. Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces. +.Ss nsid +Reports the namespace id and controller device associated with the +.Aq Ar namespace-id +or +.Aq Ar device-id +argument. .Ss resv acquire Acquire or preempt namespace reservation, using specified parameters: .Bl -tag -width 6n @@ -430,19 +474,116 @@ the drive's serial number and the type of dump it is f by .bin. These logs must be sent to the vendor for analysis. This tool only provides a way to extract them. +.Ss passthru +The +.Dq admin-passthru +and +.Dq io-passthru +commands send NVMe commands to +either the administrative or the data part of the device. +These commands are expected to be compatible with nvme-cli. +Please see +.St The NVMe Standard +for details. +.Bl -tag -width 16n +.It Fl o -opcode Ar opcode +Opcode to send. +.It Fl 2 -cdw2 Ar value +32-bit value for CDW2. +.It Fl 3 -cdw3 Ar value +32-bit value for CDW3. +.It Fl 4 -cdw10 Ar value +32-bit value for CDW10. +.It Fl 5 -cdw11 Ar value +32-bit value for CDW11. +.It Fl 6 -cdw12 Ar value +32-bit value for CDW12. +.It Fl 7 -cdw13 Ar value +32-bit value for CDW13. +.It Fl 8 -cdw14 Ar value +32-bit value for CDW14. +.It Fl 9 -cdw15 Ar value +32-bit value for CDW15. +.It Fl l -data-len +Length of the data for I/O (bytes). +.It Fl m -metadata-len +Length of the metadata segment for command (bytes). +This is ignored and not implemented in +.Xr nvme 4 . +.It Fl f -flags +Nvme command flags. +.It Fl n -namespace-id +Namespace ID for command (Ignored). +.It Fl p -prefill +Value to prefill payload with. +.It Fl b -raw-binary +Output in binary format (otherwise a hex dump is produced). +.It Fl d -dry-run +Do not actually execute the command, but perform sanity checks on it. +.It Fl r -read +Command reads data from the device. +.It Fl s -show-command +Show all the command values on stdout. +.It Fl w -write +Command writes data to the device. +.El +Send arbitrary commands to the device. +Can be used to extract vendor specific logs. +Transfers to/from the device possible, but limited to +.Dv MAXPHYS +bytes. +Commands either read data or write it, but not both. +Commands needing metadata are not supported by the +.Xr nvme 4 +drive. +.Sh DEVICE NAMES +Where +.Aq Ar namespace-id +is required, you can use either the +.Pa nvmeXnsY +device, or the disk device such as +.Pa ndaZ +or +.Pa nvdZ . +The leading +.Pa /dev/ +is omitted. +Where +.Aq Ar device-id +is required, you can use either the +.Pa nvmeX +device, or the disk device such as +.Pa nda Z +or +.Pa nvdZ . +For commands that take an optional +.Aq nsid +you can use it to get information on other namespaces, or to query the +drive itself. +A +.Aq nsid +of +.Dq 0 +means query the drive itself. .Sh EXAMPLES .Dl nvmecontrol devlist .Pp Display a list of NVMe controllers and namespaces along with their device nodes. .Pp .Dl nvmecontrol identify nvme0 +.Dl nvmecontrol identify -n 0 nvd0 .Pp -Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data. +Display a human-readable summary of the nvme0 +.Dv IDENTIFY_CONTROLLER +data. +In this example, nvd0 is connected to nvme0. .Pp .Dl nvmecontrol identify -x -v nvme0ns1 +.Dl nvmecontrol identify -x -v -n 1 nvme0 .Pp -Display an hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace -1. +Display an hexadecimal dump of the nvme0 +.Dv IDENTIFY_NAMESPACE +data for namespace 1. .Pp .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 .Pp @@ -451,8 +592,10 @@ Each thread will issue a single 512 byte read command. Results are printed to stdout when 30 seconds expires. .Pp .Dl nvmecontrol reset nvme0 +.Dl nvmecontrol reset nda4 .Pp Perform a controller-level reset of the nvme0 controller. +In this example, nda4 is wired to nvme0. .Pp .Dl nvmecontrol logpage -p 1 nvme0 .Pp @@ -500,6 +643,24 @@ Set the current power mode. .Dl nvmecontrol power nvme0 .Pp Get the current power mode. +.Pp +.Dl nvmecontrol identify -n 0 nda0 +.Pp +Identify the drive data associated with the +.Pa nda0 +device. +The corresponding +.Pa nvmeX +devices is used automatically. +.Pp +.Dl nvmecontrol identify nda0 +.Pp +Get the namespace parameters associated with the +.Pa nda0 +device. +The corresponding +.Pa nvmeXnsY +device is used automatically. .Sh DYNAMIC LOADING The directories .Pa /lib/nvmecontrol Modified: stable/12/sbin/nvmecontrol/passthru.c ============================================================================== --- stable/12/sbin/nvmecontrol/passthru.c Mon Oct 19 20:40:03 2020 (r366859) +++ stable/12/sbin/nvmecontrol/passthru.c Mon Oct 19 20:42:01 2020 (r366860) @@ -292,7 +292,7 @@ static struct cmd io_pass_cmd = { .ctx_size = sizeof(struct options), .opts = opts, .args = args, - .descr = "Send a pass through Admin command to the specified device", + .descr = "Send a pass through I/O command to the specified device", }; CMD_COMMAND(admin_pass_cmd); From owner-svn-src-all@freebsd.org Mon Oct 19 20:43:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96CE943490E; Mon, 19 Oct 2020 20:43:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFTHQ3SXLz49SL; Mon, 19 Oct 2020 20:43:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A7099C80; Mon, 19 Oct 2020 20:43:30 +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 09JKhUFJ085359; Mon, 19 Oct 2020 20:43:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JKhTr4085357; Mon, 19 Oct 2020 20:43:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010192043.09JKhTr4085357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Oct 2020 20:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366861 - in head/sys/modules: . vmware X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/modules: . vmware X-SVN-Commit-Revision: 366861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 20:43:30 -0000 Author: emaste Date: Mon Oct 19 20:43:29 2020 New Revision: 366861 URL: https://svnweb.freebsd.org/changeset/base/366861 Log: build vmware modules on arm64 pvscsi and vmxnet3 build and work. Exclude vmci for now as it contains x86-specific assembly. Reported by: Vincent Milum Jr MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/Makefile head/sys/modules/vmware/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Oct 19 20:42:01 2020 (r366860) +++ head/sys/modules/Makefile Mon Oct 19 20:43:29 2020 (r366861) @@ -511,6 +511,7 @@ _mthca= mthca _mlx4ib= mlx4ib _mlx5ib= mlx5ib .endif +_vmware= vmware .endif .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES) @@ -633,7 +634,6 @@ _safe= safe _speaker= speaker _splash= splash _sppp= sppp -_vmware= vmware _wbwd= wbwd _wi= wi Modified: head/sys/modules/vmware/Makefile ============================================================================== --- head/sys/modules/vmware/Makefile Mon Oct 19 20:42:01 2020 (r366860) +++ head/sys/modules/vmware/Makefile Mon Oct 19 20:43:29 2020 (r366861) @@ -23,6 +23,8 @@ # SUCH DAMAGE. # -SUBDIR= pvscsi vmci vmxnet3 - +SUBDIR= pvscsi vmxnet3 +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +SUBDIR+= vmci +.endif .include From owner-svn-src-all@freebsd.org Mon Oct 19 21:11:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D364435184; Mon, 19 Oct 2020 21:11:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFTw572B2z4DFB; Mon, 19 Oct 2020 21:11:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D31289ACB; Mon, 19 Oct 2020 21:11:49 +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 09JLBnDr000785; Mon, 19 Oct 2020 21:11:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JLBnTg000784; Mon, 19 Oct 2020 21:11:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010192111.09JLBnTg000784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 19 Oct 2020 21:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366862 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 366862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 21:11:50 -0000 Author: np Date: Mon Oct 19 21:11:49 2020 New Revision: 366862 URL: https://svnweb.freebsd.org/changeset/base/366862 Log: cxgbe(4): Updates to the drop features from r366532. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/t4_main.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Mon Oct 19 20:43:29 2020 (r366861) +++ head/share/man/man4/cxgbe.4 Mon Oct 19 21:11:49 2020 (r366862) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2020 +.Dd October 19, 2020 .Dt CXGBE 4 .Os .Sh NAME @@ -369,6 +369,7 @@ The attack filter will drop an incoming frame if any o true: src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip is loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback (::1/128) or unspecified (::/128); tcp and src/dst ip6 is mcast (ff00::/8). +This facility is available on T4 and T5 based cards only. .It Va hw.cxgbe.drop_ip_fragments Set to 1 to drop all incoming IP fragments. Default is 0. @@ -378,9 +379,11 @@ Set to 1 to drop incoming frames with Layer 2 length o Default is 1. .It Va hw.cxgbe.drop_pkts_with_l3_errors Set to 1 to drop incoming frames with IP version, length, or checksum errors. +The IP checksum is validated for TCP or UDP packets only. Default is 0. .It Va hw.cxgbe.drop_pkts_with_l4_errors -Set to 1 to drop incoming frames with Layer 4 length, checksum, or other errors. +Set to 1 to drop incoming frames with Layer 4 (TCP or UDP) length, +checksum, or other errors. Default is 0. .El .Sh SUPPORT Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Oct 19 20:43:29 2020 (r366861) +++ head/sys/dev/cxgbe/t4_main.c Mon Oct 19 21:11:49 2020 (r366862) @@ -4823,7 +4823,7 @@ set_params__post_init(struct adapter *sc) F_DROPERRORIPHDRLEN | F_DROPERRORTCPHDRLEN | F_DROPERRORPKTLEN | F_DROPERRORTCPOPT | F_DROPERRORCSUMIP | F_DROPERRORCSUM; val = 0; - if (t4_attack_filter != 0) { + if (chip_id(sc) < CHELSIO_T6 && t4_attack_filter != 0) { t4_set_reg_field(sc, A_TP_GLOBAL_CONFIG, F_ATTACKFILTERENABLE, F_ATTACKFILTERENABLE); val |= F_DROPERRORATTACK; From owner-svn-src-all@freebsd.org Mon Oct 19 21:27:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A34C8435815; Mon, 19 Oct 2020 21:27:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFVG83tSDz4Df4; Mon, 19 Oct 2020 21:27:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65183A31D; Mon, 19 Oct 2020 21:27:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JLRScj011200; Mon, 19 Oct 2020 21:27:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JLRS6Q011198; Mon, 19 Oct 2020 21:27:28 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010192127.09JLRS6Q011198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 19 Oct 2020 21:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366863 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 366863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 21:27:28 -0000 Author: br Date: Mon Oct 19 21:27:27 2020 New Revision: 366863 URL: https://svnweb.freebsd.org/changeset/base/366863 Log: Add IOMMU_BUSWIDE ahci quirk. Some controllers use PCI function 1 as the requester ID for DMA transfers, but the controllers are not PCI multifunction. Set the iommu buswide flag for them. This should instruct an IOMMU driver to use the same translation rule for all the devices and functions of a bus. This was discovered on the ARM Neoverse N1 System Development Platform (ARM N1SDP). Bug reference: https://bugzilla.kernel.org/show_bug.cgi?id=42679 Reported by: andrew Reviewed by: kib, mav Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26857 Modified: head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Mon Oct 19 21:11:49 2020 (r366862) +++ head/sys/dev/ahci/ahci.h Mon Oct 19 21:27:27 2020 (r366863) @@ -624,6 +624,7 @@ enum ahci_err_type { #define AHCI_Q_MRVL_SR_DEL 0x00200000 #define AHCI_Q_NOCCS 0x00400000 #define AHCI_Q_NOAUX 0x00800000 +#define AHCI_Q_IOMMU_BUSWIDE 0x01000000 #define AHCI_Q_BIT_STRING \ "\020" \ @@ -650,7 +651,8 @@ enum ahci_err_type { "\025NOMSIX" \ "\026MRVL_SR_DEL" \ "\027NOCCS" \ - "\030NOAUX" + "\030NOAUX" \ + "\031IOMMU_BUSWIDE" int ahci_attach(device_t dev); int ahci_detach(device_t dev); Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Oct 19 21:11:49 2020 (r366862) +++ head/sys/dev/ahci/ahci_pci.c Mon Oct 19 21:27:27 2020 (r366863) @@ -37,12 +37,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include "ahci.h" static int force_ahci = 1; @@ -248,7 +252,10 @@ static const struct { {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, {0x2368197b, 0x00, "JMicron JMB368", AHCI_Q_NOFORCE}, + {0x2392197b, 0x00, "JMicron JMB388", AHCI_Q_IOMMU_BUSWIDE}, {0x0585197b, 0x00, "JMicron JMB58x", 0}, + {0x01221c28, 0x00, "Lite-On Plextor M6E (Marvell 88SS9183)", + AHCI_Q_IOMMU_BUSWIDE}, {0x611111ab, 0x00, "Marvell 88SE6111", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | AHCI_Q_1CH | AHCI_Q_EDGEIS}, {0x612111ab, 0x00, "Marvell 88SE6121", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | @@ -257,19 +264,28 @@ static const struct { AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_NOPMP | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS}, - {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_ALTSIG}, - {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2}, + {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS | + AHCI_Q_IOMMU_BUSWIDE}, + {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_ALTSIG | + AHCI_Q_IOMMU_BUSWIDE}, + {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS | AHCI_Q_SATA2 | + AHCI_Q_IOMMU_BUSWIDE}, {0x91251b4b, 0x00, "Marvell 88SE9125", 0}, - {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_ALTSIG}, - {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_ALTSIG}, - {0x91721b4b, 0x00, "Marvell 88SE9172", 0}, - {0x91821b4b, 0x00, "Marvell 88SE9182", 0}, - {0x91831b4b, 0x00, "Marvell 88SS9183", 0}, - {0x91a01b4b, 0x00, "Marvell 88SE91Ax", 0}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_ALTSIG | + AHCI_Q_IOMMU_BUSWIDE}, + {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_ALTSIG | + AHCI_Q_IOMMU_BUSWIDE}, + {0x91701b4b, 0x00, "Marvell 88SE9170", AHCI_Q_IOMMU_BUSWIDE}, + {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_IOMMU_BUSWIDE}, + {0x917a1b4b, 0x00, "Marvell 88SE917A", AHCI_Q_IOMMU_BUSWIDE}, + {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_IOMMU_BUSWIDE}, + {0x91831b4b, 0x00, "Marvell 88SS9183", AHCI_Q_IOMMU_BUSWIDE}, + {0x91a01b4b, 0x00, "Marvell 88SE91Ax", AHCI_Q_IOMMU_BUSWIDE}, {0x92151b4b, 0x00, "Marvell 88SE9215", 0}, - {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_ALTSIG}, - {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_ALTSIG}, + {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_ALTSIG | + AHCI_Q_IOMMU_BUSWIDE}, + {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_ALTSIG | + AHCI_Q_IOMMU_BUSWIDE}, {0x92351b4b, 0x00, "Marvell 88SE9235", 0}, {0x06201103, 0x00, "HighPoint RocketRAID 620", 0}, {0x06201b4b, 0x00, "HighPoint RocketRAID 620", 0}, @@ -280,8 +296,8 @@ static const struct { {0x06441103, 0x00, "HighPoint RocketRAID 644", 0}, {0x06441b4b, 0x00, "HighPoint RocketRAID 644", 0}, {0x06411103, 0x00, "HighPoint RocketRAID 640L", 0}, - {0x06421103, 0x00, "HighPoint RocketRAID 642L", 0}, - {0x06451103, 0x00, "HighPoint RocketRAID 644L", 0}, + {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_IOMMU_BUSWIDE}, + {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_IOMMU_BUSWIDE}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, @@ -482,6 +498,16 @@ ahci_pci_attach(device_t dev) ahci_ids[i].rev > revid)) i++; ctlr->quirks = ahci_ids[i].quirks; + + if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { + /* + * The controller issues DMA requests from PCI function 1, + * but the device is not multifunction. + * Ref: https://bugzilla.kernel.org/show_bug.cgi?id=42679 + */ + bus_dma_iommu_set_buswide(dev); + } + /* Limit speed for my onboard JMicron external port. * It is not eSATA really, limit to SATA 1 */ if (pci_get_devid(dev) == 0x2363197b && From owner-svn-src-all@freebsd.org Mon Oct 19 21:45:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FB37435518; Mon, 19 Oct 2020 21:45:37 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from sc1.bsdpad.com (sc1.bsdpad.com [163.172.212.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFVg45TJpz4Ftr; Mon, 19 Oct 2020 21:45:36 +0000 (UTC) (envelope-from br@bsdpad.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bsdpad.com; s=20190317; h=Subject:To:From; bh=eDaH8jQczThHkIZtvtXIoz/DDope4JdU/4WqJtLwoYc=; b=QaRxz+mGwxaOKlh+2YMtJxjzec 61QK4l8V+rnapz9caCES8KuVeaysv78hFe5p+jutJmE0qUitTs2GZtUx04Top4Hm/YStbnCwQ9x+/ qDrf5rophHOapCoqyYf9CzdtJB7GsY15xev3ycimLJf2hE/rXg7Ivim3ZIpZlLpctyotZ+ztY2nR9 7CzQkOdMpezgtY6SmSU41WDQ0aB8+0b0GFTLdcA+/A6V/tsIP9EIgdUM+OdzKpg9jLF0OArxbtHoE GNqEBGJ7xb2D1cUzBcIMsfhVMKs2yODkiltJ4ma6V3Q+yL6IUJ1bE2hyxjYpw1EMiVldbP8P5Uu3y //rXsFGw==; Received: from localhost ([127.0.0.1] helo=bsdpad.com) by sc1.bsdpad.com with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1kUctw-0007cx-Cx; Mon, 19 Oct 2020 22:41:08 +0100 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Mon, 19 Oct 2020 22:41:08 +0100 (BST) Date: Mon, 19 Oct 2020 22:41:08 +0100 From: Ruslan Bukin To: Jessica Clarke Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366833 - in head/sys: dev/iommu kern sys Message-ID: <20201019214108.GA29097@bsdpad.com> References: <202010191310.09JDALHp000954@repo.freebsd.org> <917B04A7-C9CA-439B-8334-C602F1E68005@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <917B04A7-C9CA-439B-8334-C602F1E68005@freebsd.org> X-Rspamd-Queue-Id: 4CFVg45TJpz4Ftr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:163.172.208.0/20, country:FR] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 21:45:37 -0000 On Mon, Oct 19, 2020 at 03:08:32PM +0100, Jessica Clarke wrote: > On 19 Oct 2020, at 14:10, Ruslan Bukin wrote: > > > > +#ifndef _DEV_IOMMU_IOMMU_MSI_H_ > > +#define _DEV_IOMMU_IOMMU_MSI_H_ > > + > > +#include > > + > > +struct iommu_unit; > > This seems unused, perhaps left from a previous patch version? > The forward declaration is not needed here, indeed. Thanks. Ruslan From owner-svn-src-all@freebsd.org Mon Oct 19 22:27:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D67F436450; Mon, 19 Oct 2020 22:27:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFWbF72G2z4HXL; Mon, 19 Oct 2020 22:27:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D47C9AD9D; Mon, 19 Oct 2020 22:27:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JMRLsn048189; Mon, 19 Oct 2020 22:27:21 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JMRLKq048188; Mon, 19 Oct 2020 22:27:21 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010192227.09JMRLKq048188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 19 Oct 2020 22:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366864 - stable/12/release/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/release/arm64 X-SVN-Commit-Revision: 366864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 22:27:22 -0000 Author: mhorne Date: Mon Oct 19 22:27:21 2020 New Revision: 366864 URL: https://svnweb.freebsd.org/changeset/base/366864 Log: MFC r365884: arm64: generate ISO release images This was modified slightly to cope with how ESP partitions are generated in stable/12. Sponsored by: The FreeBSD Foundation Added: stable/12/release/arm64/mkisoimages.sh - copied, changed from r365884, head/release/arm64/mkisoimages.sh Modified: Directory Properties: stable/12/ (props changed) Copied and modified: stable/12/release/arm64/mkisoimages.sh (from r365884, head/release/arm64/mkisoimages.sh) ============================================================================== --- head/release/arm64/mkisoimages.sh Fri Sep 18 14:40:13 2020 (r365884, copy source) +++ stable/12/release/arm64/mkisoimages.sh Mon Oct 19 22:27:21 2020 (r366864) @@ -19,11 +19,6 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -set -e - -scriptdir=$(dirname $(realpath $0)) -. ${scriptdir}/../../tools/boot/install-boot.sh - if [ -z $ETDUMP ]; then ETDUMP=etdump fi @@ -39,13 +34,18 @@ fi if [ "$1" = "-b" ]; then BASEBITSDIR="$4" - # Make an EFI system partition. - # The ISO file is a special case, in that it only has a maximum of - # 800 KB available for the boot code. So make an 800 KB ESP - espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi - - bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o platformid=efi" + # Make EFI system partition (should be done with makefs in the future) + dd if=/dev/zero of=efiboot.img bs=4k count=200 + device=`mdconfig -a -t vnode -f efiboot.img` + newfs_msdos -F 12 -m 0xf8 /dev/$device + mkdir efi + mount -t msdosfs /dev/$device efi + mkdir -p efi/efi/boot + cp -p "$BASEBITSDIR/boot/loader.efi" efi/efi/boot/bootaa64.efi + umount efi + rmdir efi + mdconfig -d -u $device + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi" shift else From owner-svn-src-all@freebsd.org Mon Oct 19 22:32:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00540436E90; Mon, 19 Oct 2020 22:32:37 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFWjJ6G8rz4Htk; Mon, 19 Oct 2020 22:32:36 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA39AAE48; Mon, 19 Oct 2020 22:32:36 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09JMWalI053935; Mon, 19 Oct 2020 22:32:36 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09JMWavp053934; Mon, 19 Oct 2020 22:32:36 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010192232.09JMWavp053934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 19 Oct 2020 22:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366865 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 366865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 22:32:37 -0000 Author: br Date: Mon Oct 19 22:32:36 2020 New Revision: 366865 URL: https://svnweb.freebsd.org/changeset/base/366865 Log: Fix build: only set iommu buswide flag if IOMMU code is included. Sponsored by: Innovate DSbD Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Oct 19 22:27:21 2020 (r366864) +++ head/sys/dev/ahci/ahci_pci.c Mon Oct 19 22:32:36 2020 (r366865) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_iommu.h" + #include #include #include @@ -499,6 +501,7 @@ ahci_pci_attach(device_t dev) i++; ctlr->quirks = ahci_ids[i].quirks; +#ifdef IOMMU if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { /* * The controller issues DMA requests from PCI function 1, @@ -507,6 +510,7 @@ ahci_pci_attach(device_t dev) */ bus_dma_iommu_set_buswide(dev); } +#endif /* Limit speed for my onboard JMicron external port. * It is not eSATA really, limit to SATA 1 */ From owner-svn-src-all@freebsd.org Tue Oct 20 01:29:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50A3E43C3AF; Tue, 20 Oct 2020 01:29:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFbdk19yFz4Sx2; Tue, 20 Oct 2020 01:29:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BED6D0D7; Tue, 20 Oct 2020 01:29:46 +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 09K1TjTE058696; Tue, 20 Oct 2020 01:29:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K1Tj91058693; Tue, 20 Oct 2020 01:29:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010200129.09K1Tj91058693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 20 Oct 2020 01:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366866 - in head: include lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: include lib/libc/stdlib X-SVN-Commit-Revision: 366866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 01:29:46 -0000 Author: delphij Date: Tue Oct 20 01:29:45 2020 New Revision: 366866 URL: https://svnweb.freebsd.org/changeset/base/366866 Log: Further refinements of ptsname_r(3) interface: - Hide ptsname_r under __BSD_VISIBLE for now as the specification is not finalized at this time. - Keep Symbol.map sorted. - Avoid the interposing of ptsname_r(3) from an user application from breaking ptsname(3) by making the implementation a static method and call the static function from ptsname(3) instead. Reported by: kib Reviewed by: kib, jilles MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26845 Modified: head/include/stdlib.h head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/ptsname.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Oct 19 22:32:36 2020 (r366865) +++ head/include/stdlib.h Tue Oct 20 01:29:45 2020 (r366866) @@ -211,7 +211,6 @@ double drand48(void); double erand48(unsigned short[3]); /* char *fcvt(double, int, int * __restrict, int * __restrict); */ /* char *gcvt(double, int, int * __restrict, int * __restrict); */ -int grantpt(int); char *initstate(unsigned int, char *, size_t); long jrand48(unsigned short[3]); char *l64a(long); @@ -223,9 +222,6 @@ char *mktemp(char *); #endif long mrand48(void); long nrand48(unsigned short[3]); -int posix_openpt(int); -char *ptsname(int); -int ptsname_r(int, char *, size_t); int putenv(char *); long random(void); unsigned short @@ -233,8 +229,18 @@ unsigned short char *setstate(/* const */ char *); void srand48(long); void srandom(unsigned int); +#endif /* __XSI_VISIBLE */ + +#if __XSI_VISIBLE +int grantpt(int); +int posix_openpt(int); +char *ptsname(int); int unlockpt(int); #endif /* __XSI_VISIBLE */ +#if __BSD_VISIBLE +/* ptsname_r will be included in POSIX issue 8 */ +int ptsname_r(int, char *, size_t); +#endif #if __BSD_VISIBLE extern const char *malloc_conf; Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Oct 19 22:32:36 2020 (r366865) +++ head/lib/libc/stdlib/Symbol.map Tue Oct 20 01:29:45 2020 (r366866) @@ -122,10 +122,10 @@ FBSD_1.5 { }; FBSD_1.6 { + ptsname_r; qsort_s; rand; srand; - ptsname_r; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdlib/ptsname.c ============================================================================== --- head/lib/libc/stdlib/ptsname.c Mon Oct 19 22:32:36 2020 (r366865) +++ head/lib/libc/stdlib/ptsname.c Tue Oct 20 01:29:45 2020 (r366866) @@ -76,7 +76,7 @@ __strong_reference(__isptmaster, unlockpt); * associated with the specified master. */ int -ptsname_r(int fildes, char *buffer, size_t buflen) +__ptsname_r(int fildes, char *buffer, size_t buflen) { if (buflen <= sizeof(_PATH_DEV)) { @@ -101,6 +101,8 @@ ptsname_r(int fildes, char *buffer, size_t buflen) return (0); } +__strong_reference(__ptsname_r, ptsname_r); + /* * ptsname(): return the pathname of the slave pseudo-terminal device * associated with the specified master. @@ -108,10 +110,10 @@ ptsname_r(int fildes, char *buffer, size_t buflen) char * ptsname(int fildes) { - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN]; + static char pt_slave[sizeof(_PATH_DEV) + SPECNAMELEN]; - if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) + if (__ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) return (pt_slave); - else - return (NULL); + + return (NULL); } From owner-svn-src-all@freebsd.org Tue Oct 20 02:28:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A704443F4C0; Tue, 20 Oct 2020 02:28:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFcx43xccz4YFC; Tue, 20 Oct 2020 02:28: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AAA9DE87; Tue, 20 Oct 2020 02:28: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 09K2S8qP095830; Tue, 20 Oct 2020 02:28:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K2S7GK095828; Tue, 20 Oct 2020 02:28:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010200228.09K2S7GK095828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 20 Oct 2020 02:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366867 - in stable/12/sys/cam: ata nvme scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ata nvme scsi X-SVN-Commit-Revision: 366867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 02:28:08 -0000 Author: mav Date: Tue Oct 20 02:28:07 2020 New Revision: 366867 URL: https://svnweb.freebsd.org/changeset/base/366867 Log: MFC r366689: Fix sbuf_finish() error code check in user-space. Modified: stable/12/sys/cam/ata/ata_all.c stable/12/sys/cam/nvme/nvme_all.c stable/12/sys/cam/scsi/scsi_all.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_all.c ============================================================================== --- stable/12/sys/cam/ata/ata_all.c Tue Oct 20 01:29:45 2020 (r366866) +++ stable/12/sys/cam/ata/ata_all.c Tue Oct 20 02:28:07 2020 (r366867) @@ -318,7 +318,12 @@ ata_cmd_string(struct ata_cmd *cmd, char *cmd_string, ata_cmd_sbuf(cmd, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); @@ -348,7 +353,12 @@ ata_res_string(struct ata_res *res, char *res_string, ata_res_sbuf(res, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); Modified: stable/12/sys/cam/nvme/nvme_all.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_all.c Tue Oct 20 01:29:45 2020 (r366866) +++ stable/12/sys/cam/nvme/nvme_all.c Tue Oct 20 02:28:07 2020 (r366867) @@ -153,7 +153,12 @@ nvme_cmd_string(const struct nvme_command *cmd, char * nvme_cmd_sbuf(cmd, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Tue Oct 20 01:29:45 2020 (r366866) +++ stable/12/sys/cam/scsi/scsi_all.c Tue Oct 20 02:28:07 2020 (r366867) @@ -3488,7 +3488,12 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, s /* ENOMEM just means that the fixed buffer is full, OK to ignore */ error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); From owner-svn-src-all@freebsd.org Tue Oct 20 02:32:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A531143F744; Tue, 20 Oct 2020 02:32:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFd2K3tQGz4Yjh; Tue, 20 Oct 2020 02:32:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 687F2E000; Tue, 20 Oct 2020 02:32:41 +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 09K2Wfg8002052; Tue, 20 Oct 2020 02:32:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K2WeGD002051; Tue, 20 Oct 2020 02:32:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010200232.09K2WeGD002051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 20 Oct 2020 02:32: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: r366868 - in stable/11/sys/cam: ata scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/cam: ata scsi X-SVN-Commit-Revision: 366868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 02:32:41 -0000 Author: mav Date: Tue Oct 20 02:32:40 2020 New Revision: 366868 URL: https://svnweb.freebsd.org/changeset/base/366868 Log: MFC r366689: Fix sbuf_finish() error code check in user-space. Modified: stable/11/sys/cam/ata/ata_all.c stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_all.c ============================================================================== --- stable/11/sys/cam/ata/ata_all.c Tue Oct 20 02:28:07 2020 (r366867) +++ stable/11/sys/cam/ata/ata_all.c Tue Oct 20 02:32:40 2020 (r366868) @@ -316,7 +316,12 @@ ata_cmd_string(struct ata_cmd *cmd, char *cmd_string, ata_cmd_sbuf(cmd, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); @@ -346,7 +351,12 @@ ata_res_string(struct ata_res *res, char *res_string, ata_res_sbuf(res, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Tue Oct 20 02:28:07 2020 (r366867) +++ stable/11/sys/cam/scsi/scsi_all.c Tue Oct 20 02:32:40 2020 (r366868) @@ -3486,7 +3486,12 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, s /* ENOMEM just means that the fixed buffer is full, OK to ignore */ error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); From owner-svn-src-all@freebsd.org Tue Oct 20 07:18:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0961447F17; Tue, 20 Oct 2020 07:18:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFlN62qqWz3d5H; Tue, 20 Oct 2020 07:18:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6B3F10F75; Tue, 20 Oct 2020 07:18:28 +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 09K7ISTV074765; Tue, 20 Oct 2020 07:18:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K7IRiP074758; Tue, 20 Oct 2020 07:18:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010200718.09K7IRiP074758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Oct 2020 07:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366869 - in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/nullfs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/nullfs kern sys X-SVN-Commit-Revision: 366869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 07:18:30 -0000 Author: mjg Date: Tue Oct 20 07:18:27 2020 New Revision: 366869 URL: https://svnweb.freebsd.org/changeset/base/366869 Log: vfs: drop spurious cred argument from VOP_VPTOCNP Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c head/sys/fs/nullfs/null_vnops.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Oct 20 07:18:27 2020 (r366869) @@ -6507,8 +6507,7 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) error = vget(covered_vp, LK_SHARED | LK_VNHELD, curthread); #endif if (error == 0) { - error = VOP_VPTOCNP(covered_vp, ap->a_vpp, ap->a_cred, - ap->a_buf, ap->a_buflen); + error = VOP_VPTOCNP(covered_vp, ap->a_vpp, ap->a_buf, ap->a_buflen); vput(covered_vp); } vn_lock(vp, ltype | LK_RETRY); Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/fs/nullfs/null_vnops.c Tue Oct 20 07:18:27 2020 (r366869) @@ -909,7 +909,6 @@ null_vptocnp(struct vop_vptocnp_args *ap) struct vnode *vp = ap->a_vp; struct vnode **dvp = ap->a_vpp; struct vnode *lvp, *ldvp; - struct ucred *cred = ap->a_cred; struct mount *mp; int error, locked; @@ -921,7 +920,7 @@ null_vptocnp(struct vop_vptocnp_args *ap) VOP_UNLOCK(vp); /* vp is held by vn_vptocnp_locked that called us */ ldvp = lvp; vref(lvp); - error = vn_vptocnp(&ldvp, cred, ap->a_buf, ap->a_buflen); + error = vn_vptocnp(&ldvp, ap->a_buf, ap->a_buflen); vdrop(lvp); if (error != 0) { vn_lock(vp, locked | LK_RETRY); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/kern/vfs_cache.c Tue Oct 20 07:18:27 2020 (r366869) @@ -2811,7 +2811,7 @@ vn_dd_from_dst(struct vnode *vp) } int -vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen) +vn_vptocnp(struct vnode **vp, char *buf, size_t *buflen) { struct vnode *dvp; struct namecache *ncp; @@ -2853,7 +2853,7 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char mtx_unlock(vlp); vn_lock(*vp, LK_SHARED | LK_RETRY); - error = VOP_VPTOCNP(*vp, &dvp, cred, buf, buflen); + error = VOP_VPTOCNP(*vp, &dvp, buf, buflen); vput(*vp); if (error) { counter_u64_add(numfullpathfail2, 1); @@ -2952,7 +2952,7 @@ vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, error, vp, NULL); break; } - error = vn_vptocnp(&vp, curthread->td_ucred, buf, &buflen); + error = vn_vptocnp(&vp, buf, &buflen); if (error) break; if (buflen == 0) { @@ -3151,7 +3151,7 @@ vn_fullpath_any(struct vnode *vp, struct vnode *rdir, if (vp->v_type != VDIR) { *buflen -= 1; buf[*buflen] = '\0'; - error = vn_vptocnp(&vp, curthread->td_ucred, buf, buflen); + error = vn_vptocnp(&vp, buf, buflen); if (error) return (error); if (*buflen == 0) { Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/kern/vfs_default.c Tue Oct 20 07:18:27 2020 (r366869) @@ -819,7 +819,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) { struct vnode *vp = ap->a_vp; struct vnode **dvp = ap->a_vpp; - struct ucred *cred = ap->a_cred; + struct ucred *cred; char *buf = ap->a_buf; size_t *buflen = ap->a_buflen; char *dirbuf, *cpos; @@ -836,6 +836,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) error = 0; covered = 0; td = curthread; + cred = td->td_ucred; if (vp->v_type != VDIR) return (ENOENT); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/kern/vnode_if.src Tue Oct 20 07:18:27 2020 (r366869) @@ -682,7 +682,6 @@ vop_vptofh { vop_vptocnp { IN struct vnode *vp; OUT struct vnode **vpp; - IN struct ucred *cred; INOUT char *buf; INOUT size_t *buflen; }; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Oct 20 02:32:40 2020 (r366868) +++ head/sys/sys/vnode.h Tue Oct 20 07:18:27 2020 (r366869) @@ -657,8 +657,7 @@ int insmntque1(struct vnode *vp, struct mount *mp, int insmntque(struct vnode *vp, struct mount *mp); u_quad_t init_va_filerev(void); int speedup_syncer(void); -int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, - size_t *buflen); +int vn_vptocnp(struct vnode **vp, char *buf, size_t *buflen); int vn_getcwd(char *buf, char **retbuf, size_t *buflen); int vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf); int vn_fullpath_global(struct vnode *vp, char **retbuf, char **freebuf); From owner-svn-src-all@freebsd.org Tue Oct 20 07:19:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82565447D45; Tue, 20 Oct 2020 07:19:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFlNn2xpRz3dPS; Tue, 20 Oct 2020 07:19:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46D33111E5; Tue, 20 Oct 2020 07:19:05 +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 09K7J5lf074879; Tue, 20 Oct 2020 07:19:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K7J39n074871; Tue, 20 Oct 2020 07:19:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010200719.09K7J39n074871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Oct 2020 07:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366870 - in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/cd9660 fs/ext2fs fs/fuse fs/nfsclient fs/smbfs kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/cd9660 fs/ext2fs fs/fuse fs/nfsclient fs/smbfs kern X-SVN-Commit-Revision: 366870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 07:19:05 -0000 Author: mjg Date: Tue Oct 20 07:19:03 2020 New Revision: 366870 URL: https://svnweb.freebsd.org/changeset/base/366870 Log: vfs: drop the de facto curthread argument from VOP_INACTIVE Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_node.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/smbfs/smbfs_node.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Tue Oct 20 07:19:03 2020 (r366870) @@ -5821,7 +5821,7 @@ zfs_freebsd_inactive(struct vop_inactive_args *ap) { vnode_t *vp = ap->a_vp; - zfs_inactive(vp, ap->a_td->td_ucred, NULL); + zfs_inactive(vp, curthread->td_ucred, NULL); return (0); } @@ -5829,7 +5829,6 @@ zfs_freebsd_inactive(struct vop_inactive_args *ap) #ifndef _SYS_SYSPROTO_H_ struct vop_need_inactive_args { struct vnode *a_vp; - struct thread *a_td; }; #endif Modified: head/sys/fs/cd9660/cd9660_node.c ============================================================================== --- head/sys/fs/cd9660/cd9660_node.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/fs/cd9660/cd9660_node.c Tue Oct 20 07:19:03 2020 (r366870) @@ -63,7 +63,6 @@ int cd9660_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/fs/ext2fs/ext2_inode.c Tue Oct 20 07:19:03 2020 (r366870) @@ -593,7 +593,7 @@ ext2_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - struct thread *td = ap->a_td; + struct thread *td = curthread; int mode, error = 0; /* Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/fs/fuse/fuse_vnops.c Tue Oct 20 07:19:03 2020 (r366870) @@ -850,14 +850,13 @@ fake: /* struct vnop_inactive_args { struct vnode *a_vp; - struct thread *a_td; }; */ static int fuse_vnop_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; + struct thread *td = curthread; struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh, *fufh_tmp; Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/fs/nfsclient/nfs_clnode.c Tue Oct 20 07:19:03 2020 (r366870) @@ -239,8 +239,10 @@ ncl_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct nfsnode *np; + struct thread *td; boolean_t retv; + td = curthread; if (NFS_ISV4(vp) && vp->v_type == VREG) { /* * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4 @@ -256,14 +258,14 @@ ncl_inactive(struct vop_inactive_args *ap) } else retv = TRUE; if (retv == TRUE) { - (void)ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0); - (void)nfsrpc_close(vp, 1, ap->a_td); + (void)ncl_flush(vp, MNT_WAIT, td, 1, 0); + (void)nfsrpc_close(vp, 1, td); } } np = VTONFS(vp); NFSLOCKNODE(np); - ncl_releasesillyrename(vp, ap->a_td); + ncl_releasesillyrename(vp, td); /* * NMODIFIED means that there might be dirty/stale buffers Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/fs/smbfs/smbfs_node.c Tue Oct 20 07:19:03 2020 (r366870) @@ -299,10 +299,9 @@ int smbfs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; - struct thread *a_td; } */ *ap; { - struct thread *td = ap->a_td; + struct thread *td = curthread; struct ucred *cred = td->td_ucred; struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/kern/vfs_subr.c Tue Oct 20 07:19:03 2020 (r366870) @@ -3524,7 +3524,7 @@ vinactivef(struct vnode *vp) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); } - VOP_INACTIVE(vp, curthread); + VOP_INACTIVE(vp); VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Tue Oct 20 07:18:27 2020 (r366869) +++ head/sys/kern/vnode_if.src Tue Oct 20 07:19:03 2020 (r366870) @@ -397,7 +397,6 @@ vop_readlink { vop_inactive { IN struct vnode *vp; - IN struct thread *td; }; %! need_inactive debugpre vop_need_inactive_debugpre From owner-svn-src-all@freebsd.org Tue Oct 20 07:19:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36DA7428093; Tue, 20 Oct 2020 07:19:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFlPY0grzz3dbV; Tue, 20 Oct 2020 07:19:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEC4710F76; Tue, 20 Oct 2020 07:19:44 +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 09K7Jicl074951; Tue, 20 Oct 2020 07:19:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K7JiY0074950; Tue, 20 Oct 2020 07:19:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010200719.09K7JiY0074950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Oct 2020 07:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366871 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 07:19:45 -0000 Author: mjg Date: Tue Oct 20 07:19:44 2020 New Revision: 366871 URL: https://svnweb.freebsd.org/changeset/base/366871 Log: Bump __FreeBSD_version after VOP VPTOCNP and INACTIVE changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Oct 20 07:19:03 2020 (r366870) +++ head/sys/sys/param.h Tue Oct 20 07:19:44 2020 (r366871) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300122 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300123 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Oct 20 08:08:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F708428D1A; Tue, 20 Oct 2020 08:08:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmTP04tGz3gP4; Tue, 20 Oct 2020 08:08: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB8E011FA2; Tue, 20 Oct 2020 08:08:08 +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 09K88878005390; Tue, 20 Oct 2020 08:08:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K888He005389; Tue, 20 Oct 2020 08:08:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200808.09K888He005389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366872 - stable/12/sys/tests/runtest X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/tests/runtest X-SVN-Commit-Revision: 366872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:08:09 -0000 Author: hselasky Date: Tue Oct 20 08:08:08 2020 New Revision: 366872 URL: https://svnweb.freebsd.org/changeset/base/366872 Log: MFC r365236: Add small tool to invoke kernel test framework tests. Sponsored by: Mellanox Technologies // NVIDIA Networking Added: stable/12/sys/tests/runtest/ - copied from r365236, head/sys/tests/runtest/ Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Tue Oct 20 08:11:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 520B5428D31; Tue, 20 Oct 2020 08:11:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmYM1W0Hz3gfJ; Tue, 20 Oct 2020 08:11:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181671216B; Tue, 20 Oct 2020 08:11:35 +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 09K8BYjt006329; Tue, 20 Oct 2020 08:11:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8BY8J006328; Tue, 20 Oct 2020 08:11:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200811.09K8BY8J006328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366873 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 366873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:11:35 -0000 Author: hselasky Date: Tue Oct 20 08:11:34 2020 New Revision: 366873 URL: https://svnweb.freebsd.org/changeset/base/366873 Log: MFC r365958: Add example to ng_bpf(4) showing how ng_bpf(4) can be used to prevent spoofing. Differential Revision: https://reviews.freebsd.org/D26488 Reviewed by: pi, bcr (manpages) Submitted by: lutz_donnerhacke.de (Lutz Donnerhacke) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/share/man/man4/ng_bpf.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ng_bpf.4 ============================================================================== --- stable/12/share/man/man4/ng_bpf.4 Tue Oct 20 08:08:08 2020 (r366872) +++ stable/12/share/man/man4/ng_bpf.4 Tue Oct 20 08:11:34 2020 (r366873) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_bpf.8,v 1.2 1999/12/03 01:57:12 archie Exp $ .\" -.Dd November 13, 2012 +.Dd September 20, 2020 .Dt NG_BPF 4 .Os .Sh NAME @@ -113,21 +113,18 @@ program or else .Er EINVAL is returned. .It Dv NGM_BPF_GET_PROGRAM Pq Ic getprogram -This command takes an -.Tn ASCII +This command takes an ASCII string argument, the hook name, and returns the corresponding .Dv "struct ng_bpf_hookprog" as shown above. .It Dv NGM_BPF_GET_STATS Pq Ic getstats -This command takes an -.Tn ASCII +This command takes an ASCII string argument, the hook name, and returns the statistics associated with the hook as a .Dv "struct ng_bpf_hookstat" . .It Dv NGM_BPF_CLR_STATS Pq Ic clrstats -This command takes an -.Tn ASCII +This command takes an ASCII string argument, the hook name, and clears the statistics associated with the hook. .It Dv NGM_BPF_GETCLR_STATS Pq Ic getclrstats @@ -142,9 +139,8 @@ control message, or when all hooks have been disconnec .Sh EXAMPLES It is possible to configure a node from the command line, using .Xr tcpdump 1 -to generate raw BPF instructions which are then fed into an -.Xr awk 1 -script to create the ASCII form of a +to generate raw BPF instructions which are then transformed +into the ASCII form of a .Dv NGM_BPF_SET_PROGRAM control message, as demonstrated here: .Bd -literal -offset 4n @@ -169,6 +165,51 @@ ngctl msg ${NODEPATH} setprogram { thisHook=\\"${INHOO ifMatch=\\"${MATCHHOOK}\\" \\ ifNotMatch=\\"${NOTMATCHHOOK}\\" \\ ${BPFPROG} } +.Ed +.Pp +Based on the previous example, it is possible to prevent a jail (or a VM) +from spoofing by allowing only traffic that has the expected ethernet and +IP addresses: +.Bd -literal -offset 4n +#!/bin/sh + +NODEPATH="my_node:" +JAIL_MAC="0a:00:de:ad:be:ef" +JAIL_IP="128.66.1.42" +JAIL_HOOK="jail" +HOST_HOOK="host" +DEBUG_HOOK="nomatch" + +bpf_prog() { + local PATTERN=$1 + + tcpdump -s 8192 -p -ddd ${PATTERN} | ( + read len + echo -n "bpf_prog_len=$len " + echo -n "bpf_prog=[" + while read code jt jf k ; do + echo -n " { code=$code jt=$jt jf=$jf k=$k }" + done + echo " ]" + ) +} + +# Prevent jail from spoofing (filter packets coming from jail) +ngctl msg ${NODEPATH} setprogram { \\ + thisHook=\\"${JAIL_HOOK}\\" \\ + ifMatch=\\"${HOST_HOOK}\\" \\ + ifNotMatch=\\"${DEBUG_HOOK}\\" \\ + $(bpf_prog "ether src ${JAIL_MAC} && src ${JAIL_IP}") \\ +} + +# Prevent jail from receiving spoofed packets (filter packets +# coming from host) +ngctl msg ${NODEPATH} setprogram { \\ + thisHook=\\"${HOST_HOOK}\\" \\ + ifMatch=\\"${JAIL_HOOK}\\" \\ + ifNotMatch=\\"${DEBUG_HOOK}\\" \\ + $(bpf_prog "ether dst ${JAIL_MAC} && dst ${JAIL_IP}") \\ +} .Ed .Sh SEE ALSO .Xr bpf 4 , From owner-svn-src-all@freebsd.org Tue Oct 20 08:12:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F7654291FC; Tue, 20 Oct 2020 08:12:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmZX0ydHz3gwT; Tue, 20 Oct 2020 08:12:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045FC11DDA; Tue, 20 Oct 2020 08:12: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 09K8CZGc011308; Tue, 20 Oct 2020 08:12:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8CZWM011306; Tue, 20 Oct 2020 08:12:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200812.09K8CZWM011306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366874 - in stable/12/sys/dev/usb: . serial X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . serial X-SVN-Commit-Revision: 366874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:12:36 -0000 Author: hselasky Date: Tue Oct 20 08:12:35 2020 New Revision: 366874 URL: https://svnweb.freebsd.org/changeset/base/366874 Log: MFC r365966: Add support for Winbond USB CDC modem device found in Tenma power supply. PR: 249384 Submitted by: darius@dons.net.au Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/serial/umodem.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/12/sys/dev/usb/serial/umodem.c Tue Oct 20 08:11:34 2020 (r366873) +++ stable/12/sys/dev/usb/serial/umodem.c Tue Oct 20 08:12:35 2020 (r366874) @@ -150,6 +150,8 @@ static const STRUCT_USB_HOST_ID umodem_host_devs[] = { {USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)}, {USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)}, {USB_VPI(USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_PC5740, 1)}, + /* Winbond */ + {USB_VENDOR(USB_VENDOR_WINBOND), USB_PRODUCT(USB_PRODUCT_WINBOND_CDC)}, }; /* Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Tue Oct 20 08:11:34 2020 (r366873) +++ stable/12/sys/dev/usb/usbdevs Tue Oct 20 08:12:35 2020 (r366874) @@ -4850,6 +4850,7 @@ product WIENERPLEINBAUS MPOD 0x0012 MPOD PSU product WIENERPLEINBAUS CML 0x0015 CML Data Logger /* Windbond Electronics */ +product WINBOND CDC 0x5011 CDC serial device product WINBOND UH104 0x5518 4-port USB Hub /* WinMaxGroup products */ From owner-svn-src-all@freebsd.org Tue Oct 20 08:13:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 026AB429222; Tue, 20 Oct 2020 08:13:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmbH5sn8z3y1n; Tue, 20 Oct 2020 08:13:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACBAC11EB0; Tue, 20 Oct 2020 08:13: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 09K8DFsC011416; Tue, 20 Oct 2020 08:13:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8DFH0011414; Tue, 20 Oct 2020 08:13:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200813.09K8DFH0011414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:13: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: r366875 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 366875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:13:16 -0000 Author: hselasky Date: Tue Oct 20 08:13:15 2020 New Revision: 366875 URL: https://svnweb.freebsd.org/changeset/base/366875 Log: MFC r365966: Add support for Winbond USB CDC modem device found in Tenma power supply. PR: 249384 Submitted by: darius@dons.net.au Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/serial/umodem.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/11/sys/dev/usb/serial/umodem.c Tue Oct 20 08:12:35 2020 (r366874) +++ stable/11/sys/dev/usb/serial/umodem.c Tue Oct 20 08:13:15 2020 (r366875) @@ -148,6 +148,8 @@ static const STRUCT_USB_HOST_ID umodem_host_devs[] = { {USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)}, {USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)}, {USB_VPI(USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_PC5740, 1)}, + /* Winbond */ + {USB_VENDOR(USB_VENDOR_WINBOND), USB_PRODUCT(USB_PRODUCT_WINBOND_CDC)}, }; /* Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Tue Oct 20 08:12:35 2020 (r366874) +++ stable/11/sys/dev/usb/usbdevs Tue Oct 20 08:13:15 2020 (r366875) @@ -4663,6 +4663,7 @@ product WIENERPLEINBAUS MPOD 0x0012 MPOD PSU product WIENERPLEINBAUS CML 0x0015 CML Data Logger /* Windbond Electronics */ +product WINBOND CDC 0x5011 CDC serial device product WINBOND UH104 0x5518 4-port USB Hub /* WinMaxGroup products */ From owner-svn-src-all@freebsd.org Tue Oct 20 08:14:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE0D7428F60; Tue, 20 Oct 2020 08:14:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmcG51hJz3yDH; Tue, 20 Oct 2020 08:14:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FF1B11EB1; Tue, 20 Oct 2020 08:14:06 +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 09K8E6nm011526; Tue, 20 Oct 2020 08:14:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8E6lI011525; Tue, 20 Oct 2020 08:14:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200814.09K8E6lI011525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366876 - stable/12/sys/dev/usb/serial X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/serial X-SVN-Commit-Revision: 366876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:14:06 -0000 Author: hselasky Date: Tue Oct 20 08:14:06 2020 New Revision: 366876 URL: https://svnweb.freebsd.org/changeset/base/366876 Log: MFC r366431: Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to the USB generic serial port driver, ugensa. Differential Revision: https://reviews.freebsd.org/D21863 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/serial/ugensa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/serial/ugensa.c ============================================================================== --- stable/12/sys/dev/usb/serial/ugensa.c Tue Oct 20 08:13:15 2020 (r366875) +++ stable/12/sys/dev/usb/serial/ugensa.c Tue Oct 20 08:14:06 2020 (r366876) @@ -160,6 +160,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)}, {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 0)}, {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 0)}, + {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), USB_DRIVER_INFO(10)}, }; DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); From owner-svn-src-all@freebsd.org Tue Oct 20 08:15:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAB064292AE; Tue, 20 Oct 2020 08:15:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmdX5PhQz3y1b; Tue, 20 Oct 2020 08:15:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CB8011FC0; Tue, 20 Oct 2020 08:15:12 +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 09K8FCOc011639; Tue, 20 Oct 2020 08:15:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8FC6n011638; Tue, 20 Oct 2020 08:15:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200815.09K8FC6n011638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r366877 - stable/11/sys/dev/usb/serial X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/serial X-SVN-Commit-Revision: 366877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:15:12 -0000 Author: hselasky Date: Tue Oct 20 08:15:12 2020 New Revision: 366877 URL: https://svnweb.freebsd.org/changeset/base/366877 Log: MFC r366431: Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to the USB generic serial port driver, ugensa. Differential Revision: https://reviews.freebsd.org/D21863 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/serial/ugensa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/ugensa.c ============================================================================== --- stable/11/sys/dev/usb/serial/ugensa.c Tue Oct 20 08:14:06 2020 (r366876) +++ stable/11/sys/dev/usb/serial/ugensa.c Tue Oct 20 08:15:12 2020 (r366877) @@ -158,6 +158,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)}, {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 0)}, {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 0)}, + {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), USB_DRIVER_INFO(10)}, }; DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); From owner-svn-src-all@freebsd.org Tue Oct 20 08:17:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4F5E4292B6; Tue, 20 Oct 2020 08:17:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmhX4pC6z3yJh; Tue, 20 Oct 2020 08:17:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8376311FC1; Tue, 20 Oct 2020 08:17:48 +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 09K8Hm4q011802; Tue, 20 Oct 2020 08:17:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8HlQi011799; Tue, 20 Oct 2020 08:17:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200817.09K8HlQi011799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366878 - in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 366878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:17:48 -0000 Author: hselasky Date: Tue Oct 20 08:17:47 2020 New Revision: 366878 URL: https://svnweb.freebsd.org/changeset/base/366878 Log: MFC r366432: Populate the acquire context field of a ww_mutex in the LinuxKPI. Bump the FreeBSD version to force recompilation of external kernel modules. Differential Revision: https://reviews.freebsd.org/D26657 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h stable/12/sys/compat/linuxkpi/common/src/linux_lock.c stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue Oct 20 08:15:12 2020 (r366877) +++ stable/12/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue Oct 20 08:17:47 2020 (r366878) @@ -76,7 +76,8 @@ ww_mutex_trylock(struct ww_mutex *lock) return (mutex_trylock(&lock->base)); } -extern int linux_ww_mutex_lock_sub(struct ww_mutex *, int catch_signal); +extern int linux_ww_mutex_lock_sub(struct ww_mutex *, + struct ww_acquire_ctx *, int catch_signal); static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) @@ -86,7 +87,7 @@ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 0)); + return (linux_ww_mutex_lock_sub(lock, ctx, 0)); } static inline int @@ -97,7 +98,7 @@ ww_mutex_lock_interruptible(struct ww_mutex *lock, str else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 1)); + return (linux_ww_mutex_lock_sub(lock, ctx, 1)); } extern void linux_ww_mutex_unlock_sub(struct ww_mutex *); Modified: stable/12/sys/compat/linuxkpi/common/src/linux_lock.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_lock.c Tue Oct 20 08:15:12 2020 (r366877) +++ stable/12/sys/compat/linuxkpi/common/src/linux_lock.c Tue Oct 20 08:17:47 2020 (r366878) @@ -71,7 +71,8 @@ linux_ww_unlock(void) /* lock a mutex with deadlock avoidance */ int -linux_ww_mutex_lock_sub(struct ww_mutex *lock, int catch_signal) +linux_ww_mutex_lock_sub(struct ww_mutex *lock, + struct ww_acquire_ctx *ctx, int catch_signal) { struct task_struct *task; struct ww_mutex_thread entry; @@ -126,6 +127,9 @@ done: if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == NULL) cv_signal(&lock->condvar); } + + if (retval == 0) + lock->ctx = ctx; linux_ww_unlock(); return (retval); } @@ -135,6 +139,7 @@ linux_ww_mutex_unlock_sub(struct ww_mutex *lock) { /* protect ww_mutex ownership change */ linux_ww_lock(); + lock->ctx = NULL; sx_xunlock(&lock->base.sx); /* wakeup a lock waiter, if any */ cv_signal(&lock->condvar); Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue Oct 20 08:15:12 2020 (r366877) +++ stable/12/sys/sys/param.h Tue Oct 20 08:17:47 2020 (r366878) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Oct 20 08:23:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE663429716; Tue, 20 Oct 2020 08:23:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmq14DFnz3yq6; Tue, 20 Oct 2020 08:23: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59CC012384; Tue, 20 Oct 2020 08:23:25 +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 09K8NPP2017496; Tue, 20 Oct 2020 08:23:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8NOcA017492; Tue, 20 Oct 2020 08:23:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200823.09K8NOcA017492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:23: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: r366879 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 366879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:23:25 -0000 Author: hselasky Date: Tue Oct 20 08:23:24 2020 New Revision: 366879 URL: https://svnweb.freebsd.org/changeset/base/366879 Log: MFC r347596 and r366432: Populate the acquire context field of a ww_mutex in the LinuxKPI. Bump the FreeBSD version to force recompilation of external kernel modules. Differential Revision: https://reviews.freebsd.org/D19565 Differential Revision: https://reviews.freebsd.org/D26657 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ww_mutex.h stable/11/sys/compat/linuxkpi/common/src/linux_lock.c stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ww_mutex.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue Oct 20 08:17:47 2020 (r366878) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue Oct 20 08:23:24 2020 (r366879) @@ -45,6 +45,7 @@ struct ww_acquire_ctx { struct ww_mutex { struct mutex base; struct cv condvar; + struct ww_acquire_ctx *ctx; }; #define DEFINE_WW_CLASS(name) \ @@ -75,7 +76,8 @@ ww_mutex_trylock(struct ww_mutex *lock) return (mutex_trylock(&lock->base)); } -extern int linux_ww_mutex_lock_sub(struct ww_mutex *, int catch_signal); +extern int linux_ww_mutex_lock_sub(struct ww_mutex *, + struct ww_acquire_ctx *, int catch_signal); static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) @@ -85,7 +87,7 @@ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 0)); + return (linux_ww_mutex_lock_sub(lock, ctx, 0)); } static inline int @@ -96,7 +98,7 @@ ww_mutex_lock_interruptible(struct ww_mutex *lock, str else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 1)); + return (linux_ww_mutex_lock_sub(lock, ctx, 1)); } extern void linux_ww_mutex_unlock_sub(struct ww_mutex *); Modified: stable/11/sys/compat/linuxkpi/common/src/linux_lock.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Tue Oct 20 08:17:47 2020 (r366878) +++ stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Tue Oct 20 08:23:24 2020 (r366879) @@ -71,7 +71,8 @@ linux_ww_unlock(void) /* lock a mutex with deadlock avoidance */ int -linux_ww_mutex_lock_sub(struct ww_mutex *lock, int catch_signal) +linux_ww_mutex_lock_sub(struct ww_mutex *lock, + struct ww_acquire_ctx *ctx, int catch_signal) { struct task_struct *task; struct ww_mutex_thread entry; @@ -126,6 +127,9 @@ done: if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == NULL) cv_signal(&lock->condvar); } + + if (retval == 0) + lock->ctx = ctx; linux_ww_unlock(); return (retval); } @@ -135,6 +139,7 @@ linux_ww_mutex_unlock_sub(struct ww_mutex *lock) { /* protect ww_mutex ownership change */ linux_ww_lock(); + lock->ctx = NULL; sx_xunlock(&lock->base.sx); /* wakeup a lock waiter, if any */ cv_signal(&lock->condvar); Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Oct 20 08:17:47 2020 (r366878) +++ stable/11/sys/sys/param.h Tue Oct 20 08:23:24 2020 (r366879) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Oct 20 08:25:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AD3742980E; Tue, 20 Oct 2020 08:25:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmrv3bkBz3yyq; Tue, 20 Oct 2020 08:25:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ED0E11FDF; Tue, 20 Oct 2020 08:25:03 +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 09K8P3DS017637; Tue, 20 Oct 2020 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8P32i017636; Tue, 20 Oct 2020 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200825.09K8P32i017636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366880 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 366880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:25:03 -0000 Author: hselasky Date: Tue Oct 20 08:25:02 2020 New Revision: 366880 URL: https://svnweb.freebsd.org/changeset/base/366880 Log: MFC r366518: Properly cleanup driver during remove_one() in mlx5core. Cleanup all host resources, SYSCTLs, MSIX vectors and memory used by the host and only leave the device allocated memory behind, if any, because it may still be in use, when the PCI remove function is called. Else future probe calls may fail due to SYSCTLs already existing. Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Oct 20 08:23:24 2020 (r366879) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Oct 20 08:25:02 2020 (r366880) @@ -1664,9 +1664,8 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; if (mlx5_unload_one(dev, priv, true)) { - mlx5_core_err(dev, "mlx5_unload_one failed\n"); - mlx5_health_cleanup(dev); - return; + mlx5_core_err(dev, "mlx5_unload_one() failed, leaked %lld bytes\n", + (long long)(dev->priv.fw_pages * MLX5_ADAPTER_PAGE_SIZE)); } mlx5_pagealloc_cleanup(dev); From owner-svn-src-all@freebsd.org Tue Oct 20 08:25:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69EAE429541; Tue, 20 Oct 2020 08:25:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmst2BCyz40CM; Tue, 20 Oct 2020 08:25:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F1101230B; Tue, 20 Oct 2020 08:25: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 09K8PsQc017728; Tue, 20 Oct 2020 08:25:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8Pssa017727; Tue, 20 Oct 2020 08:25:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200825.09K8Pssa017727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:25: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: r366881 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 366881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:25:54 -0000 Author: hselasky Date: Tue Oct 20 08:25:53 2020 New Revision: 366881 URL: https://svnweb.freebsd.org/changeset/base/366881 Log: MFC r366518: Properly cleanup driver during remove_one() in mlx5core. Cleanup all host resources, SYSCTLs, MSIX vectors and memory used by the host and only leave the device allocated memory behind, if any, because it may still be in use, when the PCI remove function is called. Else future probe calls may fail due to SYSCTLs already existing. Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Oct 20 08:25:02 2020 (r366880) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Oct 20 08:25:53 2020 (r366881) @@ -1646,9 +1646,8 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; if (mlx5_unload_one(dev, priv, true)) { - mlx5_core_err(dev, "mlx5_unload_one failed\n"); - mlx5_health_cleanup(dev); - return; + mlx5_core_err(dev, "mlx5_unload_one() failed, leaked %lld bytes\n", + (long long)(dev->priv.fw_pages * MLX5_ADAPTER_PAGE_SIZE)); } mlx5_pagealloc_cleanup(dev); From owner-svn-src-all@freebsd.org Tue Oct 20 08:29:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDD24429562; Tue, 20 Oct 2020 08:29:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmy050CLz40KN; Tue, 20 Oct 2020 08:29:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EA511238B; Tue, 20 Oct 2020 08:29:28 +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 09K8TSGJ017952; Tue, 20 Oct 2020 08:29:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8TScr017951; Tue, 20 Oct 2020 08:29:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200829.09K8TScr017951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366882 - stable/12/sys/dev/evdev X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/evdev X-SVN-Commit-Revision: 366882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:29:28 -0000 Author: hselasky Date: Tue Oct 20 08:29:28 2020 New Revision: 366882 URL: https://svnweb.freebsd.org/changeset/base/366882 Log: MFC r366533: Allow evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in /boot/loader.conf . Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/evdev/evdev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/evdev/evdev.c ============================================================================== --- stable/12/sys/dev/evdev/evdev.c Tue Oct 20 08:25:53 2020 (r366881) +++ stable/12/sys/dev/evdev/evdev.c Tue Oct 20 08:29:28 2020 (r366882) @@ -76,10 +76,10 @@ int evdev_sysmouse_t_axis = 0; SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); #ifdef EVDEV_SUPPORT -SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, +SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RWTUN, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); -SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, +SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RWTUN, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); #endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, From owner-svn-src-all@freebsd.org Tue Oct 20 08:30:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 747A5429995; Tue, 20 Oct 2020 08:30:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFmz72WBzz40T1; Tue, 20 Oct 2020 08:30:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3938711C6B; Tue, 20 Oct 2020 08:30:27 +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 09K8URjZ018088; Tue, 20 Oct 2020 08:30:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8URBu018087; Tue, 20 Oct 2020 08:30:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200830.09K8URBu018087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:30: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: r366883 - stable/11/sys/dev/evdev X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/evdev X-SVN-Commit-Revision: 366883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:30:27 -0000 Author: hselasky Date: Tue Oct 20 08:30:26 2020 New Revision: 366883 URL: https://svnweb.freebsd.org/changeset/base/366883 Log: MFC r366533: Allow evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in /boot/loader.conf . Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/evdev/evdev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/evdev/evdev.c ============================================================================== --- stable/11/sys/dev/evdev/evdev.c Tue Oct 20 08:29:28 2020 (r366882) +++ stable/11/sys/dev/evdev/evdev.c Tue Oct 20 08:30:26 2020 (r366883) @@ -69,10 +69,10 @@ int evdev_sysmouse_t_axis = 0; SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); #ifdef EVDEV_SUPPORT -SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, +SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RWTUN, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); -SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, +SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RWTUN, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); #endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, From owner-svn-src-all@freebsd.org Tue Oct 20 08:31:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9880E4297F6; Tue, 20 Oct 2020 08:31:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFn093c6nz40cc; Tue, 20 Oct 2020 08:31:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FD2712504; Tue, 20 Oct 2020 08:31:21 +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 09K8VLQQ019285; Tue, 20 Oct 2020 08:31:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8VLhV019284; Tue, 20 Oct 2020 08:31:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200831.09K8VLhV019284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366884 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 366884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:31:21 -0000 Author: hselasky Date: Tue Oct 20 08:31:20 2020 New Revision: 366884 URL: https://svnweb.freebsd.org/changeset/base/366884 Log: MFC r366535: The ethernet header structure is read-only. Add const keyword. (This is a diff reduction towards D26254) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/kern/uipc_mbufhash.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_mbufhash.c ============================================================================== --- stable/12/sys/kern/uipc_mbufhash.c Tue Oct 20 08:30:26 2020 (r366883) +++ stable/12/sys/kern/uipc_mbufhash.c Tue Oct 20 08:31:20 2020 (r366884) @@ -78,7 +78,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct struct ether_vlan_header vlan; uint32_t port; } buf; - struct ether_header *eh; + const struct ether_header *eh; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; From owner-svn-src-all@freebsd.org Tue Oct 20 08:31:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CABE74299AF; Tue, 20 Oct 2020 08:31:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFn0q51Dyz40bZ; Tue, 20 Oct 2020 08:31: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F6FB11E63; Tue, 20 Oct 2020 08:31:55 +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 09K8Vtuo022420; Tue, 20 Oct 2020 08:31:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8Vt6E022419; Tue, 20 Oct 2020 08:31:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200831.09K8Vt6E022419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:31: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: r366885 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 366885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:31:55 -0000 Author: hselasky Date: Tue Oct 20 08:31:55 2020 New Revision: 366885 URL: https://svnweb.freebsd.org/changeset/base/366885 Log: MFC r366535: The ethernet header structure is read-only. Add const keyword. (This is a diff reduction towards D26254) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/kern/uipc_mbufhash.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mbufhash.c ============================================================================== --- stable/11/sys/kern/uipc_mbufhash.c Tue Oct 20 08:31:20 2020 (r366884) +++ stable/11/sys/kern/uipc_mbufhash.c Tue Oct 20 08:31:55 2020 (r366885) @@ -78,7 +78,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct struct ether_vlan_header vlan; uint32_t port; } buf; - struct ether_header *eh; + const struct ether_header *eh; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; From owner-svn-src-all@freebsd.org Tue Oct 20 08:33:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7098429E87; Tue, 20 Oct 2020 08:33:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFn2J40hkz40yL; Tue, 20 Oct 2020 08:33:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DD29124A0; Tue, 20 Oct 2020 08:33:12 +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 09K8XCOI024526; Tue, 20 Oct 2020 08:33:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8XC7n024525; Tue, 20 Oct 2020 08:33:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200833.09K8XC7n024525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366886 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 366886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:33:12 -0000 Author: hselasky Date: Tue Oct 20 08:33:11 2020 New Revision: 366886 URL: https://svnweb.freebsd.org/changeset/base/366886 Log: MFC r366536: Try a bit harder to get the USB device descriptor in case the initial read fails. Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/dev/usb/usb_request.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_request.c ============================================================================== --- stable/12/sys/dev/usb/usb_request.c Tue Oct 20 08:31:55 2020 (r366885) +++ stable/12/sys/dev/usb/usb_request.c Tue Oct 20 08:33:11 2020 (r366886) @@ -1976,9 +1976,23 @@ usbd_setup_device_desc(struct usb_device *udev, struct /* get partial device descriptor, some devices crash on this */ err = usbd_req_get_desc(udev, mtx, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); - if (err != 0) - break; - + if (err != 0) { + DPRINTF("Trying fallback for getting the USB device descriptor\n"); + /* try 8 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 8; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 16 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 16; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 32/64 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 32; + } /* get the full device descriptor */ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); break; From owner-svn-src-all@freebsd.org Tue Oct 20 08:34:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB45B429F00; Tue, 20 Oct 2020 08:34:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFn3H5QMQz41Jv; Tue, 20 Oct 2020 08:34:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3641258F; Tue, 20 Oct 2020 08:34:03 +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 09K8Y3h0024623; Tue, 20 Oct 2020 08:34:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8Y3kA024622; Tue, 20 Oct 2020 08:34:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200834.09K8Y3kA024622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:34: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: r366887 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 366887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:34:03 -0000 Author: hselasky Date: Tue Oct 20 08:34:03 2020 New Revision: 366887 URL: https://svnweb.freebsd.org/changeset/base/366887 Log: MFC r366536: Try a bit harder to get the USB device descriptor in case the initial read fails. Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/dev/usb/usb_request.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_request.c ============================================================================== --- stable/11/sys/dev/usb/usb_request.c Tue Oct 20 08:33:11 2020 (r366886) +++ stable/11/sys/dev/usb/usb_request.c Tue Oct 20 08:34:03 2020 (r366887) @@ -1970,9 +1970,23 @@ usbd_setup_device_desc(struct usb_device *udev, struct /* get partial device descriptor, some devices crash on this */ err = usbd_req_get_desc(udev, mtx, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); - if (err != 0) - break; - + if (err != 0) { + DPRINTF("Trying fallback for getting the USB device descriptor\n"); + /* try 8 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 8; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 16 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 16; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 32/64 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 32; + } /* get the full device descriptor */ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); break; From owner-svn-src-all@freebsd.org Tue Oct 20 08:35:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9C61429EF3; Tue, 20 Oct 2020 08:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFn4h5WF1z41Hm; Tue, 20 Oct 2020 08:35: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A072611EDE; Tue, 20 Oct 2020 08:35: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 09K8ZGCE024742; Tue, 20 Oct 2020 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8ZG8D024741; Tue, 20 Oct 2020 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200835.09K8ZG8D024741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366888 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 366888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:35:16 -0000 Author: hselasky Date: Tue Oct 20 08:35:16 2020 New Revision: 366888 URL: https://svnweb.freebsd.org/changeset/base/366888 Log: MFC r366669: Implement more RCU list functions in the LinuxKPI. This also fixes a bug in the existing list_add_rcu() where the prev->prev pointer was updated to the new element instead of next->prev. Currently this function is not widely used. Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 20 08:34:03 2020 (r366887) +++ stable/12/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 20 08:35:16 2020 (r366888) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2015 François Tigeot - * Copyright (c) 2016-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2016-2020 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ container_of(READ_ONCE(ptr), type, member) #define list_next_rcu(head) (*((struct list_head **)(&(head)->next))) +#define list_prev_rcu(head) (*((struct list_head **)(&(head)->prev))) #define list_for_each_entry_rcu(pos, head, member) \ for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \ @@ -44,12 +45,44 @@ pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) static inline void -list_add_rcu(struct list_head *new, struct list_head *prev) +linux_list_add_rcu(struct list_head *new, struct list_head *prev, + struct list_head *next) { - new->next = prev->next; + new->next = next; new->prev = prev; rcu_assign_pointer(list_next_rcu(prev), new); - prev->prev = new; + next->prev = new; +} + +static inline void +list_add_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head, head->next); +} + +static inline void +list_add_tail_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head->prev, head); +} + +static inline void +__list_del_rcu(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), next); +} + +static inline void +__list_del_entry_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); +} + +static inline void +list_del_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); } #define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) From owner-svn-src-all@freebsd.org Tue Oct 20 08:40:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 454D742A197; Tue, 20 Oct 2020 08:40:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFnBw19xsz41QH; Tue, 20 Oct 2020 08:40: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07A4512591; Tue, 20 Oct 2020 08:40: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 09K8edvp025972; Tue, 20 Oct 2020 08:40:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K8edES025971; Tue, 20 Oct 2020 08:40:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010200840.09K8edES025971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 20 Oct 2020 08:40: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: r366889 - in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 366889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 08:40:40 -0000 Author: hselasky Date: Tue Oct 20 08:40:39 2020 New Revision: 366889 URL: https://svnweb.freebsd.org/changeset/base/366889 Log: MFC r349277 and r366669: Implement more RCU list functions in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D20719 Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rculist.h stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rculist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 20 08:35:16 2020 (r366888) +++ stable/11/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 20 08:40:39 2020 (r366889) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2015 François Tigeot - * Copyright (c) 2016-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2016-2020 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,6 +33,58 @@ #include #include +#define list_entry_rcu(ptr, type, member) \ + container_of(READ_ONCE(ptr), type, member) + +#define list_next_rcu(head) (*((struct list_head **)(&(head)->next))) +#define list_prev_rcu(head) (*((struct list_head **)(&(head)->prev))) + +#define list_for_each_entry_rcu(pos, head, member) \ + for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \ + &(pos)->member != (head); \ + pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) + +static inline void +linux_list_add_rcu(struct list_head *new, struct list_head *prev, + struct list_head *next) +{ + new->next = next; + new->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), new); + next->prev = new; +} + +static inline void +list_add_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head, head->next); +} + +static inline void +list_add_tail_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head->prev, head); +} + +static inline void +__list_del_rcu(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), next); +} + +static inline void +__list_del_entry_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); +} + +static inline void +list_del_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); +} + #define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) #define hlist_next_rcu(node) (*((struct hlist_node **)(&(node)->next))) #define hlist_pprev_rcu(node) (*((struct hlist_node **)((node)->pprev))) @@ -47,8 +99,12 @@ hlist_add_behind_rcu(struct hlist_node *n, struct hlis n->next->pprev = &n->next; } -#define hlist_for_each_entry_rcu(pos, head, member) \ - hlist_for_each_entry(pos, head, member) +#define hlist_for_each_entry_rcu(pos, head, member) \ + for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ + typeof(*(pos)), member); \ + (pos); \ + pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ + &(pos)->member)), typeof(*(pos)), member)) static inline void hlist_del_rcu(struct hlist_node *n) Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Oct 20 08:35:16 2020 (r366888) +++ stable/11/sys/sys/param.h Tue Oct 20 08:40:39 2020 (r366889) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104508 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104509 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Oct 20 09:46:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39FC042BA56; Tue, 20 Oct 2020 09:46:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFpfj0tF8z457J; Tue, 20 Oct 2020 09:46: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F181E132AB; Tue, 20 Oct 2020 09:46:20 +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 09K9kKl0067579; Tue, 20 Oct 2020 09:46:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K9kKxS067577; Tue, 20 Oct 2020 09:46:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010200946.09K9kKxS067577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Oct 2020 09:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366890 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 366890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 09:46:21 -0000 Author: mjg Date: Tue Oct 20 09:46:20 2020 New Revision: 366890 URL: https://svnweb.freebsd.org/changeset/base/366890 Log: ufs: catch up with removal of thread argument from VOP_INACTIVE Modified: head/sys/ufs/ufs/extattr.h head/sys/ufs/ufs/ufs_extattr.c head/sys/ufs/ufs/ufs_inode.c Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Tue Oct 20 08:40:39 2020 (r366889) +++ head/sys/ufs/ufs/extattr.h Tue Oct 20 09:46:20 2020 (r366890) @@ -140,7 +140,7 @@ int ufs_extattrctl(struct mount *mp, int cmd, struct v int ufs_getextattr(struct vop_getextattr_args *ap); int ufs_deleteextattr(struct vop_deleteextattr_args *ap); int ufs_setextattr(struct vop_setextattr_args *ap); -void ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td); +void ufs_extattr_vnode_inactive(struct vnode *vp); #endif /* !_KERNEL */ Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Tue Oct 20 08:40:39 2020 (r366889) +++ head/sys/ufs/ufs/ufs_extattr.c Tue Oct 20 09:46:20 2020 (r366890) @@ -1276,7 +1276,7 @@ vopunlock_exit: * attributes stripped. */ void -ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td) +ufs_extattr_vnode_inactive(struct vnode *vp) { struct ufs_extattr_list_entry *uele; struct mount *mp = vp->v_mount; @@ -1299,7 +1299,7 @@ ufs_extattr_vnode_inactive(struct vnode *vp, struct th LIST_FOREACH(uele, &ump->um_extattr.uepm_list, uele_entries) ufs_extattr_rm(vp, uele->uele_attrnamespace, - uele->uele_attrname, NULL, td); + uele->uele_attrname, NULL, curthread); ufs_extattr_uepm_unlock(ump); } Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Tue Oct 20 08:40:39 2020 (r366889) +++ head/sys/ufs/ufs/ufs_inode.c Tue Oct 20 09:46:20 2020 (r366890) @@ -106,7 +106,6 @@ int ufs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -173,7 +172,7 @@ ufs_inactive(ap) (void)chkiq(ip, -1, NOCRED, FORCE); #endif #ifdef UFS_EXTATTR - ufs_extattr_vnode_inactive(vp, ap->a_td); + ufs_extattr_vnode_inactive(vp); #endif /* * Setting the mode to zero needs to wait for the inode From owner-svn-src-all@freebsd.org Tue Oct 20 09:51:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D1BE42C012; Tue, 20 Oct 2020 09:51:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFpmt35dhz45WC; Tue, 20 Oct 2020 09:51:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D85C13318; Tue, 20 Oct 2020 09:51:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09K9pgUN068729; Tue, 20 Oct 2020 09:51:42 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09K9pgMi068728; Tue, 20 Oct 2020 09:51:42 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010200951.09K9pgMi068728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 20 Oct 2020 09:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366891 - stable/12/share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man3 X-SVN-Commit-Revision: 366891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 09:51:42 -0000 Author: gbe (doc committer) Date: Tue Oct 20 09:51:41 2020 New Revision: 366891 URL: https://svnweb.freebsd.org/changeset/base/366891 Log: MFC r366481: intro(3): Update the list of included libraries - Extend the list of main libraries of section 3 - Extend the library functions that are included in the libc Submitted by: Naga Chaitanya Vellanki Differential Revision: https://reviews.freebsd.org/D26476 Modified: stable/12/share/man/man3/intro.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man3/intro.3 ============================================================================== --- stable/12/share/man/man3/intro.3 Tue Oct 20 09:46:20 2020 (r366890) +++ stable/12/share/man/man3/intro.3 Tue Oct 20 09:51:41 2020 (r366891) @@ -28,12 +28,17 @@ .\" @(#)intro.3 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd October 6, 2020 .Dt INTRO 3 .Os .Sh NAME .Nm intro .Nd introduction to the C libraries +.Sh SYNOPSIS +.Nm cc +.Op Ar flags +.Ar +.Op Fl llibrary .Sh DESCRIPTION This section provides an overview of the C library functions, their error returns and other @@ -47,7 +52,11 @@ must be indicated at compile time with the option of the compiler. .Pp The various libraries (followed by the loader flag): -.Bl -tag -width "libc (-lc)" +.Bl -tag -width "libbluetooth (-lbluetooth)" +.It Em libbluetooth Pq Fl l Ns Ar bluetooth +The bluetooth library. +See +.Xr bluetooth 3 . .It Em libc Pq Fl l Ns Ar c Standard C library functions. When using the C compiler @@ -57,21 +66,58 @@ to supply the loader flag .Fl l Ns Ar c for these functions. There are several `libraries' or groups of functions included inside of -.Em libc -: the standard -.Tn I/O -routines, -database routines, -bit operators, -string operators, -character tests and character operators, -des encryption routines, -storage allocation, time functions, signal handling and more. +.Em libc : +.Bl -tag -width "XXXXXX" +.It standard I/O routines +see +.Xr stdio 3 +.It database routines +see +.Xr db 3 +.It bit operators +see +.Xr bitstring 3 +.It string operators +see +.Xr string 3 +.It character tests and character operators +.It storage allocation +see +.Xr mpool 3 +.It regular-expressions +see +.Xr regex 3 +.It remote procedure calls (RPC) +see +.Xr rpc 3 +.It time functions +see +.Xr time 3 +.It signal handling +see +.Xr signal 3 +.El +.It Em libcalendar Pq Fl l Ns Ar calendar +The calendar arithmetic library. +See +.Xr calendar 3 . +.It Em libcam Pq Fl l Ns Ar cam +The common access method user library. +See +.Xr cam 3 . +.It Em libcrypt Pq Fl l Ns Ar crypt +The crypt library. +See +.Xr crypt 3 . .It Em libcurses Pq Fl l Ns Ar curses Fl l Ns Ar termcap Terminal independent screen management routines for two dimensional non-bitmap display terminals. -(See -.Xr ncurses 3 . ) +See +.Xr ncurses 3 . +.It Em libcuse Pq Fl l Ns Ar cuse +The userland character device library. +See +.Xr cuse 3 . .It Em libcompat Pq Fl l Ns Ar compat Functions which are obsolete but are available for compatibility with .Bx 4.3 . @@ -82,32 +128,106 @@ have been included for source code compatibility. Use of these routines should, for the most part, be avoided. The manual page entry for each compatibility routine indicates the proper interface to use. +.It Em libdevinfo Pq Fl l Ns Ar devinfo +The Device and Resource Information Utility library. +See +.Xr devinfo 3 . +.It Em libdevstat Pq Fl l Ns Ar devstat +The Device Statistics library. +See +.Xr devstat 3 . +.It Em libdwarf Pq Fl l Ns Ar dwarf +The DWARF access library. +See +.Xr dwarf 3 . +.It Em libelf Pq Fl l Ns Ar elf +The ELF access library. +See +.Xr elf 3 . +.It Em libfetch Pq Fl l Ns Ar fetch +The file transfer library. +See +.Xr fetch 3 . +.It Em libfigpar Pq Fl l Ns Ar figpar +The configuration file parsing library. +See +.Xr figpar 3 . +.It Em libgpio Pq Fl l Ns Ar gpio +The general-purpose input output library (GPIO). +See +.Xr gpio 3 . +.It Em libgssapi Pq Fl l Ns Ar gssapi +The generic security service application programming +interface. +See +.Xr gssapi 3 . +.It Em libjail Pq Fl l Ns Ar jail +The jail library. +See +.Xr jail 3 . .It Em libkvm Pq Fl l Ns Ar kvm Functions used to access kernel memory are in this library. They can be used against both a running system and a crash dump. -(See -.Xr kvm 3 . ) +See +.Xr kvm 3 . .It Em libl Pq Fl l Ns Ar l The library for .Xr lex 1 . .It Em libm Pq Fl l Ns Ar m -The math library, -.Em libm . -The math library is loaded as needed by the Pascal compiler, -but not by the C compiler which requires the -.Fl l Ns Ar m -flag. -(See -.Xr math 3 . ) +The math library. +See +.Xr math 3 . +.It Em libmd Pq Fl l Ns Ar md +The message digest library. +See +.Xr md4 3 , +.Xr md5 3 , +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr ripemd 3 , +.Xr skein 3 . .It Em libmp Pq Fl l Ns Ar mp +.It Em libpam Pq Fl l Ns Ar pam +The pluggable authentication module library. +See +.Xr pam 3 . +.It Em libpcap Pq Fl l Ns Ar pcap +The packet capture library. +See +.Xr pcap 3 . +.It Em libpmc Pq Fl l Ns Ar pmc +The performance counters library. +See +.Xr pmc 3 . +.It Em libpthread Pq Fl l Ns Ar pthread +The POSIX threads library. +See +.Xr pthread 3 . +.It Em libsysdecode Pq Fl l Ns Ar sysdecode +The system argument decoding library. +See +.Xr sysdecode 3 . .It Em libtermcap Pq Fl l Ns Ar termcap The terminal independent operation library package. -(See -.Xr termcap 3 . ) +See +.Xr termcap 3 . +.It Em libusb Pq Fl l Ns Ar usb +The USB access library. +See +.Xr usb 3 . +.It Em libvgl Pq Fl l Ns Ar vgl +The video graphics library. +See +.Xr vgl 3 . .It Em liby Pq Fl l Ns Ar y The library for .Xr yacc 1 . +.It Em libz Pq Fl l Ns Ar z +The general-purpose data compression library. +See +.Xr zlib 3 . .El .Sh FILES .Bl -tag -width /usr/lib/libm_p.a -compact From owner-svn-src-all@freebsd.org Tue Oct 20 10:37:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B0F742D191; Tue, 20 Oct 2020 10:37:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFqnt5XBbz47fc; Tue, 20 Oct 2020 10:37:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09KAbNNt079774 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 20 Oct 2020 13:37:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09KAbNNt079774 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09KAbMss079773; Tue, 20 Oct 2020 13:37:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Oct 2020 13:37:22 +0300 From: Konstantin Belousov To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366865 - head/sys/dev/ahci Message-ID: <20201020103722.GG2643@kib.kiev.ua> References: <202010192232.09JMWavp053934@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010192232.09JMWavp053934@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CFqnt5XBbz47fc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 10:37:39 -0000 On Mon, Oct 19, 2020 at 10:32:36PM +0000, Ruslan Bukin wrote: > Author: br > Date: Mon Oct 19 22:32:36 2020 > New Revision: 366865 > URL: https://svnweb.freebsd.org/changeset/base/366865 > > Log: > Fix build: only set iommu buswide flag if IOMMU code is included. > > Sponsored by: Innovate DSbD > > Modified: > head/sys/dev/ahci/ahci_pci.c > > Modified: head/sys/dev/ahci/ahci_pci.c > ============================================================================== > --- head/sys/dev/ahci/ahci_pci.c Mon Oct 19 22:27:21 2020 (r366864) > +++ head/sys/dev/ahci/ahci_pci.c Mon Oct 19 22:32:36 2020 (r366865) > @@ -27,6 +27,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_iommu.h" > + > #include > #include > #include > @@ -499,6 +501,7 @@ ahci_pci_attach(device_t dev) > i++; > ctlr->quirks = ahci_ids[i].quirks; > > +#ifdef IOMMU > if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { > /* > * The controller issues DMA requests from PCI function 1, > @@ -507,6 +510,7 @@ ahci_pci_attach(device_t dev) > */ > bus_dma_iommu_set_buswide(dev); > } > +#endif > > /* Limit speed for my onboard JMicron external port. > * It is not eSATA really, limit to SATA 1 */ I would prefer that bus_dma_iommu_set_buswide() was available unconditionally, i.e. do to other arches what is done on x86. From owner-svn-src-all@freebsd.org Tue Oct 20 11:40:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3D5642E411; Tue, 20 Oct 2020 11:40:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFsBZ4MPJz4CpT; Tue, 20 Oct 2020 11:40:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 615651415C; Tue, 20 Oct 2020 11:40:38 +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 09KBecIc035124; Tue, 20 Oct 2020 11:40:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KBecie035123; Tue, 20 Oct 2020 11:40:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010201140.09KBecie035123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Oct 2020 11:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366892 - stable/12/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 366892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 11:40:38 -0000 Author: ae Date: Tue Oct 20 11:40:37 2020 New Revision: 366892 URL: https://svnweb.freebsd.org/changeset/base/366892 Log: MFC r366681: Add IPv4 fragments reassembling to NAT64LSN. NAT64LSN requires the presence of upper level protocol header in a IPv4 datagram to find corresponding state to make translation. Now it will be handled automatically by nat64lsn instance. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Tue Oct 20 09:51:41 2020 (r366891) +++ stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Tue Oct 20 11:40:37 2020 (r366892) @@ -548,6 +548,57 @@ nat64lsn_get_state4to6(struct nat64lsn_cfg *cfg, struc return (NULL); } +/* + * Reassemble IPv4 fragments, make PULLUP if needed, get some ULP fields + * that might be unknown until reassembling is completed. + */ +static struct mbuf* +nat64lsn_reassemble4(struct nat64lsn_cfg *cfg, struct mbuf *m, + uint16_t *port) +{ + struct ip *ip; + int len; + + m = ip_reass(m); + if (m == NULL) + return (NULL); + /* IP header must be contigious after ip_reass() */ + ip = mtod(m, struct ip *); + len = ip->ip_hl << 2; + switch (ip->ip_p) { + case IPPROTO_ICMP: + len += ICMP_MINLEN; /* Enough to get icmp_id */ + break; + case IPPROTO_TCP: + len += sizeof(struct tcphdr); + break; + case IPPROTO_UDP: + len += sizeof(struct udphdr); + break; + default: + m_freem(m); + NAT64STAT_INC(&cfg->base.stats, noproto); + return (NULL); + } + if (m->m_len < len) { + m = m_pullup(m, len); + if (m == NULL) { + NAT64STAT_INC(&cfg->base.stats, nomem); + return (NULL); + } + ip = mtod(m, struct ip *); + } + switch (ip->ip_p) { + case IPPROTO_TCP: + *port = ntohs(L3HDR(ip, struct tcphdr *)->th_dport); + break; + case IPPROTO_UDP: + *port = ntohs(L3HDR(ip, struct udphdr *)->uh_dport); + break; + } + return (m); +} + static int nat64lsn_translate4(struct nat64lsn_cfg *cfg, const struct ipfw_flow_id *f_id, struct mbuf **mp) @@ -567,6 +618,14 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, if (addr < cfg->prefix4 || addr > cfg->pmask4) { NAT64STAT_INC(&cfg->base.stats, nomatch4); return (cfg->nomatch_verdict); + } + + /* Reassemble fragments if needed */ + ret = ntohs(mtod(*mp, struct ip *)->ip_off); + if ((ret & (IP_MF | IP_OFFMASK)) != 0) { + *mp = nat64lsn_reassemble4(cfg, *mp, &port); + if (*mp == NULL) + return (IP_FW_DENY); } /* Check if protocol is supported */ From owner-svn-src-all@freebsd.org Tue Oct 20 11:44:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4B8142E4CB; Tue, 20 Oct 2020 11:44:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFsHV5Llfz4D8K; Tue, 20 Oct 2020 11:44:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AEFB14764; Tue, 20 Oct 2020 11:44:54 +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 09KBisWn041040; Tue, 20 Oct 2020 11:44:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KBis9j041039; Tue, 20 Oct 2020 11:44:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010201144.09KBis9j041039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Oct 2020 11:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366893 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 366893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 11:44:54 -0000 Author: ae Date: Tue Oct 20 11:44:54 2020 New Revision: 366893 URL: https://svnweb.freebsd.org/changeset/base/366893 Log: MFC r366682: Join to AllHosts multicast group again when adding an existing IPv4 address. When SIOCAIFADDR ioctl configures an IPv4 address that is already exist, it removes old ifaddr. When this IPv4 address is only one configured on the interface, this also leads to leaving from AllHosts multicast group. Then an address is added again, but due to the bug, this doesn't lead to joining to AllHosts multicast group. Submitted by: yannis.planus_alstomgroup.com Modified: stable/12/sys/netinet/in.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in.c ============================================================================== --- stable/12/sys/netinet/in.c Tue Oct 20 11:40:37 2020 (r366892) +++ stable/12/sys/netinet/in.c Tue Oct 20 11:44:54 2020 (r366893) @@ -379,10 +379,11 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne continue; it = (struct in_ifaddr *)ifa; - iaIsFirst = false; if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) ia = it; + else + iaIsFirst = false; } IF_ADDR_RUNLOCK(ifp); From owner-svn-src-all@freebsd.org Tue Oct 20 11:49:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60DD242E737; Tue, 20 Oct 2020 11:49:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFsNc1rq2z4DCT; Tue, 20 Oct 2020 11:49:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22D4614765; Tue, 20 Oct 2020 11:49:20 +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 09KBnJhv041374; Tue, 20 Oct 2020 11:49:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KBnJiP041373; Tue, 20 Oct 2020 11:49:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010201149.09KBnJiP041373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Oct 2020 11:49: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: r366894 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 366894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 11:49:20 -0000 Author: ae Date: Tue Oct 20 11:49:19 2020 New Revision: 366894 URL: https://svnweb.freebsd.org/changeset/base/366894 Log: MFC 366682: Join to AllHosts multicast group again when adding an existing IPv4 address. When SIOCAIFADDR ioctl configures an IPv4 address that is already exist, it removes old ifaddr. When this IPv4 address is only one configured on the interface, this also leads to leaving from AllHosts multicast group. Then an address is added again, but due to the bug, this doesn't lead to joining to AllHosts multicast group. Submitted by: yannis.planus_alstomgroup.com Modified: stable/11/sys/netinet/in.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in.c ============================================================================== --- stable/11/sys/netinet/in.c Tue Oct 20 11:44:54 2020 (r366893) +++ stable/11/sys/netinet/in.c Tue Oct 20 11:49:19 2020 (r366894) @@ -382,10 +382,11 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne continue; it = (struct in_ifaddr *)ifa; - iaIsFirst = false; if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) ia = it; + else + iaIsFirst = false; } IF_ADDR_RUNLOCK(ifp); From owner-svn-src-all@freebsd.org Tue Oct 20 13:05:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6875430DED; Tue, 20 Oct 2020 13:05:25 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFv4P4PT5z4JKN; Tue, 20 Oct 2020 13:05:25 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A3A3157AA; Tue, 20 Oct 2020 13:05:25 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KD5PgP090306; Tue, 20 Oct 2020 13:05:25 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KD5PH6090305; Tue, 20 Oct 2020 13:05:25 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010201305.09KD5PH6090305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 20 Oct 2020 13:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366895 - head/usr.bin/compress X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/compress X-SVN-Commit-Revision: 366895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 13:05:25 -0000 Author: fernape (ports committer) Date: Tue Oct 20 13:05:25 2020 New Revision: 366895 URL: https://svnweb.freebsd.org/changeset/base/366895 Log: compress(1): Add EXAMPLES section Add 5 examples showing basic usage. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26865 Modified: head/usr.bin/compress/compress.1 Modified: head/usr.bin/compress/compress.1 ============================================================================== --- head/usr.bin/compress/compress.1 Tue Oct 20 11:49:19 2020 (r366894) +++ head/usr.bin/compress/compress.1 Tue Oct 20 13:05:25 2020 (r366895) @@ -32,7 +32,7 @@ .\" @(#)compress.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 17, 2002 +.Dd October 20, 2020 .Dt COMPRESS 1 .Os .Sh NAME @@ -186,6 +186,40 @@ utility exits 2 if attempting to compress a file would and the .Fl f option was not specified and if no other error occurs. +.Sh EXAMPLES +Create a file +.Pa test_file +with a single line of text: +.Bd -literal -offset indent +echo "This is a test" > test_file +.Ed +.Pp +Try to reduce the size of the file using a 10-bit code and show the exit status: +.Bd -literal -offset indent +$ compress -b 10 test_file +$ echo $? +2 +.Ed +.Pp +Try to compress the file and show compression percentage: +.Bd -literal -offset indent +$ compress -v test_file +test_file: file would grow; left unmodified +.Ed +.Pp +Same as above but forcing compression: +.Bd -literal -offset indent +$ compress -f -v test_file +test_file.Z: 79% expansion +.Ed +.Pp +Compress and uncompress the string +.Ql hello +on the fly: +.Bd -literal -offset indent +$ echo "hello" | compress | uncompress +hello +.Ed .Sh SEE ALSO .Xr gunzip 1 , .Xr gzexe 1 , From owner-svn-src-all@freebsd.org Tue Oct 20 13:15:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E027A431142; Tue, 20 Oct 2020 13:15:26 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFvHy5h81z4Jyx; Tue, 20 Oct 2020 13:15:26 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A768E1589D; Tue, 20 Oct 2020 13:15:26 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KDFQpj096503; Tue, 20 Oct 2020 13:15:26 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KDFQkL096502; Tue, 20 Oct 2020 13:15:26 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010201315.09KDFQkL096502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 20 Oct 2020 13:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366896 - head/bin/realpath X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/realpath X-SVN-Commit-Revision: 366896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 13:15:26 -0000 Author: fernape (ports committer) Date: Tue Oct 20 13:15:26 2020 New Revision: 366896 URL: https://svnweb.freebsd.org/changeset/base/366896 Log: realpath(1): Add EXAMPLES section. Add a small example for this simple command. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26863 Modified: head/bin/realpath/realpath.1 Modified: head/bin/realpath/realpath.1 ============================================================================== --- head/bin/realpath/realpath.1 Tue Oct 20 13:05:25 2020 (r366895) +++ head/bin/realpath/realpath.1 Tue Oct 20 13:15:26 2020 (r366896) @@ -69,6 +69,14 @@ is specified, warnings will not be printed when fails. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show the physical path of the +.Pa /dev/log +directory silencing warnings if any: +.Bd -literal -offset indent +$ realpath -q /dev/log +/var/run/log +.Ed .Sh SEE ALSO .Xr realpath 3 .Sh HISTORY From owner-svn-src-all@freebsd.org Tue Oct 20 16:48:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA841435D2B; Tue, 20 Oct 2020 16:48:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG0264YZnz4W88; Tue, 20 Oct 2020 16:48:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80CBC17FBB; Tue, 20 Oct 2020 16:48:46 +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 09KGmktL026238; Tue, 20 Oct 2020 16:48:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KGmjpo026236; Tue, 20 Oct 2020 16:48:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010201648.09KGmjpo026236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 20 Oct 2020 16:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366897 - in head/sys: conf dev/md X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: conf dev/md X-SVN-Commit-Revision: 366897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 16:48:46 -0000 Author: jhb Date: Tue Oct 20 16:48:45 2020 New Revision: 366897 URL: https://svnweb.freebsd.org/changeset/base/366897 Log: Use a template assembly file to generate the embedded MFS. This uses the .incbin directive to pull in the MFS image contents. Using assembly directly ensures that symbols can be defined with the name and properties (such as .size) desired without having to rename symbols, etc. via a second objcopy invocation. Since it is compiled by the C compiler driver, it also avoids the need for all of the EMBEDFS* make variables. Suggested by: jrtc27 Reviewed by: kib, markj Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26781 Added: head/sys/dev/md/embedfs.S (contents, props changed) Modified: head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Oct 20 13:15:26 2020 (r366896) +++ head/sys/conf/kern.post.mk Tue Oct 20 16:48:45 2020 (r366897) @@ -457,24 +457,9 @@ vnode_if_typedef.h: .if ${MFS_IMAGE:Uno} != "no" .if empty(MD_ROOT_SIZE_CONFIGURED) -# Generate an object file from the file system image to embed in the kernel -# via linking. Make sure the contents are in the mfs section and rename the -# start/end/size variables to __start_mfs, __stop_mfs, and mfs_size, -# respectively. -embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} - ${OBJCOPY} --input-target binary \ - --output-target ${EMBEDFS_FORMAT.${MACHINE_ARCH}} \ - --binary-architecture ${EMBEDFS_ARCH.${MACHINE_ARCH}} \ - ${MFS_IMAGE} ${.TARGET} - ${OBJCOPY} \ - --rename-section .data=mfs,contents,alloc,load,readonly,data \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_size=__mfs_root_size \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_start=mfs_root \ - --redefine-sym \ - _binary_${MFS_IMAGE:C,[^[:alnum:]],_,g}_end=mfs_root_end \ - ${.TARGET} +embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} $S/dev/md/embedfs.S + ${CC} ${CFLAGS} ${ACFLAGS} -DMFS_IMAGE="${MFS_IMAGE}" -c \ + $S/dev/md/embedfs.S -o ${.TARGET} .endif .endif Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Oct 20 13:15:26 2020 (r366896) +++ head/sys/conf/kern.pre.mk Tue Oct 20 16:48:45 2020 (r366897) @@ -358,37 +358,6 @@ MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" MKMODULESENV+= __MPATH="${__MPATH}" .endif -# Architecture and output format arguments for objcopy to convert image to -# object file - -.if ${MFS_IMAGE:Uno} != "no" -.if empty(MD_ROOT_SIZE_CONFIGURED) -.if !defined(EMBEDFS_FORMAT.${MACHINE_ARCH}) -EMBEDFS_FORMAT.${MACHINE_ARCH}!= awk -F'"' '/OUTPUT_FORMAT/ {print $$2}' ${LDSCRIPT} -.if empty(EMBEDFS_FORMAT.${MACHINE_ARCH}) -.undef EMBEDFS_FORMAT.${MACHINE_ARCH} -.endif -.endif - -.if !defined(EMBEDFS_ARCH.${MACHINE_ARCH}) -EMBEDFS_ARCH.${MACHINE_ARCH}!= sed -n '/OUTPUT_ARCH/s/.*(\(.*\)).*/\1/p' ${LDSCRIPT} -.if empty(EMBEDFS_ARCH.${MACHINE_ARCH}) -.undef EMBEDFS_ARCH.${MACHINE_ARCH} -.endif -.endif - -EMBEDFS_FORMAT.arm?= elf32-littlearm -EMBEDFS_FORMAT.armv6?= elf32-littlearm -EMBEDFS_FORMAT.armv7?= elf32-littlearm -EMBEDFS_FORMAT.aarch64?= elf64-littleaarch64 -EMBEDFS_FORMAT.mips?= elf32-tradbigmips -EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips -EMBEDFS_FORMAT.mips64?= elf64-tradbigmips -EMBEDFS_FORMAT.mips64el?= elf64-tradlittlemips -EMBEDFS_FORMAT.riscv64?= elf64-littleriscv -.endif -.endif - # Detect kernel config options that force stack frames to be turned on. DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo Added: head/sys/dev/md/embedfs.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/md/embedfs.S Tue Oct 20 16:48:45 2020 (r366897) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 John Baldwin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + + .section mfs, "a", %progbits + .globl mfs_root + .type mfs_root, %object +mfs_root: + .incbin __XSTRING(MFS_IMAGE) + .size mfs_root, . - mfs_root + .globl mfs_root_end + .type mfs_root_end, %object +mfs_root_end: + .size mfs_root_end, . - mfs_root_end From owner-svn-src-all@freebsd.org Tue Oct 20 17:00:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35108435EC0; Tue, 20 Oct 2020 17:00:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG0Hw0d4wz4WYk; Tue, 20 Oct 2020 17:00:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDE9D17F52; Tue, 20 Oct 2020 17:00: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 09KH0hqS032665; Tue, 20 Oct 2020 17:00:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KH0huo032663; Tue, 20 Oct 2020 17:00:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010201700.09KH0huo032663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 20 Oct 2020 17:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366898 - in head: secure/lib/libcrypto secure/lib/libcrypto/aarch64 secure/lib/libcrypto/amd64 secure/lib/libcrypto/arm secure/lib/libcrypto/engines/padlock secure/lib/libcrypto/i386 s... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: secure/lib/libcrypto secure/lib/libcrypto/aarch64 secure/lib/libcrypto/amd64 secure/lib/libcrypto/arm secure/lib/libcrypto/engines/padlock secure/lib/libcrypto/i386 sys/crypto/openssl sys/cry... X-SVN-Commit-Revision: 366898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 17:00:44 -0000 Author: jhb Date: Tue Oct 20 17:00:43 2020 New Revision: 366898 URL: https://svnweb.freebsd.org/changeset/base/366898 Log: Move generated OpenSSL assembly routines into the kernel sources. Sponsored by: Netflix Added: head/sys/crypto/openssl/ head/sys/crypto/openssl/aarch64/ - copied from r366897, head/secure/lib/libcrypto/aarch64/ head/sys/crypto/openssl/amd64/ - copied from r366897, head/secure/lib/libcrypto/amd64/ head/sys/crypto/openssl/arm/ - copied from r366897, head/secure/lib/libcrypto/arm/ head/sys/crypto/openssl/i386/ - copied from r366897, head/secure/lib/libcrypto/i386/ Deleted: head/secure/lib/libcrypto/aarch64/ head/secure/lib/libcrypto/amd64/ head/secure/lib/libcrypto/arm/ head/secure/lib/libcrypto/i386/ Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/engines/padlock/Makefile Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Tue Oct 20 16:48:45 2020 (r366897) +++ head/secure/lib/libcrypto/Makefile Tue Oct 20 17:00:43 2020 (r366898) @@ -459,7 +459,7 @@ opensslconf.h: opensslconf.h.in PICFLAG+= -DOPENSSL_PIC .if defined(ASM_${MACHINE_CPUARCH}) -.PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} .if defined(ASM_amd64) .PATH: ${LCRYPTO_SRC}/crypto/bn/asm .endif Modified: head/secure/lib/libcrypto/engines/padlock/Makefile ============================================================================== --- head/secure/lib/libcrypto/engines/padlock/Makefile Tue Oct 20 16:48:45 2020 (r366897) +++ head/secure/lib/libcrypto/engines/padlock/Makefile Tue Oct 20 17:00:43 2020 (r366898) @@ -11,4 +11,4 @@ SRCS+= e_padlock-x86.S .include -.PATH: ${.CURDIR:H:H}/${MACHINE_CPUARCH} +.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} From owner-svn-src-all@freebsd.org Tue Oct 20 17:19:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8200E435F7E; Tue, 20 Oct 2020 17:19:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG0jC2sWSz4XNF; Tue, 20 Oct 2020 17:19:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4135C18788; Tue, 20 Oct 2020 17:19:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KHJBbh044985; Tue, 20 Oct 2020 17:19:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KHJA4L044981; Tue, 20 Oct 2020 17:19:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010201719.09KHJA4L044981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 20 Oct 2020 17:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366899 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 17:19:11 -0000 Author: trasz Date: Tue Oct 20 17:19:10 2020 New Revision: 366899 URL: https://svnweb.freebsd.org/changeset/base/366899 Log: Fix potential race condition in linux stat(2). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25618 Modified: head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_util.c head/sys/compat/linux/linux_util.h Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Tue Oct 20 17:00:43 2020 (r366898) +++ head/sys/compat/linux/linux_stats.c Tue Oct 20 17:19:10 2020 (r366899) @@ -80,11 +80,8 @@ translate_vnhook_major_minor(struct vnode *vp, struct if (rootdevmp != NULL && vp->v_mount->mnt_vfc == rootdevmp->mnt_vfc) sb->st_dev = rootdevmp->mnt_stat.f_fsid.val[0]; - if (vp->v_type == VCHR && vp->v_rdev != NULL && - linux_driver_get_major_minor(devtoname(vp->v_rdev), - &major, &minor) == 0) { + if (linux_vn_get_major_minor(vp, &major, &minor) == 0) sb->st_rdev = (major << 8 | minor); - } } static int @@ -140,9 +137,7 @@ translate_fd_major_minor(struct thread *td, int fd, st if (mp != NULL && mp->mnt_vfc == rootdevmp->mnt_vfc) buf->st_dev = rootdevmp->mnt_stat.f_fsid.val[0]; } - if (vp != NULL && vp->v_rdev != NULL && - linux_driver_get_major_minor(devtoname(vp->v_rdev), - &major, &minor) == 0) { + if (linux_vn_get_major_minor(vp, &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { struct tty *tp = fp->f_data; Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Tue Oct 20 17:00:43 2020 (r366898) +++ head/sys/compat/linux/linux_util.c Tue Oct 20 17:19:10 2020 (r366899) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -193,6 +194,24 @@ linux_driver_get_major_minor(const char *node, int *ma } return (1); +} + +int +linux_vn_get_major_minor(const struct vnode *vp, int *major, int *minor) +{ + int error; + + if (vp->v_type != VCHR) + return (ENOTBLK); + dev_lock(); + if (vp->v_rdev == NULL) { + dev_unlock(); + return (ENXIO); + } + error = linux_driver_get_major_minor(devtoname(vp->v_rdev), + major, minor); + dev_unlock(); + return (error); } char * Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Tue Oct 20 17:00:43 2020 (r366898) +++ head/sys/compat/linux/linux_util.h Tue Oct 20 17:19:10 2020 (r366899) @@ -123,6 +123,7 @@ int linux_device_register_handler(struct linux_device_ int linux_device_unregister_handler(struct linux_device_handler *h); char *linux_driver_get_name_dev(device_t dev); int linux_driver_get_major_minor(const char *node, int *major, int *minor); +int linux_vn_get_major_minor(const struct vnode *vn, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); From owner-svn-src-all@freebsd.org Tue Oct 20 17:24:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C56674368D4; Tue, 20 Oct 2020 17:24:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG0qL48ZXz4Xbg; Tue, 20 Oct 2020 17:24:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DF13185CD; Tue, 20 Oct 2020 17:24:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KHOUL0050726; Tue, 20 Oct 2020 17:24:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KHOUQV050725; Tue, 20 Oct 2020 17:24:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010201724.09KHOUQV050725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 20 Oct 2020 17:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366900 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 366900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 17:24:30 -0000 Author: trasz Date: Tue Oct 20 17:24:29 2020 New Revision: 366900 URL: https://svnweb.freebsd.org/changeset/base/366900 Log: Fix linprocfs(4) /proc/self/mem semantics to more closely match Linux. Steam's Anti-Cheat might depend on it. PR: 248223 Analyzed by: Alex S Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26816 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Oct 20 17:19:10 2020 (r366899) +++ head/sys/compat/linprocfs/linprocfs.c Tue Oct 20 17:24:29 2020 (r366900) @@ -1276,6 +1276,27 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } /* + * Filler function for proc/pid/mem + */ +static int +linprocfs_doprocmem(PFS_FILL_ARGS) +{ + ssize_t resid; + int error; + + resid = uio->uio_resid; + error = procfs_doprocmem(PFS_FILL_ARGNAMES); + + if (uio->uio_rw == UIO_READ && resid != uio->uio_resid) + return (0); + + if (error == EFAULT) + error = EIO; + + return (error); +} + +/* * Criteria for interface name translation */ #define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) @@ -1853,7 +1874,7 @@ linprocfs_init(PFS_INIT_ARGS) NULL, &procfs_notsystem, NULL, 0); pfs_create_file(dir, "maps", &linprocfs_doprocmaps, NULL, NULL, NULL, PFS_RD); - pfs_create_file(dir, "mem", &procfs_doprocmem, + pfs_create_file(dir, "mem", &linprocfs_doprocmem, procfs_attr_rw, &procfs_candebug, NULL, PFS_RDWR | PFS_RAW); pfs_create_file(dir, "mounts", &linprocfs_domtab, NULL, NULL, NULL, PFS_RD); From owner-svn-src-all@freebsd.org Tue Oct 20 17:50:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3089F4370A8; Tue, 20 Oct 2020 17:50:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG1P90pzMz4Z10; Tue, 20 Oct 2020 17:50: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F320918AA5; Tue, 20 Oct 2020 17:50:20 +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 09KHoKru063805; Tue, 20 Oct 2020 17:50:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KHoIS9063793; Tue, 20 Oct 2020 17:50:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010201750.09KHoIS9063793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 20 Oct 2020 17:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366901 - in head: share/man/man4 sys/amd64/conf sys/conf sys/crypto/openssl sys/i386/conf sys/modules sys/modules/ossl X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/crypto/openssl sys/i386/conf sys/modules sys/modules/ossl X-SVN-Commit-Revision: 366901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 17:50:21 -0000 Author: jhb Date: Tue Oct 20 17:50:18 2020 New Revision: 366901 URL: https://svnweb.freebsd.org/changeset/base/366901 Log: Add a kernel crypto driver using assembly routines from OpenSSL. Currently, this supports SHA1 and SHA2-{224,256,384,512} both as plain hashes and in HMAC mode on both amd64 and i386. It uses the SHA intrinsics when present similar to aesni(4), but uses SSE/AVX instructions when they are not. Note that some files from OpenSSL that normally wrap the assembly routines have been adapted to export methods usable by 'struct auth_xform' as is used by existing software crypto routines. Reviewed by: gallatin, jkim, delphij, gnn Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26821 Added: head/share/man/man4/ossl.4 (contents, props changed) head/sys/crypto/openssl/ossl.c (contents, props changed) head/sys/crypto/openssl/ossl.h (contents, props changed) head/sys/crypto/openssl/ossl_hash.h (contents, props changed) - copied, changed from r366898, head/crypto/openssl/include/crypto/md32_common.h head/sys/crypto/openssl/ossl_sha.h - copied, changed from r366898, head/crypto/openssl/include/openssl/sha.h head/sys/crypto/openssl/ossl_sha1.c (contents, props changed) - copied, changed from r366898, head/crypto/openssl/crypto/sha/sha_local.h head/sys/crypto/openssl/ossl_sha256.c (contents, props changed) - copied, changed from r366898, head/crypto/openssl/crypto/sha/sha256.c head/sys/crypto/openssl/ossl_sha512.c (contents, props changed) - copied, changed from r366898, head/crypto/openssl/crypto/sha/sha512.c head/sys/modules/ossl/ head/sys/modules/ossl/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.x86 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Oct 20 17:24:29 2020 (r366900) +++ head/share/man/man4/Makefile Tue Oct 20 17:50:18 2020 (r366901) @@ -398,6 +398,7 @@ MAN= aac.4 \ ocs_fc.4\ ohci.4 \ orm.4 \ + ${_ossl.4} \ ow.4 \ ow_temp.4 \ owc.4 \ @@ -819,6 +820,7 @@ _ntb_transport.4=ntb_transport.4 _nvd.4= nvd.4 _nvme.4= nvme.4 _nvram.4= nvram.4 +_ossl.4= ossl.4 _padlock.4= padlock.4 _pchtherm.4= pchtherm.4 _rr232x.4= rr232x.4 Added: head/share/man/man4/ossl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ossl.4 Tue Oct 20 17:50:18 2020 (r366901) @@ -0,0 +1,105 @@ +.\" Copyright (c) 2020 Netflix, Inc +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +.\" redistribution must be conditioned upon including a substantially +.\" similar Disclaimer requirement for further binary redistribution. +.\" +.\" NO WARRANTY +.\" 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 NONINFRINGEMENT, MERCHANTIBILITY +.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" $FreeBSD$ +.\" +.Dd October 19, 2020 +.Dt OSSL 4 +.Os +.Sh NAME +.Nm ossl +.Nd "driver using OpenSSL assembly routines on x86 CPUs" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device crypto" +.Cd "device cryptodev" +.Cd "device ossl" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ossl_load="YES" +.Ed +.Sh DESCRIPTION +The OpenSSL distribution includes architecture-specific +implementations for some commonly used cryptographic algorithms. +This driver adds a wrapper around these routines permitting them to be +used by in-kernel cryptography consumers such as kernel TLS and IPsec. +.Pp +The +.Nm +driver includes architecture-specific implementations for the following +architectures: +.Pp +.Bl -bullet -compact +.It +amd64 +.It +i386 +.El +.Pp +The +.Nm +driver includes support for the following algorithms: +.Pp +.Bl -bullet -compact +.It +SHA1 +.It +SHA1-HMAC +.It +SHA2-224 +.It +SHA2-224-HMAC +.It +SHA2-256 +.It +SHA2-256-HMAC +.It +SHA2-384 +.It +SHA2-384-HMAC +.It +SHA2-512 +.It +SHA2-512-HMAC +.El +.Sh SEE ALSO +.Xr crypto 4 , +.Xr intro 4 , +.Xr ipsec 4 , +.Xr crypto 7 , +.Xr crypto 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Oct 20 17:24:29 2020 (r366900) +++ head/sys/amd64/conf/NOTES Tue Oct 20 17:50:18 2020 (r366901) @@ -533,6 +533,7 @@ device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device aesni # AES-NI OpenCrypto module +device ossl # OpenSSL OpenCrypto module device ioat # Intel I/OAT DMA engine # Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Oct 20 17:24:29 2020 (r366900) +++ head/sys/conf/files.amd64 Tue Oct 20 17:50:18 2020 (r366901) @@ -137,6 +137,9 @@ cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace c cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni crypto/des/des_enc.c optional netsmb +crypto/openssl/amd64/sha1-x86_64.S optional ossl +crypto/openssl/amd64/sha256-x86_64.S optional ossl +crypto/openssl/amd64/sha512-x86_64.S optional ossl dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Oct 20 17:24:29 2020 (r366900) +++ head/sys/conf/files.i386 Tue Oct 20 17:50:18 2020 (r366901) @@ -77,6 +77,9 @@ compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional netsmb +crypto/openssl/i386/sha1-586.S optional ossl +crypto/openssl/i386/sha256-586.S optional ossl +crypto/openssl/i386/sha512-586.S optional ossl dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_amd64.c optional agp Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Tue Oct 20 17:24:29 2020 (r366900) +++ head/sys/conf/files.x86 Tue Oct 20 17:50:18 2020 (r366901) @@ -53,6 +53,10 @@ intel_sha256.o optional aesni \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -msse4 -msha ${.IMPSRC}" \ no-implicit-rule \ clean "intel_sha256.o" +crypto/openssl/ossl.c optional ossl +crypto/openssl/ossl_sha1.c optional ossl +crypto/openssl/ossl_sha256.c optional ossl +crypto/openssl/ossl_sha512.c optional ossl crypto/via/padlock.c optional padlock crypto/via/padlock_cipher.c optional padlock crypto/via/padlock_hash.c optional padlock Added: head/sys/crypto/openssl/ossl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/openssl/ossl.c Tue Oct 20 17:50:18 2020 (r366901) @@ -0,0 +1,369 @@ +/* + * Copyright (c) 2020 Netflix, Inc + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +/* + * A driver for the OpenCrypto framework which uses assembly routines + * from OpenSSL. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "cryptodev_if.h" + +struct ossl_softc { + int32_t sc_cid; +}; + +struct ossl_session_hash { + struct ossl_hash_context ictx; + struct ossl_hash_context octx; + struct auth_hash *axf; + u_int mlen; +}; + +struct ossl_session { + struct ossl_session_hash hash; +}; + +/* + * See OPENSSL_ia32cap(3). + * + * [0] = cpu_feature but with a few custom bits + * [1] = cpu_feature2 but with AMD XOP in bit 11 + * [2] = cpu_stdext_feature + * [3] = 0 + */ +unsigned int OPENSSL_ia32cap_P[4]; + +static MALLOC_DEFINE(M_OSSL, "ossl", "OpenSSL crypto"); + +static void +ossl_cpuid(void) +{ + uint64_t xcr0; + u_int regs[4]; + u_int max_cores; + + /* Derived from OpenSSL_ia32_cpuid. */ + + OPENSSL_ia32cap_P[0] = cpu_feature & ~(CPUID_B20 | CPUID_IA64); + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + OPENSSL_ia32cap_P[0] |= CPUID_IA64; + if ((cpu_id & 0xf00) != 0xf00) + OPENSSL_ia32cap_P[0] |= CPUID_B20; + } + + /* Only leave CPUID_HTT on if HTT is present. */ + if (cpu_vendor_id == CPU_VENDOR_AMD && cpu_exthigh >= 0x80000008) { + max_cores = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; + if (cpu_feature & CPUID_HTT) { + if ((cpu_procinfo & CPUID_HTT_CORES) >> 16 <= max_cores) + OPENSSL_ia32cap_P[0] &= ~CPUID_HTT; + } + } else { + if (cpu_high >= 4) { + cpuid_count(4, 0, regs); + max_cores = (regs[0] >> 26) & 0xfff; + } else + max_cores = -1; + } + if (max_cores == 0) + OPENSSL_ia32cap_P[0] &= ~CPUID_HTT; + else if ((cpu_procinfo & CPUID_HTT_CORES) >> 16 == 0) + OPENSSL_ia32cap_P[0] &= ~CPUID_HTT; + + OPENSSL_ia32cap_P[1] = cpu_feature2 & ~AMDID2_XOP; + if (cpu_vendor_id == CPU_VENDOR_AMD) + OPENSSL_ia32cap_P[1] |= amd_feature2 & AMDID2_XOP; + + OPENSSL_ia32cap_P[2] = cpu_stdext_feature; + if ((OPENSSL_ia32cap_P[1] & CPUID2_XSAVE) == 0) + OPENSSL_ia32cap_P[2] &= ~(CPUID_STDEXT_AVX512F | + CPUID_STDEXT_AVX512DQ); + + /* Disable AVX512F on Skylake-X. */ + if ((cpu_id & 0x0fff0ff0) == 0x00050650) + OPENSSL_ia32cap_P[2] &= ~(CPUID_STDEXT_AVX512F); + + if (cpu_feature2 & CPUID2_OSXSAVE) + xcr0 = rxcr(0); + else + xcr0 = 0; + + if ((xcr0 & (XFEATURE_AVX512 | XFEATURE_AVX)) != + (XFEATURE_AVX512 | XFEATURE_AVX)) + OPENSSL_ia32cap_P[2] &= ~(CPUID_STDEXT_AVX512VL | + CPUID_STDEXT_AVX512BW | CPUID_STDEXT_AVX512IFMA | + CPUID_STDEXT_AVX512F); + if ((xcr0 & XFEATURE_AVX) != XFEATURE_AVX) { + OPENSSL_ia32cap_P[1] &= ~(CPUID2_AVX | AMDID2_XOP | CPUID2_FMA); + OPENSSL_ia32cap_P[2] &= ~CPUID_STDEXT_AVX2; + } +} + +static void +ossl_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "ossl", -1) == NULL) + BUS_ADD_CHILD(parent, 10, "ossl", -1); +} + +static int +ossl_probe(device_t dev) +{ + + device_set_desc(dev, "OpenSSL crypto"); + return (BUS_PROBE_DEFAULT); +} + +static int +ossl_attach(device_t dev) +{ + struct ossl_softc *sc; + + sc = device_get_softc(dev); + + ossl_cpuid(); + sc->sc_cid = crypto_get_driverid(dev, sizeof(struct ossl_session), + CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC | + CRYPTOCAP_F_ACCEL_SOFTWARE); + if (sc->sc_cid < 0) { + device_printf(dev, "failed to allocate crypto driver id\n"); + return (ENXIO); + } + + return (0); +} + +static int +ossl_detach(device_t dev) +{ + struct ossl_softc *sc; + + sc = device_get_softc(dev); + + crypto_unregister_all(sc->sc_cid); + + return (0); +} + +static struct auth_hash * +ossl_lookup_hash(const struct crypto_session_params *csp) +{ + + switch (csp->csp_auth_alg) { + case CRYPTO_SHA1: + case CRYPTO_SHA1_HMAC: + return (&ossl_hash_sha1); + case CRYPTO_SHA2_224: + case CRYPTO_SHA2_224_HMAC: + return (&ossl_hash_sha224); + case CRYPTO_SHA2_256: + case CRYPTO_SHA2_256_HMAC: + return (&ossl_hash_sha256); + case CRYPTO_SHA2_384: + case CRYPTO_SHA2_384_HMAC: + return (&ossl_hash_sha384); + case CRYPTO_SHA2_512: + case CRYPTO_SHA2_512_HMAC: + return (&ossl_hash_sha512); + default: + return (NULL); + } +} + +static int +ossl_probesession(device_t dev, const struct crypto_session_params *csp) +{ + + if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != + 0) + return (EINVAL); + switch (csp->csp_mode) { + case CSP_MODE_DIGEST: + if (ossl_lookup_hash(csp) == NULL) + return (EINVAL); + break; + default: + return (EINVAL); + } + + return (CRYPTODEV_PROBE_ACCEL_SOFTWARE); +} + +static void +ossl_setkey_hmac(struct ossl_session *s, const void *key, int klen) +{ + + hmac_init_ipad(s->hash.axf, key, klen, &s->hash.ictx); + hmac_init_opad(s->hash.axf, key, klen, &s->hash.octx); +} + +static int +ossl_newsession(device_t dev, crypto_session_t cses, + const struct crypto_session_params *csp) +{ + struct ossl_session *s; + struct auth_hash *axf; + + s = crypto_get_driver_session(cses); + + axf = ossl_lookup_hash(csp); + s->hash.axf = axf; + if (csp->csp_auth_mlen == 0) + s->hash.mlen = axf->hashsize; + else + s->hash.mlen = csp->csp_auth_mlen; + + if (csp->csp_auth_klen == 0) { + axf->Init(&s->hash.ictx); + } else { + if (csp->csp_auth_key != NULL) { + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); + ossl_setkey_hmac(s, csp->csp_auth_key, + csp->csp_auth_klen); + fpu_kern_leave(curthread, NULL); + } + } + return (0); +} + +static int +ossl_process(device_t dev, struct cryptop *crp, int hint) +{ + struct ossl_hash_context ctx; + char digest[HASH_MAX_LEN]; + const struct crypto_session_params *csp; + struct ossl_session *s; + struct auth_hash *axf; + int error; + bool fpu_entered; + + s = crypto_get_driver_session(crp->crp_session); + csp = crypto_get_params(crp->crp_session); + axf = s->hash.axf; + + if (is_fpu_kern_thread(0)) { + fpu_entered = false; + } else { + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); + fpu_entered = true; + } + + if (crp->crp_auth_key != NULL) + ossl_setkey_hmac(s, crp->crp_auth_key, csp->csp_auth_klen); + + ctx = s->hash.ictx; + + if (crp->crp_aad != NULL) + error = axf->Update(&ctx, crp->crp_aad, crp->crp_aad_length); + else + error = crypto_apply(crp, crp->crp_aad_start, + crp->crp_aad_length, axf->Update, &ctx); + if (error) + goto out; + + error = crypto_apply(crp, crp->crp_payload_start, + crp->crp_payload_length, axf->Update, &ctx); + if (error) + goto out; + + axf->Final(digest, &ctx); + + if (csp->csp_auth_klen != 0) { + ctx = s->hash.octx; + axf->Update(&ctx, digest, axf->hashsize); + axf->Final(digest, &ctx); + } + + if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { + char digest2[HASH_MAX_LEN]; + + crypto_copydata(crp, crp->crp_digest_start, s->hash.mlen, + digest2); + if (timingsafe_bcmp(digest, digest2, s->hash.mlen) != 0) + error = EBADMSG; + explicit_bzero(digest2, sizeof(digest2)); + } else { + crypto_copyback(crp, crp->crp_digest_start, s->hash.mlen, + digest); + } + explicit_bzero(digest, sizeof(digest)); + +out: + if (fpu_entered) + fpu_kern_leave(curthread, NULL); + + crp->crp_etype = error; + crypto_done(crp); + + explicit_bzero(&ctx, sizeof(ctx)); + return (0); +} + +static device_method_t ossl_methods[] = { + DEVMETHOD(device_identify, ossl_identify), + DEVMETHOD(device_probe, ossl_probe), + DEVMETHOD(device_attach, ossl_attach), + DEVMETHOD(device_detach, ossl_detach), + + DEVMETHOD(cryptodev_probesession, ossl_probesession), + DEVMETHOD(cryptodev_newsession, ossl_newsession), + DEVMETHOD(cryptodev_process, ossl_process), + + DEVMETHOD_END +}; + +static driver_t ossl_driver = { + "ossl", + ossl_methods, + sizeof(struct ossl_softc) +}; + +static devclass_t ossl_devclass; + +DRIVER_MODULE(ossl, nexus, ossl_driver, ossl_devclass, NULL, NULL); +MODULE_VERSION(ossl, 1); +MODULE_DEPEND(ossl, crypto, 1, 1, 1); Added: head/sys/crypto/openssl/ossl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/openssl/ossl.h Tue Oct 20 17:50:18 2020 (r366901) @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 Netflix, Inc + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * 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 NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef __OSSL_H__ +#define __OSSL_H__ + +/* Compatibility shims. */ +#define OPENSSL_cleanse explicit_bzero + +/* Used by assembly routines to select CPU-specific variants. */ +extern unsigned int OPENSSL_ia32cap_P[4]; + +/* Needs to be big enough to hold any hash context. */ +struct ossl_hash_context { + uint32_t dummy[54]; +} __aligned(32); + +extern struct auth_hash ossl_hash_sha1; +extern struct auth_hash ossl_hash_sha224; +extern struct auth_hash ossl_hash_sha256; +extern struct auth_hash ossl_hash_sha384; +extern struct auth_hash ossl_hash_sha512; + +#endif /* !__OSSL_H__ */ Copied and modified: head/sys/crypto/openssl/ossl_hash.h (from r366898, head/crypto/openssl/include/crypto/md32_common.h) ============================================================================== --- head/crypto/openssl/include/crypto/md32_common.h Tue Oct 20 17:00:43 2020 (r366898, copy source) +++ head/sys/crypto/openssl/ossl_hash.h Tue Oct 20 17:50:18 2020 (r366901) @@ -5,96 +5,17 @@ * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html + * + * $FreeBSD$ */ -/*- - * This is a generic 32 bit "collector" for message digest algorithms. - * Whenever needed it collects input character stream into chunks of - * 32 bit values and invokes a block function that performs actual hash - * calculations. +/* + * Derived from include/crypto/md32_common.h * - * Porting guide. - * - * Obligatory macros: - * - * DATA_ORDER_IS_BIG_ENDIAN or DATA_ORDER_IS_LITTLE_ENDIAN - * this macro defines byte order of input stream. - * HASH_CBLOCK - * size of a unit chunk HASH_BLOCK operates on. - * HASH_LONG - * has to be at least 32 bit wide. - * HASH_CTX - * context structure that at least contains following - * members: - * typedef struct { - * ... - * HASH_LONG Nl,Nh; - * either { - * HASH_LONG data[HASH_LBLOCK]; - * unsigned char data[HASH_CBLOCK]; - * }; - * unsigned int num; - * ... - * } HASH_CTX; - * data[] vector is expected to be zeroed upon first call to - * HASH_UPDATE. - * HASH_UPDATE - * name of "Update" function, implemented here. - * HASH_TRANSFORM - * name of "Transform" function, implemented here. - * HASH_FINAL - * name of "Final" function, implemented here. - * HASH_BLOCK_DATA_ORDER - * name of "block" function capable of treating *unaligned* input - * message in original (data) byte order, implemented externally. - * HASH_MAKE_STRING - * macro converting context variables to an ASCII hash string. - * - * MD5 example: - * - * #define DATA_ORDER_IS_LITTLE_ENDIAN - * - * #define HASH_LONG MD5_LONG - * #define HASH_CTX MD5_CTX - * #define HASH_CBLOCK MD5_CBLOCK - * #define HASH_UPDATE MD5_Update - * #define HASH_TRANSFORM MD5_Transform - * #define HASH_FINAL MD5_Final - * #define HASH_BLOCK_DATA_ORDER md5_block_data_order + * HASH_UPDATE and HASH_FINAL have been updated to work with the + * auth_hash interface. */ -#include - -#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) -# error "DATA_ORDER must be defined!" -#endif - -#ifndef HASH_CBLOCK -# error "HASH_CBLOCK must be defined!" -#endif -#ifndef HASH_LONG -# error "HASH_LONG must be defined!" -#endif -#ifndef HASH_CTX -# error "HASH_CTX must be defined!" -#endif - -#ifndef HASH_UPDATE -# error "HASH_UPDATE must be defined!" -#endif -#ifndef HASH_TRANSFORM -# error "HASH_TRANSFORM must be defined!" -#endif -#ifndef HASH_FINAL -# error "HASH_FINAL must be defined!" -#endif - -#ifndef HASH_BLOCK_DATA_ORDER -# error "HASH_BLOCK_DATA_ORDER must be defined!" -#endif - -#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) - #if defined(DATA_ORDER_IS_BIG_ENDIAN) # define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \ @@ -125,15 +46,17 @@ * Time for some action :-) */ -int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) +static int +HASH_UPDATE(void *c_, const void *data_, unsigned int len) { + HASH_CTX *c = c_; const unsigned char *data = data_; unsigned char *p; HASH_LONG l; size_t n; if (len == 0) - return 1; + return 0; l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL; if (l < c->Nl) /* overflow */ @@ -163,7 +86,7 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t } else { memcpy(p + n, data, len); c->num += (unsigned int)len; - return 1; + return 0; } } @@ -180,16 +103,13 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t c->num = (unsigned int)len; memcpy(p, data, len); } - return 1; + return 0; } -void HASH_TRANSFORM(HASH_CTX *c, const unsigned char *data) +static void +HASH_FINAL(uint8_t *md, void *c_) { - HASH_BLOCK_DATA_ORDER(c, data, 1); -} - -int HASH_FINAL(unsigned char *md, HASH_CTX *c) -{ + HASH_CTX *c = c_; unsigned char *p = (unsigned char *)c->data; size_t n = c->num; @@ -222,35 +142,5 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c) HASH_MAKE_STRING(c, md); #endif - return 1; + return; } - -#ifndef MD32_REG_T -# if defined(__alpha) || defined(__sparcv9) || defined(__mips) -# define MD32_REG_T long -/* - * This comment was originally written for MD5, which is why it - * discusses A-D. But it basically applies to all 32-bit digests, - * which is why it was moved to common header file. - * - * In case you wonder why A-D are declared as long and not - * as MD5_LONG. Doing so results in slight performance - * boost on LP64 architectures. The catch is we don't - * really care if 32 MSBs of a 64-bit register get polluted - * with eventual overflows as we *save* only 32 LSBs in - * *either* case. Now declaring 'em long excuses the compiler - * from keeping 32 MSBs zeroed resulting in 13% performance - * improvement under SPARC Solaris7/64 and 5% under AlphaLinux. - * Well, to be honest it should say that this *prevents* - * performance degradation. - */ -# else -/* - * Above is not absolute and there are LP64 compilers that - * generate better code if MD32_REG_T is defined int. The above - * pre-processor condition reflects the circumstances under which - * the conclusion was made and is subject to further extension. - */ -# define MD32_REG_T int -# endif -#endif Copied and modified: head/sys/crypto/openssl/ossl_sha.h (from r366898, head/crypto/openssl/include/openssl/sha.h) ============================================================================== --- head/crypto/openssl/include/openssl/sha.h Tue Oct 20 17:00:43 2020 (r366898, copy source) +++ head/sys/crypto/openssl/ossl_sha.h Tue Oct 20 17:50:18 2020 (r366901) @@ -5,31 +5,27 @@ * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html + * + * $FreeBSD$ */ -#ifndef HEADER_SHA_H -# define HEADER_SHA_H +#ifndef __OSSL_SHA_H__ +#define __OSSL_SHA_H__ -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/*- - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! SHA_LONG has to be at least 32 bits wide. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +/* + * This is always included last which permits the namespace hacks below + * to work. */ +#define SHA256_CTX OSSL_SHA256_CTX +#define SHA512_CTX OSSL_SHA512_CTX + +/* From include/openssl/sha.h */ # define SHA_LONG unsigned int # define SHA_LBLOCK 16 # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a * contiguous array of 32 bit wide * big-endian values. */ -# define SHA_LAST_BLOCK (SHA_CBLOCK-8) -# define SHA_DIGEST_LENGTH 20 typedef struct SHAstate_st { SHA_LONG h0, h1, h2, h3, h4; @@ -38,12 +34,6 @@ typedef struct SHAstate_st { unsigned int num; } SHA_CTX; -int SHA1_Init(SHA_CTX *c); -int SHA1_Update(SHA_CTX *c, const void *data, size_t len); -int SHA1_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); -void SHA1_Transform(SHA_CTX *c, const unsigned char *data); - # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a * contiguous array of 32 bit wide * big-endian values. */ @@ -55,42 +45,15 @@ typedef struct SHA256state_st { unsigned int num, md_len; } SHA256_CTX; -int SHA224_Init(SHA256_CTX *c); -int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA224_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); -int SHA256_Init(SHA256_CTX *c); -int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA256_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); -void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); - -# define SHA224_DIGEST_LENGTH 28 -# define SHA256_DIGEST_LENGTH 32 -# define SHA384_DIGEST_LENGTH 48 -# define SHA512_DIGEST_LENGTH 64 - /* - * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 - * being exactly 64-bit wide. See Implementation Notes in sha512.c - * for further details. - */ -/* * SHA-512 treats input data as a * contiguous array of 64 bit * wide big-endian values. */ # define SHA512_CBLOCK (SHA_LBLOCK*8) -# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) -# define SHA_LONG64 unsigned __int64 -# define U64(C) C##UI64 -# elif defined(__arch64__) -# define SHA_LONG64 unsigned long -# define U64(C) C##UL -# else + # define SHA_LONG64 unsigned long long # define U64(C) C##ULL -# endif typedef struct SHA512state_st { SHA_LONG64 h[8]; @@ -102,18 +65,4 @@ typedef struct SHA512state_st { unsigned int num, md_len; } SHA512_CTX; -int SHA384_Init(SHA512_CTX *c); -int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA384_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); -int SHA512_Init(SHA512_CTX *c); -int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA512_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); -void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); - -#ifdef __cplusplus -} -#endif - -#endif +#endif /* !__OSSL_SHA_H__ */ Copied and modified: head/sys/crypto/openssl/ossl_sha1.c (from r366898, head/crypto/openssl/crypto/sha/sha_local.h) ============================================================================== --- head/crypto/openssl/crypto/sha/sha_local.h Tue Oct 20 17:00:43 2020 (r366898, copy source) +++ head/sys/crypto/openssl/ossl_sha1.c Tue Oct 20 17:50:18 2020 (r366901) @@ -7,12 +7,22 @@ * https://www.openssl.org/source/license.html */ -#include -#include +#include +__FBSDID("$FreeBSD$"); -#include -#include +#include +#include +#include +#include + +#include +#include + +/* sha1-x86_64.S */ +void sha1_block_data_order(SHA_CTX *c, const void *p, size_t len); + +/* From crypto/sha/sha_local.h */ #define DATA_ORDER_IS_BIG_ENDIAN #define HASH_LONG SHA_LONG @@ -27,398 +37,41 @@ ll=(c)->h4; (void)HOST_l2c(ll,(s)); \ } while (0) -#define HASH_UPDATE SHA1_Update -#define HASH_TRANSFORM SHA1_Transform -#define HASH_FINAL SHA1_Final -#define HASH_INIT SHA1_Init +#define HASH_UPDATE ossl_sha1_update +#define HASH_FINAL ossl_sha1_final +#define HASH_INIT ossl_sha1_init #define HASH_BLOCK_DATA_ORDER sha1_block_data_order -#define Xupdate(a,ix,ia,ib,ic,id) ( (a)=(ia^ib^ic^id), \ - ix=(a)=ROTATE((a),1) \ - ) -#ifndef SHA1_ASM -static void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num); -#else -void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num); -#endif - -#include "crypto/md32_common.h" - #define INIT_DATA_h0 0x67452301UL #define INIT_DATA_h1 0xefcdab89UL #define INIT_DATA_h2 0x98badcfeUL #define INIT_DATA_h3 0x10325476UL #define INIT_DATA_h4 0xc3d2e1f0UL -int HASH_INIT(SHA_CTX *c) +static void +HASH_INIT(void *c_) { + SHA_CTX *c = c_; memset(c, 0, sizeof(*c)); c->h0 = INIT_DATA_h0; c->h1 = INIT_DATA_h1; c->h2 = INIT_DATA_h2; c->h3 = INIT_DATA_h3; c->h4 = INIT_DATA_h4; - return 1; } -#define K_00_19 0x5a827999UL -#define K_20_39 0x6ed9eba1UL -#define K_40_59 0x8f1bbcdcUL -#define K_60_79 0xca62c1d6UL +#include "ossl_hash.h" -/* - * As pointed out by Wei Dai, F() below can be simplified to the code in - * F_00_19. Wei attributes these optimizations to Peter Gutmann's SHS code, - * and he attributes it to Rich Schroeppel. - * #define F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) - * I've just become aware of another tweak to be made, again from Wei Dai, - * in F_40_59, (x&a)|(y&a) -> (x|y)&a - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Oct 20 20:11:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFE52439A64; Tue, 20 Oct 2020 20:11:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG4X14kgLz4hqp; Tue, 20 Oct 2020 20:11:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85CC51A638; Tue, 20 Oct 2020 20:11:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KKBTwR050942; Tue, 20 Oct 2020 20:11:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KKBTFW050941; Tue, 20 Oct 2020 20:11:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010202011.09KKBTFW050941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Oct 2020 20:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366902 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 366902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 20:11:29 -0000 Author: emaste Date: Tue Oct 20 20:11:29 2020 New Revision: 366902 URL: https://svnweb.freebsd.org/changeset/base/366902 Log: arm64: add uhci to GENERIC uhci is (or, can be) used by VMware ESXi-Arm. PR: 250308 Reported by: Vincent Milum Jr MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Oct 20 17:50:18 2020 (r366901) +++ head/sys/arm64/conf/GENERIC Tue Oct 20 20:11:29 2020 (r366902) @@ -227,6 +227,7 @@ device rk_typec_phy # Rockchip TypeC PHY device dwcotg # DWC OTG controller device musb # Mentor Graphics USB OTG controller device ohci # OHCI USB interface +device uhci # UHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface device xhci # XHCI USB interface (USB 3.0) From owner-svn-src-all@freebsd.org Tue Oct 20 20:59:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2757743A969; Tue, 20 Oct 2020 20:59:14 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG5b60JJbz4lNj; Tue, 20 Oct 2020 20:59:14 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E32AE1AF2F; Tue, 20 Oct 2020 20:59:13 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09KKxDpM080511; Tue, 20 Oct 2020 20:59:13 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09KKxDAW080510; Tue, 20 Oct 2020 20:59:13 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202010202059.09KKxDAW080510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Tue, 20 Oct 2020 20:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366903 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 366903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 20:59:14 -0000 Author: rew Date: Tue Oct 20 20:59:13 2020 New Revision: 366903 URL: https://svnweb.freebsd.org/changeset/base/366903 Log: geom_ctl.c: remove stale header files - Remove "opt_geom.h", no kernel options are used. - Remove , no sysctl functionality is used here. - Remove , requirements for bio moved out in r112534. - Remove and , last used by DROP_GIANT() and PICKUP_GIANT(), which were removed in r115624. - Remove and , not used. Reviewed by: phk, kevans (mentor) Approved by: phk, kevans (mentor) Differential Revision: https://reviews.freebsd.org/D26805 Modified: head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Tue Oct 20 20:11:29 2020 (r366902) +++ head/sys/geom/geom_ctl.c Tue Oct 20 20:59:13 2020 (r366903) @@ -38,21 +38,11 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_geom.h" - #include #include -#include -#include -#include #include -#include #include -#include #include - -#include -#include #include #include From owner-svn-src-all@freebsd.org Wed Oct 21 00:15:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DFD543DE15; Wed, 21 Oct 2020 00:15:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CG9xF1LXFz4tln; Wed, 21 Oct 2020 00:15:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12A621D424; Wed, 21 Oct 2020 00:15:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09L0FCJG001633; Wed, 21 Oct 2020 00:15:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09L0FC2g001632; Wed, 21 Oct 2020 00:15:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010210015.09L0FC2g001632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Oct 2020 00:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366904 - in head/sys: amd64/ia32 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/ia32 i386/i386 X-SVN-Commit-Revision: 366904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 00:15:13 -0000 Author: kib Date: Wed Oct 21 00:15:12 2020 New Revision: 366904 URL: https://svnweb.freebsd.org/changeset/base/366904 Log: Improve FPU Tag Word reconstruction on i386 to indicate register states. Improve the code reconstructing en_tw in struct fpreg32 from FXSAVE results so that all register states are indicated correctly. The previous code unconditionally mapped non-empty register state to 'normalized value' constant. The new code explicitly distinguishes the 'zero value' and 'special value' constants as well. This improves consistency between real FSAVE and translation from FXSAVE, and ensures that tests using PT_GETFPREGS can rely on a single correct value independently of the underlying implementation. PR: 250454 Sponsored by: The FreeBSD Foundation Obtained from: Moritz Systems Submitted by: MichaÅ‚ Górny Discussed with: emaste MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26856 Modified: head/sys/amd64/ia32/ia32_reg.c head/sys/i386/i386/npx.c Modified: head/sys/amd64/ia32/ia32_reg.c ============================================================================== --- head/sys/amd64/ia32/ia32_reg.c Tue Oct 20 20:59:13 2020 (r366903) +++ head/sys/amd64/ia32/ia32_reg.c Wed Oct 21 00:15:12 2020 (r366904) @@ -145,7 +145,11 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) struct save87 *sv_87; struct env87 *penv_87; struct envxmm *penv_xmm; - int i; + struct fpacc87 *fx_reg; + int i, st; + uint64_t mantissa; + uint16_t tw, exp; + uint8_t ab_tw; bzero(regs, sizeof(*regs)); sv_87 = (struct save87 *)regs; @@ -171,13 +175,39 @@ fill_fpregs32(struct thread *td, struct fpreg32 *regs) /* Entry into the kernel always sets TF_HASSEGS */ penv_87->en_fos = td->td_frame->tf_ds; - /* FPU registers and tags */ - penv_87->en_tw = 0xffff; - for (i = 0; i < 8; ++i) { - sv_87->sv_ac[i] = sv_fpu->sv_fp[i].fp_acc; - if ((penv_xmm->en_tw & (1 << i)) != 0) - penv_87->en_tw &= ~(3 << i * 2); + /* + * FPU registers and tags. + * For ST(i), i = fpu_reg - top; we start with fpu_reg=7. + */ + st = 7 - ((penv_xmm->en_sw >> 11) & 7); + ab_tw = penv_xmm->en_tw; + tw = 0; + for (i = 0x80; i != 0; i >>= 1) { + sv_87->sv_ac[st] = sv_fpu->sv_fp[st].fp_acc; + tw <<= 2; + if ((ab_tw & i) != 0) { + /* Non-empty - we need to check ST(i) */ + fx_reg = &sv_fpu->sv_fp[st].fp_acc; + /* The first 64 bits contain the mantissa. */ + mantissa = *((uint64_t *)fx_reg->fp_bytes); + /* + * The final 16 bits contain the sign bit and the exponent. + * Mask the sign bit since it is of no consequence to these + * tests. + */ + exp = *((uint16_t *)&fx_reg->fp_bytes[8]) & 0x7fff; + if (exp == 0) { + if (mantissa == 0) + tw |= 1; /* Zero */ + else + tw |= 2; /* Denormal */ + } else if (exp == 0x7fff) + tw |= 2; /* Infinity or NaN */ + } else + tw |= 3; /* Empty */ + st = (st - 1) & 7; } + penv_87->en_tw = tw; return (0); } Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Tue Oct 20 20:59:13 2020 (r366903) +++ head/sys/i386/i386/npx.c Wed Oct 21 00:15:12 2020 (r366904) @@ -1154,7 +1154,11 @@ npx_fill_fpregs_xmm1(struct savexmm *sv_xmm, struct sa { struct env87 *penv_87; struct envxmm *penv_xmm; - int i; + struct fpacc87 *fx_reg; + int i, st; + uint64_t mantissa; + uint16_t tw, exp; + uint8_t ab_tw; penv_87 = &sv_87->sv_env; penv_xmm = &sv_xmm->sv_env; @@ -1168,14 +1172,39 @@ npx_fill_fpregs_xmm1(struct savexmm *sv_xmm, struct sa penv_87->en_foo = penv_xmm->en_foo; penv_87->en_fos = penv_xmm->en_fos; - /* FPU registers and tags */ - penv_87->en_tw = 0xffff; - for (i = 0; i < 8; ++i) { - sv_87->sv_ac[i] = sv_xmm->sv_fp[i].fp_acc; - if ((penv_xmm->en_tw & (1 << i)) != 0) - /* zero and special are set as valid */ - penv_87->en_tw &= ~(3 << i * 2); + /* + * FPU registers and tags. + * For ST(i), i = fpu_reg - top; we start with fpu_reg=7. + */ + st = 7 - ((penv_xmm->en_sw >> 11) & 7); + ab_tw = penv_xmm->en_tw; + tw = 0; + for (i = 0x80; i != 0; i >>= 1) { + sv_87->sv_ac[st] = sv_xmm->sv_fp[st].fp_acc; + tw <<= 2; + if (ab_tw & i) { + /* Non-empty - we need to check ST(i) */ + fx_reg = &sv_xmm->sv_fp[st].fp_acc; + /* The first 64 bits contain the mantissa. */ + mantissa = *((uint64_t *)fx_reg->fp_bytes); + /* + * The final 16 bits contain the sign bit and the exponent. + * Mask the sign bit since it is of no consequence to these + * tests. + */ + exp = *((uint16_t *)&fx_reg->fp_bytes[8]) & 0x7fff; + if (exp == 0) { + if (mantissa == 0) + tw |= 1; /* Zero */ + else + tw |= 2; /* Denormal */ + } else if (exp == 0x7fff) + tw |= 2; /* Infinity or NaN */ + } else + tw |= 3; /* Empty */ + st = (st - 1) & 7; } + penv_87->en_tw = tw; } void From owner-svn-src-all@freebsd.org Wed Oct 21 00:46:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A16143E67A; Wed, 21 Oct 2020 00:46:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGBdp34mbz4vPH; Wed, 21 Oct 2020 00:46: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 484091DB83; Wed, 21 Oct 2020 00:46: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 09L0ks66019761; Wed, 21 Oct 2020 00:46:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09L0ks1W019760; Wed, 21 Oct 2020 00:46:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010210046.09L0ks1W019760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 21 Oct 2020 00:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366905 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 366905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 00:46:54 -0000 Author: mav Date: Wed Oct 21 00:46:53 2020 New Revision: 366905 URL: https://svnweb.freebsd.org/changeset/base/366905 Log: MFC r366707: Use RTD3 Entry Latency value as shutdown timeout. This field was not in specs when the driver was written, but now there are SSDs with the reported latency of 10s, where hardcoded value of 5s seems to be not enough sometimes, causing shutdown timeout messages. Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Oct 21 00:15:12 2020 (r366904) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Oct 21 00:46:53 2020 (r366905) @@ -1474,22 +1474,24 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) { uint32_t cc; uint32_t csts; - int ticks = 0; + int ticks = 0, timeout; cc = nvme_mmio_read_4(ctrlr, cc); cc &= ~(NVME_CC_REG_SHN_MASK << NVME_CC_REG_SHN_SHIFT); cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; nvme_mmio_write_4(ctrlr, cc, cc); + timeout = ctrlr->cdata.rtd3e == 0 ? 5 * hz : + ((uint64_t)ctrlr->cdata.rtd3e * hz + 999999) / 1000000; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); if (csts == 0xffffffff) /* Hot unplug. */ break; if (NVME_CSTS_GET_SHST(csts) == NVME_SHST_COMPLETE) break; - if (ticks++ > 5*hz) { + if (ticks++ > timeout) { nvme_printf(ctrlr, "did not complete shutdown within" - " 5 seconds of notification\n"); + " %d ticks of notification\n", timeout); break; } pause("nvme shn", 1); From owner-svn-src-all@freebsd.org Wed Oct 21 05:27:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 524E944333C; Wed, 21 Oct 2020 05:27:26 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGJsV1V8bz3csZ; Wed, 21 Oct 2020 05:27:26 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1653020E3D; Wed, 21 Oct 2020 05:27:26 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09L5RPeZ091221; Wed, 21 Oct 2020 05:27:25 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09L5RPxo091218; Wed, 21 Oct 2020 05:27:25 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010210527.09L5RPxo091218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Wed, 21 Oct 2020 05:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366906 - in head: lib/libifconfig sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: lib/libifconfig sbin/ifconfig X-SVN-Commit-Revision: 366906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 05:27:26 -0000 Author: freqlabs Date: Wed Oct 21 05:27:25 2020 New Revision: 366906 URL: https://svnweb.freebsd.org/changeset/base/366906 Log: Move list_cloners to libifconfig Move list_cloners() from ifconfig(8) to libifconfig(3) where it can be reused by other consumers. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D26858 Modified: head/lib/libifconfig/libifconfig.c head/lib/libifconfig/libifconfig.h head/sbin/ifconfig/ifclone.c Modified: head/lib/libifconfig/libifconfig.c ============================================================================== --- head/lib/libifconfig/libifconfig.c Wed Oct 21 00:46:53 2020 (r366905) +++ head/lib/libifconfig/libifconfig.c Wed Oct 21 05:27:25 2020 (r366906) @@ -628,3 +628,35 @@ ifconfig_set_vlantag(ifconfig_handle_t *h, const char } return (0); } + +int +ifconfig_list_cloners(ifconfig_handle_t *h, char **bufp, size_t *lenp) +{ + struct if_clonereq ifcr; + char *buf; + + memset(&ifcr, 0, sizeof(ifcr)); + *bufp = NULL; + *lenp = 0; + + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCIFGCLONERS, &ifcr) < 0) + return (-1); + + buf = malloc(ifcr.ifcr_total * IFNAMSIZ); + if (buf == NULL) { + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); + } + + ifcr.ifcr_count = ifcr.ifcr_total; + ifcr.ifcr_buffer = buf; + if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCIFGCLONERS, &ifcr) < 0) { + free(buf); + return (-1); + } + + *bufp = buf; + *lenp = ifcr.ifcr_total; + return (0); +} Modified: head/lib/libifconfig/libifconfig.h ============================================================================== --- head/lib/libifconfig/libifconfig.h Wed Oct 21 00:46:53 2020 (r366905) +++ head/lib/libifconfig/libifconfig.h Wed Oct 21 05:27:25 2020 (r366906) @@ -279,3 +279,13 @@ int ifconfig_create_interface_vlan(ifconfig_handle_t * int ifconfig_set_vlantag(ifconfig_handle_t *h, const char *name, const char *vlandev, const unsigned short vlantag); + +/** Gets the names of all interface cloners available on the system + * @param bufp Set to the address of the names buffer on success or NULL + * if an error occurs. This buffer must be freed when done. + * @param lenp Set to the number of names in the returned buffer or 0 + * if an error occurs. Each name is contained within an + * IFNAMSIZ length slice of the buffer, for a total buffer + * length of *lenp * IFNAMSIZ bytes. + */ +int ifconfig_list_cloners(ifconfig_handle_t *h, char **bufp, size_t *lenp); Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Wed Oct 21 00:46:53 2020 (r366905) +++ head/sbin/ifconfig/ifclone.c Wed Oct 21 05:27:25 2020 (r366906) @@ -41,6 +41,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -51,45 +52,27 @@ static const char rcsid[] = static void list_cloners(void) { - struct if_clonereq ifcr; - char *cp, *buf; - int idx; - int s; + ifconfig_handle_t *lifh; + char *cloners; + size_t cloners_count; - s = socket(AF_LOCAL, SOCK_DGRAM, 0); - if (s == -1) - err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); + lifh = ifconfig_open(); + if (lifh == NULL) + return; - memset(&ifcr, 0, sizeof(ifcr)); + if (ifconfig_list_cloners(lifh, &cloners, &cloners_count) < 0) + errc(1, ifconfig_err_errno(lifh), "unable to list cloners"); + ifconfig_close(lifh); - if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) - err(1, "SIOCIFGCLONERS for count"); - - buf = malloc(ifcr.ifcr_total * IFNAMSIZ); - if (buf == NULL) - err(1, "unable to allocate cloner name buffer"); - - ifcr.ifcr_count = ifcr.ifcr_total; - ifcr.ifcr_buffer = buf; - - if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) - err(1, "SIOCIFGCLONERS for names"); - - /* - * In case some disappeared in the mean time, clamp it down. - */ - if (ifcr.ifcr_count > ifcr.ifcr_total) - ifcr.ifcr_count = ifcr.ifcr_total; - - for (cp = buf, idx = 0; idx < ifcr.ifcr_count; idx++, cp += IFNAMSIZ) { - if (idx > 0) + for (const char *name = cloners; + name < cloners + cloners_count * IFNAMSIZ; + name += IFNAMSIZ) { + if (name > cloners) putchar(' '); - printf("%s", cp); + printf("%s", name); } - putchar('\n'); - free(buf); - close(s); + free(cloners); } struct clone_defcb { From owner-svn-src-all@freebsd.org Wed Oct 21 05:57:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27EBC443B86; Wed, 21 Oct 2020 05:57:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGKX60Dg6z3f0x; Wed, 21 Oct 2020 05:57:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAED321179; Wed, 21 Oct 2020 05:57:25 +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 09L5vPAR009646; Wed, 21 Oct 2020 05:57:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09L5vPvr009645; Wed, 21 Oct 2020 05:57:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010210557.09L5vPvr009645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Oct 2020 05:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366907 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 05:57:26 -0000 Author: mjg Date: Wed Oct 21 05:57:25 2020 New Revision: 366907 URL: https://svnweb.freebsd.org/changeset/base/366907 Log: cache: drop the spurious slash_prefixed argument Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Oct 21 05:27:25 2020 (r366906) +++ head/sys/kern/vfs_cache.c Wed Oct 21 05:57:25 2020 (r366907) @@ -512,11 +512,11 @@ static void cache_zap_locked(struct namecache *ncp); static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, size_t *buflen); static int vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, - char **retbuf, size_t *buflen, bool slash_prefixed, size_t addend); + char **retbuf, size_t *buflen, size_t addend); static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, size_t *buflen); static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, - char **retbuf, size_t *len, bool slash_prefixed, size_t addend); + char **retbuf, size_t *len, size_t addend); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); @@ -2687,7 +2687,7 @@ vn_getcwd(char *buf, char **retbuf, size_t *buflen) vfs_smr_enter(); pwd = pwd_get_smr(); error = vn_fullpath_any_smr(pwd->pwd_cdir, pwd->pwd_rdir, buf, retbuf, - buflen, false, 0); + buflen, 0); VFS_SMR_ASSERT_NOT_ENTERED(); if (error < 0) { pwd = pwd_hold(curthread); @@ -2753,7 +2753,7 @@ vn_fullpath(struct vnode *vp, char **retbuf, char **fr buf = malloc(buflen, M_TEMP, M_WAITOK); vfs_smr_enter(); pwd = pwd_get_smr(); - error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, &buflen, false, 0); + error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, &buflen, 0); VFS_SMR_ASSERT_NOT_ENTERED(); if (error < 0) { pwd = pwd_hold(curthread); @@ -2785,7 +2785,7 @@ vn_fullpath_global(struct vnode *vp, char **retbuf, ch buflen = MAXPATHLEN; buf = malloc(buflen, M_TEMP, M_WAITOK); vfs_smr_enter(); - error = vn_fullpath_any_smr(vp, rootvnode, buf, retbuf, &buflen, false, 0); + error = vn_fullpath_any_smr(vp, rootvnode, buf, retbuf, &buflen, 0); VFS_SMR_ASSERT_NOT_ENTERED(); if (error < 0) { error = vn_fullpath_any(vp, rootvnode, buf, retbuf, &buflen); @@ -2887,7 +2887,7 @@ vn_vptocnp(struct vnode **vp, char *buf, size_t *bufle */ static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, - size_t *len, bool slash_prefixed, size_t addend) + size_t *len, size_t addend) { #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; @@ -2895,16 +2895,19 @@ vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, struct vnode *vp1; size_t buflen; int error; + bool slash_prefixed; VNPASS(vp->v_type == VDIR || VN_IS_DOOMED(vp), vp); VNPASS(vp->v_usecount > 0, vp); buflen = *len; - if (!slash_prefixed) { + slash_prefixed = true; + if (addend == 0) { MPASS(*len >= 2); buflen--; buf[buflen] = '\0'; + slash_prefixed = false; } error = 0; @@ -3006,7 +3009,7 @@ cache_rev_failed_impl(int *reason, int line) static int vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, - char **retbuf, size_t *buflen, bool slash_prefixed, size_t addend) + char **retbuf, size_t *buflen, size_t addend) { #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; @@ -3032,14 +3035,14 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rd orig_buflen = *buflen; - if (!slash_prefixed) { + if (addend == 0) { MPASS(*buflen >= 2); *buflen -= 1; buf[*buflen] = '\0'; } if (vp == rdir || vp == rootvnode) { - if (!slash_prefixed) { + if (addend == 0) { *buflen -= 1; buf[*buflen] = '/'; } @@ -3137,8 +3140,7 @@ static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, size_t *buflen) { - size_t orig_buflen; - bool slash_prefixed; + size_t orig_buflen, addend; int error; if (*buflen < 2) @@ -3147,7 +3149,7 @@ vn_fullpath_any(struct vnode *vp, struct vnode *rdir, orig_buflen = *buflen; vref(vp); - slash_prefixed = false; + addend = 0; if (vp->v_type != VDIR) { *buflen -= 1; buf[*buflen] = '\0'; @@ -3160,11 +3162,10 @@ vn_fullpath_any(struct vnode *vp, struct vnode *rdir, } *buflen -= 1; buf[*buflen] = '/'; - slash_prefixed = true; + addend = orig_buflen - *buflen; } - return (vn_fullpath_dir(vp, rdir, buf, retbuf, buflen, slash_prefixed, - orig_buflen - *buflen)); + return (vn_fullpath_dir(vp, rdir, buf, retbuf, buflen, addend)); } /* @@ -3189,7 +3190,6 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret struct vnode *vp; size_t addend; int error; - bool slash_prefixed; enum vtype type; if (*buflen < 2) @@ -3197,8 +3197,6 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret if (*buflen > MAXPATHLEN) *buflen = MAXPATHLEN; - slash_prefixed = false; - buf = malloc(*buflen, M_TEMP, M_WAITOK); addend = 0; @@ -3239,20 +3237,19 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret tmpbuf[0] = '/'; memcpy(&tmpbuf[1], cnp->cn_nameptr, cnp->cn_namelen); tmpbuf[addend - 1] = '\0'; - slash_prefixed = true; vp = ndp->ni_dvp; } vfs_smr_enter(); pwd = pwd_get_smr(); error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, buflen, - slash_prefixed, addend); + addend); VFS_SMR_ASSERT_NOT_ENTERED(); if (error < 0) { pwd = pwd_hold(curthread); vref(vp); error = vn_fullpath_dir(vp, pwd->pwd_rdir, buf, retbuf, buflen, - slash_prefixed, addend); + addend); pwd_drop(pwd); if (error != 0) goto out_bad; From owner-svn-src-all@freebsd.org Wed Oct 21 15:01:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3010D44DB6B; Wed, 21 Oct 2020 15:01:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGYby0Py8z4PK8; Wed, 21 Oct 2020 15:01:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5B6E276FE; Wed, 21 Oct 2020 15:01:33 +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 09LF1XHZ041767; Wed, 21 Oct 2020 15:01:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LF1XBr041764; Wed, 21 Oct 2020 15:01:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010211501.09LF1XBr041764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 21 Oct 2020 15:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366908 - in head: share/dtrace sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: share/dtrace sys/netpfil/ipfw X-SVN-Commit-Revision: 366908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 15:01:34 -0000 Author: ae Date: Wed Oct 21 15:01:33 2020 New Revision: 366908 URL: https://svnweb.freebsd.org/changeset/base/366908 Log: Add dtrace SDT probe ipfw:::rule-matched. It helps to reduce complexity with debugging of large ipfw rulesets. Also define several constants and translators, that can by used by dtrace scripts with this probe. Reviewed by: gnn Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D26879 Added: head/share/dtrace/ipfw.d (contents, props changed) Modified: head/share/dtrace/Makefile head/sys/netpfil/ipfw/ip_fw2.c Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Wed Oct 21 05:57:25 2020 (r366907) +++ head/share/dtrace/Makefile Wed Oct 21 15:01:33 2020 (r366908) @@ -21,7 +21,7 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace -DSRCS= mbuf.d +DSRCS= mbuf.d ipfw.d FILES= ${DSRCS} FILESDIR= /usr/lib/dtrace Added: head/share/dtrace/ipfw.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/ipfw.d Wed Oct 21 15:01:33 2020 (r366908) @@ -0,0 +1,219 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Yandex LLC + * Copyright (c) 2020 Andrey V. Elsukov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#pragma D depends_on provider ipfw + +/* ipfw_chk() return values */ +#pragma D binding "1.0" IP_FW_PASS +inline int IP_FW_PASS = 0; +#pragma D binding "1.0" IP_FW_DENY +inline int IP_FW_DENY = 1; +#pragma D binding "1.0" IP_FW_DIVERT +inline int IP_FW_DIVERT = 2; +#pragma D binding "1.0" IP_FW_TEE +inline int IP_FW_TEE = 3; +#pragma D binding "1.0" IP_FW_DUMMYNET +inline int IP_FW_DUMMYNET = 4; +#pragma D binding "1.0" IP_FW_NETGRAPH +inline int IP_FW_NETGRAPH = 5; +#pragma D binding "1.0" IP_FW_NGTEE +inline int IP_FW_NGTEE = 6; +#pragma D binding "1.0" IP_FW_NAT +inline int IP_FW_NAT = 7; +#pragma D binding "1.0" IP_FW_REASS +inline int IP_FW_REASS = 8; +#pragma D binding "1.0" IP_FW_NAT64 +inline int IP_FW_NAT64 = 9; + +#pragma D binding "1.0" ipfw_retcodes +inline string ipfw_retcodes[int ret] = + ret == IP_FW_PASS ? "PASS" : + ret == IP_FW_DENY ? "DENY" : + ret == IP_FW_DIVERT ? "DIVERT" : + ret == IP_FW_TEE ? "TEE" : + ret == IP_FW_DUMMYNET ? "DUMMYNET" : + ret == IP_FW_NETGRAPH ? "NETGRAPH" : + ret == IP_FW_NGTEE ? "NGTEE" : + ret == IP_FW_NAT ? "NAT" : + ret == IP_FW_REASS ? "REASS" : + ret == IP_FW_NAT64 ? "NAT64" : + ""; + +/* ip_fw_args flags */ +#pragma D binding "1.0" IPFW_ARGS_ETHER +inline int IPFW_ARGS_ETHER = 0x00010000; /* valid ethernet header */ +#pragma D binding "1.0" IPFW_ARGS_NH4 +inline int IPFW_ARGS_NH4 = 0x00020000; /* IPv4 next hop in hopstore */ +#pragma D binding "1.0" IPFW_ARGS_NH6 +inline int IPFW_ARGS_NH6 = 0x00040000; /* IPv6 next hop in hopstore */ +#pragma D binding "1.0" IPFW_ARGS_NH4PTR +inline int IPFW_ARGS_NH4PTR = 0x00080000; /* IPv4 next hop in next_hop */ +#pragma D binding "1.0" IPFW_ARGS_NH6PTR +inline int IPFW_ARGS_NH6PTR = 0x00100000; /* IPv6 next hop in next_hop6 */ +#pragma D binding "1.0" IPFW_ARGS_REF +inline int IPFW_ARGS_REF = 0x00200000; /* valid ipfw_rule_ref */ +#pragma D binding "1.0" IPFW_ARGS_IN +inline int IPFW_ARGS_IN = 0x00400000; /* called on input */ +#pragma D binding "1.0" IPFW_ARGS_OUT +inline int IPFW_ARGS_OUT = 0x00800000; /* called on output */ +#pragma D binding "1.0" IPFW_ARGS_IP4 +inline int IPFW_ARGS_IP4 = 0x01000000; /* belongs to v4 ISR */ +#pragma D binding "1.0" IPFW_ARGS_IP6 +inline int IPFW_ARGS_IP6 = 0x02000000; /* belongs to v6 ISR */ +#pragma D binding "1.0" IPFW_ARGS_DROP +inline int IPFW_ARGS_DROP = 0x04000000; /* drop it (dummynet) */ +#pragma D binding "1.0" IPFW_ARGS_LENMASK +inline int IPFW_ARGS_LENMASK = 0x0000ffff; /* length of data in *mem */ + +/* ipfw_rule_ref.info */ +#pragma D binding "1.0" IPFW_INFO_MASK +inline int IPFW_INFO_MASK = 0x0000ffff; +#pragma D binding "1.0" IPFW_INFO_OUT +inline int IPFW_INFO_OUT = 0x00000000; +#pragma D binding "1.0" IPFW_INFO_IN +inline int IPFW_INFO_IN = 0x80000000; +#pragma D binding "1.0" IPFW_ONEPASS +inline int IPFW_ONEPASS = 0x40000000; +#pragma D binding "1.0" IPFW_IS_MASK +inline int IPFW_IS_MASK = 0x30000000; +#pragma D binding "1.0" IPFW_IS_DIVERT +inline int IPFW_IS_DIVERT = 0x20000000; +#pragma D binding "1.0" IPFW_IS_DUMMYNET +inline int IPFW_IS_DUMMYNET = 0x10000000; +#pragma D binding "1.0" IPFW_IS_PIPE +inline int IPFW_IS_PIPE = 0x08000000; + +typedef struct ipfw_match_info { + uint32_t flags; + + struct mbuf *m; + void *mem; + struct inpcb *inp; + struct ifnet *ifp; + struct ip *ipp; + struct ip6_hdr *ip6p; + + /* flow id */ + uint8_t addr_type; + uint8_t proto; + uint8_t proto_flags; + uint16_t fib; /* XXX */ + in_addr_t dst_ip; /* in network byte order */ + in_addr_t src_ip; /* in network byte order */ + struct in6_addr dst_ip6; + struct in6_addr src_ip6; + + uint16_t dst_port; /* in host byte order */ + uint16_t src_port; /* in host byte order */ + + uint32_t flowid; /* IPv6 flowid */ + uint32_t extra; + + /* ipfw_rule_ref */ + uint32_t slot; + uint32_t rulenum; + uint32_t rule_id; + uint32_t chain_id; + uint32_t match_info; +} ipfw_match_info_t; + +#pragma D binding "1.0" translator +translator ipfw_match_info_t < struct ip_fw_args *p > { + flags = p->flags; + m = (p->flags & IPFW_ARGS_LENMASK) ? NULL : p->m; + mem = (p->flags & IPFW_ARGS_LENMASK) ? p->mem : NULL; + inp = p->inp; + ifp = p->ifp; + /* Initialize IP pointer corresponding to addr_type */ + ipp = (p->flags & IPFW_ARGS_IP4) ? + (p->flags & IPFW_ARGS_LENMASK) ? (struct ip *)p->mem : + (p->m != NULL) ? (struct ip *)p->m->m_data : NULL : NULL; + ip6p = (p->flags & IPFW_ARGS_IP6) ? + (p->flags & IPFW_ARGS_LENMASK) ? (struct ip6_hdr *)p->mem : + (p->m != NULL) ? (struct ip6_hdr *)p->m->m_data : NULL : NULL; + + /* fill f_id fields */ + addr_type = p->f_id.addr_type; + proto = p->f_id.proto; + proto_flags = p->f_id._flags; + + /* f_id.fib keeps truncated fibnum, use mbuf's fibnum if possible */ + fib = p->m != NULL ? p->m->m_pkthdr.fibnum : p->f_id.fib; + + /* + * ipfw_chk() keeps IPv4 addresses in host byte order. But for + * dtrace script it is useful to have them in network byte order, + * because inet_ntoa() uses address in network byte order. + */ + dst_ip = htonl(p->f_id.dst_ip); + src_ip = htonl(p->f_id.src_ip); + + dst_ip6 = p->f_id.dst_ip6; + src_ip6 = p->f_id.src_ip6; + + dst_port = p->f_id.dst_port; + src_port = p->f_id.src_port; + + flowid = p->f_id.flow_id6; + extra = p->f_id.extra; + + /* ipfw_rule_ref */ + slot = (p->flags & IPFW_ARGS_REF) ? p->rule.slot : 0; + rulenum = (p->flags & IPFW_ARGS_REF) ? p->rule.rulenum : 0; + rule_id = (p->flags & IPFW_ARGS_REF) ? p->rule.rule_id : 0; + chain_id = (p->flags & IPFW_ARGS_REF) ? p->rule.chain_id : 0; + match_info = (p->flags & IPFW_ARGS_REF) ? p->rule.info : 0; +}; + +typedef struct ipfw_rule_info { + uint16_t act_ofs; + uint16_t cmd_len; + uint32_t rulenum; + uint8_t flags; + uint8_t set; + uint32_t rule_id; + uint32_t cached_id; + uint32_t cached_pos; + uint32_t refcnt; +} ipfw_rule_info_t; + +#pragma D binding "1.0" translator +translator ipfw_rule_info_t < struct ip_fw *r > { + act_ofs = r->act_ofs; + cmd_len = r->cmd_len; + rulenum = r->rulenum; + flags = r->flags; + set = r->set; + rule_id = r->id; + cached_id = r->cached_id; + cached_pos = r->cached_pos; + refcnt = r->refcnt; +}; + Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Oct 21 05:57:25 2020 (r366907) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Oct 21 15:01:33 2020 (r366908) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -106,6 +107,18 @@ __FBSDID("$FreeBSD$"); #include #endif +#define IPFW_PROBE(probe, arg0, arg1, arg2, arg3, arg4, arg5) \ + SDT_PROBE6(ipfw, , , probe, arg0, arg1, arg2, arg3, arg4, arg5) + +SDT_PROVIDER_DEFINE(ipfw); +SDT_PROBE_DEFINE6(ipfw, , , rule__matched, + "int", /* retval */ + "int", /* af */ + "void *", /* src addr */ + "void *", /* dst addr */ + "struct ip_fw_args *", /* args */ + "struct ip_fw *" /* rule */); + /* * static variables followed by global ones. * All ipfw global variables are here. @@ -3237,6 +3250,13 @@ do { \ struct ip_fw *rule = chain->map[f_pos]; /* Update statistics */ IPFW_INC_RULE_COUNTER(rule, pktlen); + IPFW_PROBE(rule__matched, retval, + is_ipv4 ? AF_INET : AF_INET6, + is_ipv4 ? (uintptr_t)&src_ip : + (uintptr_t)&args->f_id.src_ip6, + is_ipv4 ? (uintptr_t)&dst_ip : + (uintptr_t)&args->f_id.dst_ip6, + args, rule); } else { retval = IP_FW_DENY; printf("ipfw: ouch!, skip past end of rules, denying packet\n"); From owner-svn-src-all@freebsd.org Wed Oct 21 15:04:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB44A44E408; Wed, 21 Oct 2020 15:04:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGYg25xG4z4Q7j; Wed, 21 Oct 2020 15:04: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF1C1278B2; Wed, 21 Oct 2020 15:04: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 09LF4EpC044914; Wed, 21 Oct 2020 15:04:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LF4DZh044907; Wed, 21 Oct 2020 15:04:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010211504.09LF4DZh044907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Oct 2020 15:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366909 - in stable/12/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Commit-Revision: 366909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 15:04:15 -0000 Author: kib Date: Wed Oct 21 15:04:12 2020 New Revision: 366909 URL: https://svnweb.freebsd.org/changeset/base/366909 Log: MFC r366712: Limit workaround for errata E400 to appropriate AMD cpus. Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/amd64/machdep.c stable/12/sys/i386/i386/initcpu.c stable/12/sys/i386/i386/machdep.c stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/include/x86_var.h stable/12/sys/x86/x86/cpu_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/amd64/amd64/initcpu.c Wed Oct 21 15:04:12 2020 (r366909) @@ -69,6 +69,23 @@ init_amd(void) uint64_t msr; /* + * C1E renders the local APIC timer dead, so we disable it by + * reading the Interrupt Pending Message register and clearing + * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27). + * + * Reference: + * "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors" + * #32559 revision 3.00+ + * + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. Affected models range is + * taken from Linux sources. + */ + if ((CPUID_TO_FAMILY(cpu_id) == 0xf || + CPUID_TO_FAMILY(cpu_id) == 0x10) && (cpu_feature2 & CPUID2_HV) == 0) + cpu_amdc1e_bug = 1; + + /* * Work around Erratum 721 for Family 10h and 12h processors. * These processors may incorrectly update the stack pointer * after a long series of push and/or near-call instructions, Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/amd64/amd64/machdep.c Wed Oct 21 15:04:12 2020 (r366909) @@ -1910,8 +1910,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) if (env != NULL) strlcpy(kernelname, env, sizeof(kernelname)); - cpu_probe_amdc1e(); - #ifdef FDT x86_init_fdt(); #endif Modified: stable/12/sys/i386/i386/initcpu.c ============================================================================== --- stable/12/sys/i386/i386/initcpu.c Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/i386/i386/initcpu.c Wed Oct 21 15:04:12 2020 (r366909) @@ -721,8 +721,8 @@ initializecpu(void) break; } break; -#ifdef CPU_ATHLON_SSE_HACK case CPU_VENDOR_AMD: +#ifdef CPU_ATHLON_SSE_HACK /* * Sometimes the BIOS doesn't enable SSE instructions. * According to AMD document 20734, the mobile @@ -739,8 +739,16 @@ initializecpu(void) do_cpuid(1, regs); cpu_feature = regs[3]; } - break; #endif + /* + * Detect C1E that breaks APIC. See comment in + * amd64/initcpu.c. + */ + if ((CPUID_TO_FAMILY(cpu_id) == 0xf || + CPUID_TO_FAMILY(cpu_id) == 0x10) && + (cpu_feature2 & CPUID2_HV) == 0) + cpu_amdc1e_bug = 1; + break; case CPU_VENDOR_CENTAUR: init_via(); break; Modified: stable/12/sys/i386/i386/machdep.c ============================================================================== --- stable/12/sys/i386/i386/machdep.c Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/i386/i386/machdep.c Wed Oct 21 15:04:12 2020 (r366909) @@ -2518,8 +2518,6 @@ init386(int first) thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; - cpu_probe_amdc1e(); - #ifdef FDT x86_init_fdt(); #endif Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/x86/include/specialreg.h Wed Oct 21 15:04:12 2020 (r366909) @@ -1078,6 +1078,7 @@ #define MSR_NB_CFG1 0xc001001f /* NB configuration 1 */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 +#define MSR_AMDK8_IPM 0xc0010055 #define MSR_P_STATE_LIMIT 0xc0010061 /* P-state Current Limit Register */ #define MSR_P_STATE_CONTROL 0xc0010062 /* P-state Control Register */ #define MSR_P_STATE_STATUS 0xc0010063 /* P-state Status Register */ @@ -1093,6 +1094,9 @@ /* MSR_VM_CR related */ #define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ + +#define AMDK8_SMIONCMPHALT (1ULL << 27) +#define AMDK8_C1EONCMPHALT (1ULL << 28) /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/x86/include/x86_var.h Wed Oct 21 15:04:12 2020 (r366909) @@ -89,6 +89,7 @@ extern int hw_ssb_active; extern int x86_taa_enable; extern int cpu_flush_rsb_ctxsw; extern int x86_rngds_mitg_enable; +extern int cpu_amdc1e_bug; struct pcb; struct thread; Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Wed Oct 21 15:01:33 2020 (r366908) +++ stable/12/sys/x86/x86/cpu_machdep.c Wed Oct 21 15:04:12 2020 (r366909) @@ -485,7 +485,9 @@ cpu_mwait_usable(void) } void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ -static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ + +int cpu_amdc1e_bug = 0; /* AMD C1E APIC workaround required. */ + static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait, 0, "Use MONITOR/MWAIT for short idle"); @@ -586,35 +588,6 @@ cpu_idle_spin(sbintime_t sbt) } } -/* - * C1E renders the local APIC timer dead, so we disable it by - * reading the Interrupt Pending Message register and clearing - * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27). - * - * Reference: - * "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors" - * #32559 revision 3.00+ - */ -#define MSR_AMDK8_IPM 0xc0010055 -#define AMDK8_SMIONCMPHALT (1ULL << 27) -#define AMDK8_C1EONCMPHALT (1ULL << 28) -#define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) - -void -cpu_probe_amdc1e(void) -{ - - /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - } -} - void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi; void @@ -644,10 +617,11 @@ cpu_idle(int busy) } /* Apply AMD APIC timer C1E workaround. */ - if (cpu_ident_amdc1e && cpu_disable_c3_sleep) { + if (cpu_amdc1e_bug && cpu_disable_c3_sleep) { msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); + if ((msr & (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT)) != 0) + wrmsr(MSR_AMDK8_IPM, msr & ~(AMDK8_SMIONCMPHALT | + AMDK8_C1EONCMPHALT)); } /* Call main idle method. */ From owner-svn-src-all@freebsd.org Wed Oct 21 15:06:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77EF244E398; Wed, 21 Oct 2020 15:06:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGYjx2YLxz4QMB; Wed, 21 Oct 2020 15:06: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2283527AE1; Wed, 21 Oct 2020 15:06: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 09LF6jV6045086; Wed, 21 Oct 2020 15:06:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LF6iJa045082; Wed, 21 Oct 2020 15:06:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010211506.09LF6iJa045082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Oct 2020 15:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366910 - in stable/12/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Commit-Revision: 366910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 15:06:45 -0000 Author: kib Date: Wed Oct 21 15:06:44 2020 New Revision: 366910 URL: https://svnweb.freebsd.org/changeset/base/366910 Log: MFC r366713, r366843 (by jhb): Fix for mis-interpretation of PCB_KERNFPU. Modified: stable/12/sys/amd64/amd64/fpu.c stable/12/sys/amd64/include/pcb.h stable/12/sys/i386/i386/npx.c stable/12/sys/i386/include/pcb.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/fpu.c ============================================================================== --- stable/12/sys/amd64/amd64/fpu.c Wed Oct 21 15:04:12 2020 (r366909) +++ stable/12/sys/amd64/amd64/fpu.c Wed Oct 21 15:06:44 2020 (r366910) @@ -1219,8 +1219,9 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) { set_pcb_flags(pcb, PCB_FPUINITDONE); - clear_pcb_flags(pcb, PCB_KERNFPU); - } else + if ((pcb->pcb_flags & PCB_KERNFPU_THR) == 0) + clear_pcb_flags(pcb, PCB_KERNFPU); + } else if ((pcb->pcb_flags & PCB_KERNFPU_THR) == 0) clear_pcb_flags(pcb, PCB_FPUINITDONE | PCB_KERNFPU); } else { if ((ctx->flags & FPU_KERN_CTX_FPUINITDONE) != 0) @@ -1243,7 +1244,7 @@ fpu_kern_thread(u_int flags) ("mangled pcb_save")); KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - set_pcb_flags(curpcb, PCB_KERNFPU); + set_pcb_flags(curpcb, PCB_KERNFPU | PCB_KERNFPU_THR); return (0); } @@ -1253,7 +1254,7 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); + return ((curpcb->pcb_flags & PCB_KERNFPU_THR) != 0); } /* Modified: stable/12/sys/amd64/include/pcb.h ============================================================================== --- stable/12/sys/amd64/include/pcb.h Wed Oct 21 15:04:12 2020 (r366909) +++ stable/12/sys/amd64/include/pcb.h Wed Oct 21 15:06:44 2020 (r366910) @@ -84,6 +84,7 @@ struct pcb { #define PCB_KERNFPU 0x04 /* kernel uses fpu */ #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ +#define PCB_KERNFPU_THR 0x20 /* fpu_kern_thread() */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ #define PCB_FPUNOSAVE 0x80 /* no save area for current FPU ctx */ Modified: stable/12/sys/i386/i386/npx.c ============================================================================== --- stable/12/sys/i386/i386/npx.c Wed Oct 21 15:04:12 2020 (r366909) +++ stable/12/sys/i386/i386/npx.c Wed Oct 21 15:06:44 2020 (r366910) @@ -1427,11 +1427,12 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx npxdrop(); pcb->pcb_save = ctx->prev; if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { - if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) + if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) { pcb->pcb_flags |= PCB_NPXINITDONE; - else - pcb->pcb_flags &= ~PCB_NPXINITDONE; - pcb->pcb_flags &= ~PCB_KERNNPX; + if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) + pcb->pcb_flags &= ~PCB_KERNNPX; + } else if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) + pcb->pcb_flags &= ~(PCB_NPXINITDONE | PCB_KERNNPX); } else { if ((ctx->flags & FPU_KERN_CTX_NPXINITDONE) != 0) pcb->pcb_flags |= PCB_NPXINITDONE; @@ -1453,7 +1454,7 @@ fpu_kern_thread(u_int flags) ("mangled pcb_save")); KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - curpcb->pcb_flags |= PCB_KERNNPX; + curpcb->pcb_flags |= PCB_KERNNPX | PCB_KERNNPX_THR; return (0); } @@ -1463,7 +1464,7 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((curpcb->pcb_flags & PCB_KERNNPX) != 0); + return ((curpcb->pcb_flags & PCB_KERNNPX_THR) != 0); } /* Modified: stable/12/sys/i386/include/pcb.h ============================================================================== --- stable/12/sys/i386/include/pcb.h Wed Oct 21 15:04:12 2020 (r366909) +++ stable/12/sys/i386/include/pcb.h Wed Oct 21 15:06:44 2020 (r366910) @@ -82,6 +82,7 @@ struct pcb { u_int pcb_flags; #define PCB_DBREGS 0x02 /* process using debug registers */ +#define PCB_KERNNPX_THR 0x04 /* fpu_kern_thread() */ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ #define PCB_VM86CALL 0x10 /* in vm86 call */ #define PCB_NPXUSERINITDONE 0x20 /* user fpu state is initialized */ From owner-svn-src-all@freebsd.org Wed Oct 21 16:00:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3500844F2E3; Wed, 21 Oct 2020 16:00:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGZvj0Z8Jz4T0M; Wed, 21 Oct 2020 16:00:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE06851B; Wed, 21 Oct 2020 16:00:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LG0GuM075804; Wed, 21 Oct 2020 16:00:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LG0FrC075799; Wed, 21 Oct 2020 16:00:15 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010211600.09LG0FrC075799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 21 Oct 2020 16:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366911 - in head/sys: cam dev/nvme kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: cam dev/nvme kern sys ufs/ffs X-SVN-Commit-Revision: 366911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 16:00:17 -0000 Author: brooks Date: Wed Oct 21 16:00:15 2020 New Revision: 366911 URL: https://svnweb.freebsd.org/changeset/base/366911 Log: vmapbuf: don't smuggle address or length in buf Instead, add arguments to vmapbuf. Since this argument is always a pointer use a type of void * and cast to vm_offset_t in vmapbuf. (In CheriBSD we've altered vm_fault_quick_hold_pages to take a pointer and check its bounds.) In no other situtation does b_data contain a user pointer and vmapbuf replaces b_data with the actual mapping. Suggested by: jhb Reviewed by: imp, jhb Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26784 Modified: head/sys/cam/cam_periph.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/kern/vfs_bio.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_rawread.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Wed Oct 21 15:06:44 2020 (r366910) +++ head/sys/cam/cam_periph.c Wed Oct 21 16:00:15 2020 (r366911) @@ -955,18 +955,12 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma */ mapinfo->bp[i] = uma_zalloc(pbuf_zone, M_WAITOK); - /* put our pointer in the data slot */ - mapinfo->bp[i]->b_data = *data_ptrs[i]; - - /* set the transfer length, we know it's < MAXPHYS */ - mapinfo->bp[i]->b_bufsize = lengths[i]; - /* set the direction */ mapinfo->bp[i]->b_iocmd = (dirs[i] == CAM_DIR_OUT) ? BIO_WRITE : BIO_READ; /* Map the buffer into kernel memory. */ - if (vmapbuf(mapinfo->bp[i], 1) < 0) { + if (vmapbuf(mapinfo->bp[i], *data_ptrs[i], lengths[i], 1) < 0) { uma_zfree(pbuf_zone, mapinfo->bp[i]); goto fail; } Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Oct 21 15:06:44 2020 (r366910) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Oct 21 16:00:15 2020 (r366911) @@ -1268,10 +1268,8 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr */ PHOLD(curproc); buf = uma_zalloc(pbuf_zone, M_WAITOK); - buf->b_data = pt->buf; - buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; - if (vmapbuf(buf, 1) < 0) { + if (vmapbuf(buf, pt->buf, pt->len, 1) < 0) { ret = EFAULT; goto err; } Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Oct 21 15:06:44 2020 (r366910) +++ head/sys/kern/vfs_bio.c Wed Oct 21 16:00:15 2020 (r366911) @@ -4907,22 +4907,21 @@ vm_hold_free_pages(struct buf *bp, int newbsize) * This function only works with pager buffers. */ int -vmapbuf(struct buf *bp, int mapbuf) +vmapbuf(struct buf *bp, void *uaddr, size_t len, int mapbuf) { vm_prot_t prot; int pidx; - if (bp->b_bufsize < 0) - return (-1); prot = VM_PROT_READ; if (bp->b_iocmd == BIO_READ) prot |= VM_PROT_WRITE; /* Less backwards than it looks */ if ((pidx = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, - (vm_offset_t)bp->b_data, bp->b_bufsize, prot, bp->b_pages, + (vm_offset_t)uaddr, len, prot, bp->b_pages, btoc(MAXPHYS))) < 0) return (-1); + bp->b_bufsize = len; bp->b_npages = pidx; - bp->b_offset = ((vm_offset_t)bp->b_data) & PAGE_MASK; + bp->b_offset = ((vm_offset_t)uaddr) & PAGE_MASK; if (mapbuf || !unmapped_buf_allowed) { pmap_qenter((vm_offset_t)bp->b_kvabase, bp->b_pages, pidx); bp->b_data = bp->b_kvabase + bp->b_offset; Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Wed Oct 21 15:06:44 2020 (r366910) +++ head/sys/sys/buf.h Wed Oct 21 16:00:15 2020 (r366911) @@ -575,7 +575,7 @@ void vfs_bio_set_flags(struct buf *bp, int ioflags); void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *); -int vmapbuf(struct buf *, int); +int vmapbuf(struct buf *, void *, size_t, int); void vunmapbuf(struct buf *); void brelvp(struct buf *); void bgetvp(struct vnode *, struct buf *); Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Wed Oct 21 15:06:44 2020 (r366910) +++ head/sys/ufs/ffs/ffs_rawread.c Wed Oct 21 16:00:15 2020 (r366911) @@ -216,7 +216,6 @@ ffs_rawread_readahead(struct vnode *vp, bp->b_flags = 0; /* XXX necessary ? */ bp->b_iocmd = BIO_READ; bp->b_iodone = bdone; - bp->b_data = udata; blockno = offset / bsize; blockoff = (offset % bsize) / DEV_BSIZE; if ((daddr_t) blockno != blockno) { @@ -233,9 +232,8 @@ ffs_rawread_readahead(struct vnode *vp, if (bp->b_bcount + blockoff * DEV_BSIZE > bsize) bp->b_bcount = bsize - blockoff * DEV_BSIZE; - bp->b_bufsize = bp->b_bcount; - if (vmapbuf(bp, 1) < 0) + if (vmapbuf(bp, udata, bp->b_bcount, 1) < 0) return EFAULT; maybe_yield(); @@ -252,9 +250,8 @@ ffs_rawread_readahead(struct vnode *vp, if (bp->b_bcount + blockoff * DEV_BSIZE > bsize * (1 + bforwards)) bp->b_bcount = bsize * (1 + bforwards) - blockoff * DEV_BSIZE; - bp->b_bufsize = bp->b_bcount; - if (vmapbuf(bp, 1) < 0) + if (vmapbuf(bp, udata, bp->b_bcount, 1) < 0) return EFAULT; BO_STRATEGY(&dp->v_bufobj, bp); From owner-svn-src-all@freebsd.org Wed Oct 21 16:04:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE96E44F34F; Wed, 21 Oct 2020 16:04:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGb15643vz4TRh; Wed, 21 Oct 2020 16:04:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF23085A8; Wed, 21 Oct 2020 16:04:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LG4vWA081806; Wed, 21 Oct 2020 16:04:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LG4vkT081805; Wed, 21 Oct 2020 16:04:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010211604.09LG4vkT081805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 21 Oct 2020 16:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366912 - stable/12/lib/libgssapi X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libgssapi X-SVN-Commit-Revision: 366912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 16:04:58 -0000 Author: brooks Date: Wed Oct 21 16:04:57 2020 New Revision: 366912 URL: https://svnweb.freebsd.org/changeset/base/366912 Log: MFC r366671: libgssapi: modernize static string array use Use designated initializers to document positions in the arrays rather than requiring counting. Use nitems() rather than rolling it by hand to count elements. Also, passify a Clang 12 warning about suspcious string concatenation within an array initializer by adding parentheses. Reviewed by: emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26592 Modified: stable/12/lib/libgssapi/gss_display_status.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libgssapi/gss_display_status.c ============================================================================== --- stable/12/lib/libgssapi/gss_display_status.c Wed Oct 21 16:00:15 2020 (r366911) +++ stable/12/lib/libgssapi/gss_display_status.c Wed Oct 21 16:04:57 2020 (r366912) @@ -92,6 +92,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -105,17 +106,15 @@ static const char * calling_error(OM_uint32 v) { static const char *msgs[] = { - NULL, /* 0 */ - "A required input parameter could not be read.", /* */ - "A required output parameter could not be written.", /* */ - "A parameter was malformed" + [0] = "", + [1] = "A required input parameter could not be read.", + [2] = "A required output parameter could not be written.", + [3] = "A parameter was malformed", }; v >>= GSS_C_CALLING_ERROR_OFFSET; - if (v == 0) - return ""; - else if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown calling error"; else return msgs[v]; @@ -125,31 +124,31 @@ static const char * routine_error(OM_uint32 v) { static const char *msgs[] = { - "Function completed successfully", /* 0 */ - "An unsupported mechanism was requested", - "An invalid name was supplied", - "A supplied name was of an unsupported type", - "Incorrect channel bindings were supplied", - "An invalid status code was supplied", - "A token had an invalid MIC", - "No credentials were supplied, " - "or the credentials were unavailable or inaccessible.", - "No context has been established", - "A token was invalid", - "A credential was invalid", - "The referenced credentials have expired", - "The context has expired", - "Miscellaneous failure (see text)", - "The quality-of-protection requested could not be provide", - "The operation is forbidden by local security policy", - "The operation or option is not available", - "The requested credential element already exists", - "The provided name was not a mechanism name.", + [0] = "Function completed successfully", + [1] = "An unsupported mechanism was requested", + [2] = "An invalid name was supplied", + [3] = "A supplied name was of an unsupported type", + [4] = "Incorrect channel bindings were supplied", + [5] = "An invalid status code was supplied", + [6] = "A token had an invalid MIC", + [7] = ("No credentials were supplied, " + "or the credentials were unavailable or inaccessible."), + [8] = "No context has been established", + [9] = "A token was invalid", + [10] = "A credential was invalid", + [11] = "The referenced credentials have expired", + [12] = "The context has expired", + [13] = "Miscellaneous failure (see text)", + [14] = "The quality-of-protection requested could not be provide", + [15] = "The operation is forbidden by local security policy", + [16] = "The operation or option is not available", + [17] = "The requested credential element already exists", + [18] = "The provided name was not a mechanism name.", }; v >>= GSS_C_ROUTINE_ERROR_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; @@ -159,17 +158,17 @@ static const char * supplementary_error(OM_uint32 v) { static const char *msgs[] = { - "normal completion", - "continuation call to routine required", - "duplicate per-message token detected", - "timed-out per-message token detected", - "reordered (early) per-message token detected", - "skipped predecessor token(s) detected" + [0] = "normal completion", + [1] = "continuation call to routine required", + [2] = "duplicate per-message token detected", + [3] = "timed-out per-message token detected", + [4] = "reordered (early) per-message token detected", + [5] = "skipped predecessor token(s) detected", }; v >>= GSS_C_SUPPLEMENTARY_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; From owner-svn-src-all@freebsd.org Wed Oct 21 16:30:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA25644FF81; Wed, 21 Oct 2020 16:30:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGbZf44TSz4VlZ; Wed, 21 Oct 2020 16:30:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F5898A34; Wed, 21 Oct 2020 16:30:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LGUYvT094432; Wed, 21 Oct 2020 16:30:34 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LGUYUd094431; Wed, 21 Oct 2020 16:30:34 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010211630.09LGUYUd094431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Wed, 21 Oct 2020 16:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366913 - head/usr.bin/col X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/col X-SVN-Commit-Revision: 366913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 16:30:34 -0000 Author: fernape (ports committer) Date: Wed Oct 21 16:30:34 2020 New Revision: 366913 URL: https://svnweb.freebsd.org/changeset/base/366913 Log: col(1): Add EXAMPLES section Add a small example. Cross reference clean up for colcrt, nroff and tbl. Reviewed by: gbe@, bcr@ Approved by: gbe@ Differential Revision: https://reviews.freebsd.org/D26864 Modified: head/usr.bin/col/col.1 Modified: head/usr.bin/col/col.1 ============================================================================== --- head/usr.bin/col/col.1 Wed Oct 21 16:04:57 2020 (r366912) +++ head/usr.bin/col/col.1 Wed Oct 21 16:30:34 2020 (r366913) @@ -31,7 +31,7 @@ .\" @(#)col.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd May 10, 2015 +.Dd October 21, 2020 .Dt COL 1 .Os .Sh NAME @@ -47,10 +47,6 @@ The utility filters out reverse (and half reverse) line feeds so that the output is in the correct order with only forward and half forward line feeds, and replaces white-space characters with tabs where possible. -This can be useful in processing the output of -.Xr nroff 1 -and -.Xr tbl 1 . .Pp The .Nm @@ -149,11 +145,19 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +We can use +.Nm +to filter the output of +.Xr man 1 +and remove the backspace characters ( +.Em ^H +) before searching for some text: +.Bd -literal -offset indent +man ls | col -b | grep HISTORY +.Ed .Sh SEE ALSO -.Xr colcrt 1 , -.Xr expand 1 , -.Xr nroff 1 , -.Xr tbl 1 +.Xr expand 1 .Sh STANDARDS The .Nm From owner-svn-src-all@freebsd.org Wed Oct 21 17:11:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86E50428AB3; Wed, 21 Oct 2020 17:11:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGcVQ310kz4XCd; Wed, 21 Oct 2020 17:11:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AFF39503; Wed, 21 Oct 2020 17:11:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LHBwGE023421; Wed, 21 Oct 2020 17:11:58 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LHBwiu023420; Wed, 21 Oct 2020 17:11:58 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202010211711.09LHBwiu023420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 21 Oct 2020 17:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366914 - head/sys/dev/ntb/test X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/dev/ntb/test X-SVN-Commit-Revision: 366914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 17:11:58 -0000 Author: vangyzen Date: Wed Oct 21 17:11:57 2020 New Revision: 366914 URL: https://svnweb.freebsd.org/changeset/base/366914 Log: ntb_tool: ubuf is too small to hold a human readable 64 bit value ubuf buffer is too small. It should be 18 if a NULL is not needed, or 19 to hold the NULL terminator for the full 64-BIT value plus the 0x prefix. Submitted by: bret_ketchum@dell.com Reviewed by: markj mav MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26893 Modified: head/sys/dev/ntb/test/ntb_tool.c Modified: head/sys/dev/ntb/test/ntb_tool.c ============================================================================== --- head/sys/dev/ntb/test/ntb_tool.c Wed Oct 21 16:30:34 2020 (r366913) +++ head/sys/dev/ntb/test/ntb_tool.c Wed Oct 21 17:11:57 2020 (r366914) @@ -384,7 +384,7 @@ get_ubuf(struct sysctl_req *req, char *ubuf) static int read_out(struct sysctl_req *req, uint64_t val) { - char ubuf[16]; + char ubuf[19]; memset((void *)ubuf, 0, sizeof(ubuf)); snprintf(ubuf, sizeof(ubuf), "0x%jx", val); From owner-svn-src-all@freebsd.org Wed Oct 21 18:45:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37FE242A68E; Wed, 21 Oct 2020 18:45:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGfZj0jgPz4cXS; Wed, 21 Oct 2020 18:45:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBAC4A581; Wed, 21 Oct 2020 18:45:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LIjmVN080168; Wed, 21 Oct 2020 18:45:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LIjmZ5080167; Wed, 21 Oct 2020 18:45:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010211845.09LIjmZ5080167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 21 Oct 2020 18:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366915 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 18:45:49 -0000 Author: trasz Date: Wed Oct 21 18:45:48 2020 New Revision: 366915 URL: https://svnweb.freebsd.org/changeset/base/366915 Log: Make linux(4) warn about unsupported socket(2) types. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25680 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Wed Oct 21 17:11:57 2020 (r366914) +++ head/sys/compat/linux/linux_socket.c Wed Oct 21 18:45:48 2020 (r366915) @@ -513,8 +513,11 @@ linux_socket(struct thread *td, struct linux_socket_ar if (retval_socket != 0) return (retval_socket); domain = linux_to_bsd_domain(args->domain); - if (domain == -1) + if (domain == -1) { + linux_msg(curthread, "unsupported socket domain %d, type %d, protocol %d", + args->domain, args->type & LINUX_SOCK_TYPE_MASK, args->protocol); return (EAFNOSUPPORT); + } retval_socket = kern_socket(td, domain, type, args->protocol); if (retval_socket) From owner-svn-src-all@freebsd.org Wed Oct 21 20:42:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D62642D070; Wed, 21 Oct 2020 20:42:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGj9L21CJz3Wg5; Wed, 21 Oct 2020 20:42:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 286A4B657; Wed, 21 Oct 2020 20:42:30 +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 09LKgUGO055768; Wed, 21 Oct 2020 20:42:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LKgUbR055767; Wed, 21 Oct 2020 20:42:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010212042.09LKgUbR055767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 21 Oct 2020 20:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366916 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 20:42:30 -0000 Author: np Date: Wed Oct 21 20:42:29 2020 New Revision: 366916 URL: https://svnweb.freebsd.org/changeset/base/366916 Log: cxgbe(4): display correct tid range for T6 based -SO cards. Reported by: Chelsio QA MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Oct 21 18:45:48 2020 (r366915) +++ head/sys/dev/cxgbe/t4_main.c Wed Oct 21 20:42:29 2020 (r366916) @@ -9325,8 +9325,10 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) if (b) sbuf_printf(sb, "%u-%u, ", t->tid_base, b - 1); sbuf_printf(sb, "%u-%u", hb, t->ntids - 1); - } else - sbuf_printf(sb, "%u-%u", t->tid_base, t->ntids - 1); + } else { + sbuf_printf(sb, "%u-%u", t->tid_base, t->tid_base + + t->ntids - 1); + } sbuf_printf(sb, ", in use: %u\n", atomic_load_acq_int(&t->tids_in_use)); } From owner-svn-src-all@freebsd.org Wed Oct 21 21:28:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4CB842DE68; Wed, 21 Oct 2020 21:28:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGkBG5Ylkz3YkF; Wed, 21 Oct 2020 21:28:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1F29BE70; Wed, 21 Oct 2020 21:28:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LLSMfL080767; Wed, 21 Oct 2020 21:28:22 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LLSK8d080756; Wed, 21 Oct 2020 21:28:20 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010212128.09LLSK8d080756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 21 Oct 2020 21:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366917 - in head: sbin/ifconfig sys/net tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net tests/sys/net X-SVN-Commit-Revision: 366917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 21:28:22 -0000 Author: melifaro Date: Wed Oct 21 21:28:20 2020 New Revision: 366917 URL: https://svnweb.freebsd.org/changeset/base/366917 Log: Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q). 802.1ad interfaces are created with ifconfig using the "vlanproto" parameter. Eg., the following creates a 802.1Q VLAN (id #42) over a 802.1ad S-VLAN (id #5) over a physical Ethernet interface (em0). ifconfig vlan5 create vlandev em0 vlan 5 vlanproto 802.1ad up ifconfig vlan42 create vlandev vlan5 vlan 42 inet 10.5.42.1/24 VLAN_MTU, VLAN_HWCSUM and VLAN_TSO capabilities should be properly supported. VLAN_HWTAGGING is only partially supported, as there is currently no IFCAP_VLAN_* denoting the possibility to set the VLAN EtherType to anything else than 0x8100 (802.1ad uses 0x88A8). Submitted by: Olivier Piras Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D26436 Modified: head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.h head/sbin/ifconfig/ifieee80211.c head/sbin/ifconfig/ifvlan.c head/sbin/ifconfig/ifvxlan.c head/sys/net/ethernet.h head/sys/net/if_clone.c head/sys/net/if_ethersubr.c head/sys/net/if_vlan.c head/sys/net/if_vlan_var.h head/tests/sys/net/if_vlan.sh Modified: head/sbin/ifconfig/ifclone.c ============================================================================== --- head/sbin/ifconfig/ifclone.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifclone.c Wed Oct 21 21:28:20 2020 (r366917) @@ -49,6 +49,11 @@ static const char rcsid[] = #include "ifconfig.h" +typedef enum { + MT_PREFIX, + MT_FILTER, +} clone_match_type; + static void list_cloners(void) { @@ -76,7 +81,11 @@ list_cloners(void) } struct clone_defcb { - char ifprefix[IFNAMSIZ]; + union { + char ifprefix[IFNAMSIZ]; + clone_match_func *ifmatch; + }; + clone_match_type clone_mt; clone_callback_func *clone_cb; SLIST_ENTRY(clone_defcb) next; }; @@ -85,16 +94,29 @@ static SLIST_HEAD(, clone_defcb) clone_defcbh = SLIST_HEAD_INITIALIZER(clone_defcbh); void -clone_setdefcallback(const char *ifprefix, clone_callback_func *p) +clone_setdefcallback_prefix(const char *ifprefix, clone_callback_func *p) { struct clone_defcb *dcp; dcp = malloc(sizeof(*dcp)); strlcpy(dcp->ifprefix, ifprefix, IFNAMSIZ-1); + dcp->clone_mt = MT_PREFIX; dcp->clone_cb = p; SLIST_INSERT_HEAD(&clone_defcbh, dcp, next); } +void +clone_setdefcallback_filter(clone_match_func *filter, clone_callback_func *p) +{ + struct clone_defcb *dcp; + + dcp = malloc(sizeof(*dcp)); + dcp->ifmatch = filter; + dcp->clone_mt = MT_FILTER; + dcp->clone_cb = p; + SLIST_INSERT_HEAD(&clone_defcbh, dcp, next); +} + /* * Do the actual clone operation. Any parameters must have been * setup by now. If a callback has been setup to do the work @@ -114,8 +136,14 @@ ifclonecreate(int s, void *arg) if (clone_cb == NULL) { /* Try to find a default callback */ SLIST_FOREACH(dcp, &clone_defcbh, next) { - if (strncmp(dcp->ifprefix, ifr.ifr_name, - strlen(dcp->ifprefix)) == 0) { + if ((dcp->clone_mt == MT_PREFIX) && + (strncmp(dcp->ifprefix, ifr.ifr_name, + strlen(dcp->ifprefix)) == 0)) { + clone_cb = dcp->clone_cb; + break; + } + if ((dcp->clone_mt == MT_FILTER) && + dcp->ifmatch(ifr.ifr_name)) { clone_cb = dcp->clone_cb; break; } Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifconfig.8 Wed Oct 21 21:28:20 2020 (r366917) @@ -582,7 +582,7 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso +.It Cm vlanmtu , vlanhwtag , vlanhwfilter , vlanhwcsum , vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, frame filtering in hardware, checksum offloading, or TSO on VLAN, @@ -592,7 +592,7 @@ Note that this must be configured on a physical interf not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwtso +.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso If the driver offers user-configurable VLAN support, disable reception of extended frames, tag processing in hardware, frame filtering in hardware, or TSO on VLAN, @@ -2696,7 +2696,7 @@ interfaces: Set the VLAN tag value to .Ar vlan_tag . This value is a 12-bit VLAN Identifier (VID) which is used to create an 802.1Q -VLAN header for packets sent from the +or 802.1ad VLAN header for packets sent from the .Xr vlan 4 interface. Note that @@ -2704,6 +2704,15 @@ Note that and .Cm vlandev must both be set at the same time. +.It Cm vlanproto Ar vlan_proto +Set the VLAN encapsulation protocol to +.Ar vlan_proto . +Supported encapsulation protocols are currently +.Dq 802.1Q +and +.Dq 802.1ad . +The default encapsulation protocol is +.Dq 802.1Q . .It Cm vlanpcp Ar priority_code_point Priority code point .Pq Dv PCP Modified: head/sbin/ifconfig/ifconfig.h ============================================================================== --- head/sbin/ifconfig/ifconfig.h Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifconfig.h Wed Oct 21 21:28:20 2020 (r366917) @@ -145,8 +145,10 @@ void printb(const char *s, unsigned value, const char void ifmaybeload(const char *name); +typedef int clone_match_func(const char *); typedef void clone_callback_func(int, struct ifreq *); -void clone_setdefcallback(const char *, clone_callback_func *); +void clone_setdefcallback_prefix(const char *, clone_callback_func *); +void clone_setdefcallback_filter(clone_match_func *, clone_callback_func *); void sfp_status(int s, struct ifreq *ifr, int verbose); Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifieee80211.c Wed Oct 21 21:28:20 2020 (r366917) @@ -6069,5 +6069,5 @@ ieee80211_ctor(void) for (i = 0; i < nitems(ieee80211_cmds); i++) cmd_register(&ieee80211_cmds[i]); af_register(&af_ieee80211); - clone_setdefcallback("wlan", wlan_create); + clone_setdefcallback_prefix("wlan", wlan_create); } Modified: head/sbin/ifconfig/ifvlan.c ============================================================================== --- head/sbin/ifconfig/ifvlan.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifvlan.c Wed Oct 21 21:28:20 2020 (r366917) @@ -66,8 +66,12 @@ static const char rcsid[] = #define NOTAG ((u_short) -1) +static const char proto_8021Q[] = "802.1q"; +static const char proto_8021ad[] = "802.1ad"; + static struct vlanreq params = { .vlr_tag = NOTAG, + .vlr_proto = ETHERTYPE_VLAN, }; static int @@ -87,6 +91,17 @@ vlan_status(int s) if (getvlan(s, &ifr, &vreq) == -1) return; printf("\tvlan: %d", vreq.vlr_tag); + printf(" vlanproto: "); + switch (vreq.vlr_proto) { + case ETHERTYPE_VLAN: + printf(proto_8021Q); + break; + case ETHERTYPE_QINQ: + printf(proto_8021ad); + break; + default: + printf("0x%04x", vreq.vlr_proto); + } if (ioctl(s, SIOCGVLANPCP, (caddr_t)&ifr) != -1) printf(" vlanpcp: %u", ifr.ifr_vlan_pcp); printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ? @@ -94,9 +109,49 @@ vlan_status(int s) printf("\n"); } +static int +vlan_match_ethervid(const char *name) +{ + return (strchr(name, '.') != NULL); +} + static void +vlan_parse_ethervid(const char *name) +{ + char ifname[IFNAMSIZ]; + char *cp; + int vid; + + strlcpy(ifname, name, IFNAMSIZ); + if ((cp = strrchr(ifname, '.')) == NULL) + return; + /* + * Don't mix vlan/vlandev parameters with dot notation. + */ + if (params.vlr_tag != NOTAG || params.vlr_parent[0] != '\0') + errx(1, "ambiguous vlan specification"); + /* + * Derive params from interface name: "parent.vid". + */ + *cp++ = '\0'; + if ((*cp < '1') || (*cp > '9')) + errx(1, "invalid vlan tag"); + + vid = *cp++ - '0'; + while ((*cp >= '0') && (*cp <= '9')) + vid = (vid * 10) + (*cp++ - '0'); + if ((*cp != '\0') || (vid & ~0xFFF)) + errx(1, "invalid vlan tag"); + + strlcpy(params.vlr_parent, ifname, IFNAMSIZ); + params.vlr_tag = (vid & 0xFFF); +} + +static void vlan_create(int s, struct ifreq *ifr) { + vlan_parse_ethervid(ifr->ifr_name); + if (params.vlr_tag != NOTAG || params.vlr_parent[0] != '\0') { /* * One or both parameters were specified, make sure both. @@ -159,6 +214,24 @@ DECL_CMD_FUNC(setvlandev, val, d) } static +DECL_CMD_FUNC(setvlanproto, val, d) +{ + struct vlanreq vreq; + + if (strncasecmp(proto_8021Q, val, + strlen(proto_8021Q)) == 0) { + params.vlr_proto = ETHERTYPE_VLAN; + } else if (strncasecmp(proto_8021ad, val, + strlen(proto_8021ad)) == 0) { + params.vlr_proto = ETHERTYPE_QINQ; + } else + errx(1, "invalid value for vlanproto"); + + if (getvlan(s, &ifr, &vreq) != -1) + vlan_set(s, &ifr); +} + +static DECL_CMD_FUNC(setvlanpcp, val, d) { u_long ul; @@ -195,10 +268,12 @@ DECL_CMD_FUNC(unsetvlandev, val, d) static struct cmd vlan_cmds[] = { DEF_CLONE_CMD_ARG("vlan", setvlantag), DEF_CLONE_CMD_ARG("vlandev", setvlandev), + DEF_CLONE_CMD_ARG("vlanproto", setvlanproto), DEF_CMD_ARG("vlanpcp", setvlanpcp), /* NB: non-clone cmds */ DEF_CMD_ARG("vlan", setvlantag), DEF_CMD_ARG("vlandev", setvlandev), + DEF_CMD_ARG("vlanproto", setvlanproto), /* XXX For compatibility. Should become DEF_CMD() some day. */ DEF_CMD_OPTARG("-vlandev", unsetvlandev), DEF_CMD("vlanmtu", IFCAP_VLAN_MTU, setifcap), @@ -227,5 +302,6 @@ vlan_ctor(void) cmd_register(&vlan_cmds[i]); af_register(&af_vlan); callback_register(vlan_cb, NULL); - clone_setdefcallback("vlan", vlan_create); + clone_setdefcallback_prefix("vlan", vlan_create); + clone_setdefcallback_filter(vlan_match_ethervid, vlan_create); } Modified: head/sbin/ifconfig/ifvxlan.c ============================================================================== --- head/sbin/ifconfig/ifvxlan.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sbin/ifconfig/ifvxlan.c Wed Oct 21 21:28:20 2020 (r366917) @@ -642,5 +642,5 @@ vxlan_ctor(void) cmd_register(&vxlan_cmds[i]); af_register(&af_vxlan); callback_register(vxlan_cb, NULL); - clone_setdefcallback("vxlan", vxlan_create); + clone_setdefcallback_prefix("vxlan", vxlan_create); } Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Wed Oct 21 20:42:29 2020 (r366916) +++ head/sys/net/ethernet.h Wed Oct 21 21:28:20 2020 (r366917) @@ -428,6 +428,7 @@ struct mbuf; struct route; struct sockaddr; struct bpf_if; +struct ether_8021q_tag; extern uint32_t ether_crc32_le(const uint8_t *, size_t); extern uint32_t ether_crc32_be(const uint8_t *, size_t); @@ -441,10 +442,16 @@ extern int ether_output_frame(struct ifnet *, struct extern char *ether_sprintf(const u_int8_t *); void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); -struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); -bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, - uint16_t vid, uint8_t pcp); +struct mbuf *ether_vlanencap_proto(struct mbuf *, uint16_t, uint16_t); +bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, + struct ifnet *p, struct ether_8021q_tag *); void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); + +static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag) +{ + + return ether_vlanencap_proto(m, tag, ETHERTYPE_VLAN); +} /* new ethernet interface attached event */ typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sys/net/if_clone.c Wed Oct 21 21:28:20 2020 (r366917) @@ -571,7 +571,7 @@ if_clone_addgroup(struct ifnet *ifp, struct if_clone * /* * A utility function to extract unit numbers from interface names of - * the form name###. + * the form name###[.###]. * * Returns 0 on success and an error on failure. */ @@ -582,7 +582,9 @@ ifc_name2unit(const char *name, int *unit) int cutoff = INT_MAX / 10; int cutlim = INT_MAX % 10; - for (cp = name; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++); + if ((cp = strrchr(name, '.')) == NULL) + cp = name; + for (; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++); if (*cp == '\0') { *unit = -1; } else if (cp[0] == '0' && cp[1] != '\0') { Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sys/net/if_ethersubr.c Wed Oct 21 21:28:20 2020 (r366917) @@ -441,12 +441,19 @@ bad: if (m != NULL) static bool ether_set_pcp(struct mbuf **mp, struct ifnet *ifp, uint8_t pcp) { + struct ether_8021q_tag qtag; struct ether_header *eh; eh = mtod(*mp, struct ether_header *); if (ntohs(eh->ether_type) == ETHERTYPE_VLAN || - ether_8021q_frame(mp, ifp, ifp, 0, pcp)) + ntohs(eh->ether_type) == ETHERTYPE_QINQ) return (true); + + qtag.vid = 0; + qtag.pcp = pcp; + qtag.proto = ETHERTYPE_VLAN; + if (ether_8021q_frame(mp, ifp, ifp, &qtag)) + return (true); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (false); } @@ -616,9 +623,9 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m * If the hardware did not process an 802.1Q tag, do this now, * to allow 802.1P priority frames to be passed to the main input * path correctly. - * TODO: Deal with Q-in-Q frames, but not arbitrary nesting levels. */ - if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_VLAN) { + if ((m->m_flags & M_VLANTAG) == 0 && + ((etype == ETHERTYPE_VLAN) || (etype == ETHERTYPE_QINQ))) { struct ether_vlan_header *evl; if (m->m_len < sizeof(*evl) && @@ -1303,7 +1310,7 @@ ether_vlan_mtap(struct bpf_if *bp, struct mbuf *m, voi } struct mbuf * -ether_vlanencap(struct mbuf *m, uint16_t tag) +ether_vlanencap_proto(struct mbuf *m, uint16_t tag, uint16_t proto) { struct ether_vlan_header *evl; @@ -1325,7 +1332,7 @@ ether_vlanencap(struct mbuf *m, uint16_t tag) evl = mtod(m, struct ether_vlan_header *); bcopy((char *)evl + ETHER_VLAN_ENCAP_LEN, (char *)evl, ETHER_HDR_LEN - ETHER_TYPE_LEN); - evl->evl_encap_proto = htons(ETHERTYPE_VLAN); + evl->evl_encap_proto = htons(proto); evl->evl_tag = htons(tag); return (m); } @@ -1354,7 +1361,7 @@ SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, - uint16_t vid, uint8_t pcp) + struct ether_8021q_tag *qtag) { struct m_tag *mtag; int n; @@ -1391,7 +1398,7 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, * If PCP is set in mbuf, use it */ if ((*mp)->m_flags & M_VLANTAG) { - pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); + qtag->pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); } /* @@ -1403,14 +1410,15 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, */ if (vlan_mtag_pcp && (mtag = m_tag_locate(*mp, MTAG_8021Q, MTAG_8021Q_PCP_OUT, NULL)) != NULL) - tag = EVL_MAKETAG(vid, *(uint8_t *)(mtag + 1), 0); + tag = EVL_MAKETAG(qtag->vid, *(uint8_t *)(mtag + 1), 0); else - tag = EVL_MAKETAG(vid, pcp, 0); - if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { + tag = EVL_MAKETAG(qtag->vid, qtag->pcp, 0); + if ((p->if_capenable & IFCAP_VLAN_HWTAGGING) && + (qtag->proto == ETHERTYPE_VLAN)) { (*mp)->m_pkthdr.ether_vtag = tag; (*mp)->m_flags |= M_VLANTAG; } else { - *mp = ether_vlanencap(*mp, tag); + *mp = ether_vlanencap_proto(*mp, tag, qtag->proto); if (*mp == NULL) { if_printf(ife, "unable to prepend 802.1Q header"); return (false); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Oct 21 20:42:29 2020 (r366916) +++ head/sys/net/if_vlan.c Wed Oct 21 21:28:20 2020 (r366917) @@ -17,7 +17,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF @@ -185,17 +185,17 @@ struct ifvlan { struct ifvlantrunk *ifv_trunk; struct ifnet *ifv_ifp; #define TRUNK(ifv) ((ifv)->ifv_trunk) -#define PARENT(ifv) ((ifv)->ifv_trunk->parent) +#define PARENT(ifv) (TRUNK(ifv)->parent) void *ifv_cookie; int ifv_pflags; /* special flags we have set on parent */ int ifv_capenable; int ifv_encaplen; /* encapsulation length */ int ifv_mtufudge; /* MTU fudged by this much */ int ifv_mintu; /* min transmission unit */ - uint16_t ifv_proto; /* encapsulation ethertype */ - uint16_t ifv_tag; /* tag to apply on packets leaving if */ - uint16_t ifv_vid; /* VLAN ID */ - uint8_t ifv_pcp; /* Priority Code Point (PCP). */ + struct ether_8021q_tag ifv_qtag; +#define ifv_proto ifv_qtag.proto +#define ifv_vid ifv_qtag.vid +#define ifv_pcp ifv_qtag.pcp struct task lladdr_task; CK_SLIST_HEAD(, vlan_mc_entry) vlan_mc_listhead; #ifndef VLAN_ARRAY @@ -222,9 +222,9 @@ static eventhandler_tag ifdetach_tag; static eventhandler_tag iflladdr_tag; /* - * if_vlan uses two module-level synchronizations primitives to allow concurrent - * modification of vlan interfaces and (mostly) allow for vlans to be destroyed - * while they are being used for tx/rx. To accomplish this in a way that has + * if_vlan uses two module-level synchronizations primitives to allow concurrent + * modification of vlan interfaces and (mostly) allow for vlans to be destroyed + * while they are being used for tx/rx. To accomplish this in a way that has * acceptable performance and cooperation with other parts of the network stack * there is a non-sleepable epoch(9) and an sx(9). * @@ -244,7 +244,7 @@ static eventhandler_tag iflladdr_tag; static struct sx _VLAN_SX_ID; #define VLAN_LOCKING_INIT() \ - sx_init(&_VLAN_SX_ID, "vlan_sx") + sx_init_flags(&_VLAN_SX_ID, "vlan_sx", SX_RECURSE) #define VLAN_LOCKING_DESTROY() \ sx_destroy(&_VLAN_SX_ID) @@ -306,7 +306,8 @@ static int vlan_output(struct ifnet *ifp, struct mbuf const struct sockaddr *dst, struct route *ro); static void vlan_unconfig(struct ifnet *ifp); static void vlan_unconfig_locked(struct ifnet *ifp, int departing); -static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); +static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag, + uint16_t proto); static void vlan_link_state(struct ifnet *ifp); static void vlan_capabilities(struct ifvlan *ifv); static void vlan_trunk_capabilities(struct ifnet *ifp); @@ -760,7 +761,7 @@ vlan_pcp(struct ifnet *ifp, uint16_t *pcpp) /* * Return a driver specific cookie for this interface. Synchronization - * with setcookie must be provided by the driver. + * with setcookie must be provided by the driver. */ static void * vlan_cookie(struct ifnet *ifp) @@ -811,16 +812,6 @@ vlan_devat(struct ifnet *ifp, uint16_t vid) } /* - * Recalculate the cached VLAN tag exposed via the MIB. - */ -static void -vlan_tag_recalculate(struct ifvlan *ifv) -{ - - ifv->ifv_tag = EVL_MAKETAG(ifv->ifv_vid, ifv->ifv_pcp, 0); -} - -/* * VLAN support can be loaded as a module. The only place in the * system that's intimately aware of this is ether_input. We hook * into this code through vlan_input_p which is defined there and @@ -867,7 +858,7 @@ vlan_modevent(module_t mod, int type, void *data) #else "hash tables with chaining" #endif - + "\n"); break; case MOD_UNLOAD: @@ -926,7 +917,7 @@ VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_OR #endif /* - * Check for . style interface names. + * Check for .[. ...] style interface names. */ static struct ifnet * vlan_clone_match_ethervid(const char *name, int *vidp) @@ -937,7 +928,7 @@ vlan_clone_match_ethervid(const char *name, int *vidp) int vid; strlcpy(ifname, name, IFNAMSIZ); - if ((cp = strchr(ifname, '.')) == NULL) + if ((cp = strrchr(ifname, '.')) == NULL) return (NULL); *cp = '\0'; if ((ifp = ifunit_ref(ifname)) == NULL) @@ -990,6 +981,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, si int unit; int error; int vid; + uint16_t proto; struct ifvlan *ifv; struct ifnet *ifp; struct ifnet *p; @@ -998,14 +990,15 @@ vlan_clone_create(struct if_clone *ifc, char *name, si struct vlanreq vlr; static const u_char eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ + proto = ETHERTYPE_VLAN; + /* - * There are 3 (ugh) ways to specify the cloned device: + * There are two ways to specify the cloned device: * o pass a parameter block with the clone request. - * o specify parameters in the text of the clone device name * o specify no parameters and get an unattached device that * must be configured separately. - * The first technique is preferred; the latter two are - * supported for backwards compatibility. + * The first technique is preferred; the latter is supported + * for backwards compatibility. * * XXXRW: Note historic use of the word "tag" here. New ioctls may be * called for. @@ -1023,10 +1016,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, si return (error); } vid = vlr.vlr_tag; + proto = vlr.vlr_proto; wildcard = (unit < 0); - } else if ((p = vlan_clone_match_ethervid(name, &vid)) != NULL) { - unit = -1; - wildcard = 0; } else { p = NULL; error = ifc_name2unit(name, &unit); @@ -1092,7 +1083,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, si sdl->sdl_type = IFT_L2VLAN; if (p != NULL) { - error = vlan_config(ifv, p, vid); + error = vlan_config(ifv, p, vid, proto); if_rele(p); if (error != 0) { /* @@ -1117,8 +1108,10 @@ static int vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { struct ifvlan *ifv = ifp->if_softc; - int unit = ifp->if_dunit; + if (ifp->if_vlantrunk) + return (EBUSY); + ether_ifdetach(ifp); /* first, remove it from system-wide lists */ vlan_unconfig(ifp); /* now it can be unconfigured and freed */ /* @@ -1130,7 +1123,7 @@ vlan_clone_destroy(struct if_clone *ifc, struct ifnet NET_EPOCH_WAIT(); if_free(ifp); free(ifv, M_VLAN); - ifc_free_unit(ifc, unit); + ifc_free_unit(ifc, ifp->if_dunit); return (0); } @@ -1196,7 +1189,7 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m) return (ENETDOWN); } - if (!ether_8021q_frame(&m, ifp, p, ifv->ifv_vid, ifv->ifv_pcp)) { + if (!ether_8021q_frame(&m, ifp, p, &ifv->ifv_qtag)) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (0); } @@ -1223,12 +1216,19 @@ vlan_output(struct ifnet *ifp, struct mbuf *m, const s NET_EPOCH_ASSERT(); + /* + * Find the first non-VLAN parent interface. + */ ifv = ifp->if_softc; - if (TRUNK(ifv) == NULL) { - m_freem(m); - return (ENETDOWN); - } - p = PARENT(ifv); + do { + if (TRUNK(ifv) == NULL) { + m_freem(m); + return (ENETDOWN); + } + p = PARENT(ifv); + ifv = p->if_softc; + } while (p->if_type == IFT_L2VLAN); + return p->if_output(ifp, m, dst, ro); } @@ -1357,7 +1357,8 @@ vlan_lladdr_fn(void *arg, int pending __unused) } static int -vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid) +vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid, + uint16_t proto) { struct epoch_tracker et; struct ifvlantrunk *trunk; @@ -1369,6 +1370,7 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint1 * they handle the tagging and headers themselves. */ if (p->if_type != IFT_ETHER && + p->if_type != IFT_L2VLAN && (p->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) return (EPROTONOSUPPORT); if ((p->if_flags & VLAN_IFFLAGS) != VLAN_IFFLAGS) @@ -1400,11 +1402,10 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint1 ifv->ifv_vid = vid; /* must set this before vlan_inshash() */ ifv->ifv_pcp = 0; /* Default: best effort delivery. */ - vlan_tag_recalculate(ifv); error = vlan_inshash(trunk, ifv); if (error) goto done; - ifv->ifv_proto = ETHERTYPE_VLAN; + ifv->ifv_proto = proto; ifv->ifv_encaplen = ETHER_VLAN_ENCAP_LEN; ifv->ifv_mintu = ETHERMIN; ifv->ifv_pflags = 0; @@ -1915,7 +1916,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } oldmtu = ifp->if_mtu; - error = vlan_config(ifv, p, vlr.vlr_tag); + error = vlan_config(ifv, p, vlr.vlr_tag, vlr.vlr_proto); if_rele(p); /* @@ -1943,11 +1944,12 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data strlcpy(vlr.vlr_parent, PARENT(ifv)->if_xname, sizeof(vlr.vlr_parent)); vlr.vlr_tag = ifv->ifv_vid; + vlr.vlr_proto = ifv->ifv_proto; } VLAN_SUNLOCK(); error = copyout(&vlr, ifr_data_get_ptr(ifr), sizeof(vlr)); break; - + case SIOCSIFFLAGS: /* * We should propagate selected flags to the parent, @@ -2001,7 +2003,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data } ifv->ifv_pcp = ifr->ifr_vlan_pcp; ifp->if_pcp = ifv->ifv_pcp; - vlan_tag_recalculate(ifv); /* broadcast event about PCP change */ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_PCP); break; Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Wed Oct 21 20:42:29 2020 (r366916) +++ head/sys/net/if_vlan_var.h Wed Oct 21 21:28:20 2020 (r366917) @@ -69,6 +69,7 @@ struct vlanreq { char vlr_parent[IFNAMSIZ]; u_short vlr_tag; + u_short vlr_proto; }; #define SIOCSETVLAN SIOCSIFGENERIC #define SIOCGETVLAN SIOCGIFGENERIC @@ -122,6 +123,15 @@ struct vlanreq { #define MTAG_8021Q 1326104895 #define MTAG_8021Q_PCP_IN 0 /* Input priority. */ #define MTAG_8021Q_PCP_OUT 1 /* Output priority. */ + +/* + * 802.1q full tag. Proto and vid are stored in host byte order. + */ +struct ether_8021q_tag { + uint16_t proto; + uint16_t vid; + uint8_t pcp; +}; #define VLAN_CAPABILITIES(_ifp) do { \ if ((_ifp)->if_vlantrunk != NULL) \ Modified: head/tests/sys/net/if_vlan.sh ============================================================================== --- head/tests/sys/net/if_vlan.sh Wed Oct 21 20:42:29 2020 (r366916) +++ head/tests/sys/net/if_vlan.sh Wed Oct 21 21:28:20 2020 (r366917) @@ -36,7 +36,185 @@ basic_cleanup() vnet_cleanup } +# Simple Q-in-Q (802.1Q over 802.1ad) + +atf_test_case "qinq_simple" "cleanup" +qinq_simple_head() +{ + atf_set descr 'Simple Q-in-Q test (802.1Q over 802.1ad)' + atf_set require.user root +} + +qinq_simple_body() +{ + vnet_init + + epair_qinq=$(vnet_mkepair) + + vnet_mkjail jqinq0 ${epair_qinq}a + vnet_mkjail jqinq1 ${epair_qinq}b + + vlan5a=$(jexec jqinq0 ifconfig vlan create \ + vlandev ${epair_qinq}a vlan 5 vlanproto 802.1ad) + vlan42a=$(jexec jqinq0 ifconfig vlan create \ + vlandev ${vlan5a} vlan 42 vlanproto 802.1q) + jexec jqinq0 ifconfig ${epair_qinq}a up + jexec jqinq0 ifconfig ${vlan5a} up + jexec jqinq0 ifconfig ${vlan42a} 10.5.42.1/24 up + + vlan5b=$(jexec jqinq1 ifconfig vlan create \ + vlandev ${epair_qinq}b vlan 5 vlanproto 802.1ad) + vlan42b=$(jexec jqinq1 ifconfig vlan create \ + vlandev ${vlan5b} vlan 42 vlanproto 802.1q) + jexec jqinq1 ifconfig ${epair_qinq}b up + jexec jqinq1 ifconfig ${vlan5b} up + jexec jqinq1 ifconfig ${vlan42b} 10.5.42.2/24 up + + atf_check -s exit:0 -o ignore jexec jqinq1 ping -c 1 10.5.42.1 +} + +qinq_simple_cleanup() +{ + vnet_cleanup +} + +# Deep Q-in-Q (802.1Q over 802.1ad over 802.1ad) + +atf_test_case "qinq_deep" "cleanup" +qinq_deep_head() +{ + atf_set descr 'Deep Q-in-Q test (802.1Q over 802.1ad over 802.1ad)' + atf_set require.user root +} + +qinq_deep_body() +{ + vnet_init + + epair_qinq=$(vnet_mkepair) + + vnet_mkjail jqinq2 ${epair_qinq}a + vnet_mkjail jqinq3 ${epair_qinq}b + + vlan5a=$(jexec jqinq2 ifconfig vlan create \ + vlandev ${epair_qinq}a vlan 5 vlanproto 802.1ad) + vlan6a=$(jexec jqinq2 ifconfig vlan create \ + vlandev ${vlan5a} vlan 6 vlanproto 802.1ad) + vlan42a=$(jexec jqinq2 ifconfig vlan create \ + vlandev ${vlan6a} vlan 42 vlanproto 802.1q) + jexec jqinq2 ifconfig ${epair_qinq}a up + jexec jqinq2 ifconfig ${vlan5a} up + jexec jqinq2 ifconfig ${vlan6a} up + jexec jqinq2 ifconfig ${vlan42a} 10.6.42.1/24 up + + vlan5b=$(jexec jqinq3 ifconfig vlan create \ + vlandev ${epair_qinq}b vlan 5 vlanproto 802.1ad) + vlan6b=$(jexec jqinq3 ifconfig vlan create \ + vlandev ${vlan5b} vlan 6 vlanproto 802.1ad) + vlan42b=$(jexec jqinq3 ifconfig vlan create \ + vlandev ${vlan6b} vlan 42 vlanproto 802.1q) + jexec jqinq3 ifconfig ${epair_qinq}b up + jexec jqinq3 ifconfig ${vlan5b} up + jexec jqinq3 ifconfig ${vlan6b} up + jexec jqinq3 ifconfig ${vlan42b} 10.6.42.2/24 up + + atf_check -s exit:0 -o ignore jexec jqinq3 ping -c 1 10.6.42.1 +} + +qinq_deep_cleanup() +{ + vnet_cleanup +} + +# Legacy Q-in-Q (802.1Q over 802.1Q) + +atf_test_case "qinq_legacy" "cleanup" +qinq_legacy_head() +{ + atf_set descr 'Legacy Q-in-Q test (802.1Q over 802.1Q)' + atf_set require.user root +} + +qinq_legacy_body() +{ + vnet_init + + epair_qinq=$(vnet_mkepair) + + vnet_mkjail jqinq4 ${epair_qinq}a + vnet_mkjail jqinq5 ${epair_qinq}b + + vlan5a=$(jexec jqinq4 ifconfig vlan create \ + vlandev ${epair_qinq}a vlan 5) + vlan42a=$(jexec jqinq4 ifconfig vlan create \ + vlandev ${vlan5a} vlan 42) + jexec jqinq4 ifconfig ${epair_qinq}a up + jexec jqinq4 ifconfig ${vlan5a} up + jexec jqinq4 ifconfig ${vlan42a} 10.5.42.1/24 up + + vlan5b=$(jexec jqinq5 ifconfig vlan create \ + vlandev ${epair_qinq}b vlan 5) + vlan42b=$(jexec jqinq5 ifconfig vlan create \ + vlandev ${vlan5b} vlan 42) + jexec jqinq5 ifconfig ${epair_qinq}b up + jexec jqinq5 ifconfig ${vlan5b} up + jexec jqinq5 ifconfig ${vlan42b} 10.5.42.2/24 up + + atf_check -s exit:0 -o ignore jexec jqinq5 ping -c 1 10.5.42.1 +} + +qinq_legacy_cleanup() +{ + vnet_cleanup +} + +# Simple Q-in-Q with dot notation + +atf_test_case "qinq_dot" "cleanup" +qinq_dot_head() +{ + atf_set descr 'Simple Q-in-Q test with dot notation' + atf_set require.user root +} + +qinq_dot_body() +{ + vnet_init + + epair_qinq=$(vnet_mkepair) + + vnet_mkjail jqinq6 ${epair_qinq}a + vnet_mkjail jqinq7 ${epair_qinq}b + + jexec jqinq6 ifconfig vlan5 create \ + vlandev ${epair_qinq}a vlan 5 vlanproto 802.1ad + jexec jqinq6 ifconfig vlan5.42 create \ + vlanproto 802.1q + jexec jqinq6 ifconfig ${epair_qinq}a up + jexec jqinq6 ifconfig vlan5 up + jexec jqinq6 ifconfig vlan5.42 10.5.42.1/24 up + + vlan5b=$(jexec jqinq7 ifconfig vlan create \ + vlandev ${epair_qinq}b vlan 5 vlanproto 802.1ad) + vlan42b=$(jexec jqinq7 ifconfig vlan create \ + vlandev ${vlan5b} vlan 42 vlanproto 802.1q) + jexec jqinq7 ifconfig ${epair_qinq}b up + jexec jqinq7 ifconfig ${vlan5b} up + jexec jqinq7 ifconfig ${vlan42b} 10.5.42.2/24 up + + atf_check -s exit:0 -o ignore jexec jqinq7 ping -c 1 10.5.42.1 +} + +qinq_dot_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" + atf_add_test_case "qinq_simple" + atf_add_test_case "qinq_deep" + atf_add_test_case "qinq_legacy" + atf_add_test_case "qinq_dot" } From owner-svn-src-all@freebsd.org Wed Oct 21 21:40:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F8142E16C; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGkSL17hKz3ZPj; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A4DBC4B1; Wed, 21 Oct 2020 21:40:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09LLeXXD087132; Wed, 21 Oct 2020 21:40:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09LLeXIJ087131; Wed, 21 Oct 2020 21:40:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010212140.09LLeXIJ087131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Oct 2020 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366918 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 366918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 21:40:34 -0000 Author: kib Date: Wed Oct 21 21:40:33 2020 New Revision: 366918 URL: https://svnweb.freebsd.org/changeset/base/366918 Log: mmap(2): Document guard size for MAP_STACK and related EINVAL. Based on submission by: emaste Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26894 Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Wed Oct 21 21:28:20 2020 (r366917) +++ head/lib/libc/sys/mmap.2 Wed Oct 21 21:40:33 2020 (r366918) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd February 26, 2020 +.Dd October 21, 2020 .Dt MMAP 2 .Os .Sh NAME @@ -351,6 +351,8 @@ Stacks created with automatically grow. Guards prevent inadvertent use of the regions into which those stacks can grow without requiring mapping the whole stack in advance. +The size of the guard, in pages, is specified by sysctl +.Dv security.bsd.stack_guard_page . .El .Pp The @@ -451,6 +453,11 @@ or .Dv MAP_STACK was specified. At least one of these flags must be included. +.It Bq Er EINVAL +.Dv MAP_STACK +was specified and +.Va len +is less than or equal to the guard size. .It Bq Er EINVAL .Dv MAP_FIXED was specified and the From owner-svn-src-all@freebsd.org Thu Oct 22 01:03:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 137C1435C88; Thu, 22 Oct 2020 01:03:45 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGpym6ZYGz43gl; Thu, 22 Oct 2020 01:03:44 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6740EAEC; Thu, 22 Oct 2020 01:03:44 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09M13iti018964; Thu, 22 Oct 2020 01:03:44 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M13hDF018957; Thu, 22 Oct 2020 01:03:43 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010220103.09M13hDF018957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 22 Oct 2020 01:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366919 - vendor/tzdata/dist X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/dist X-SVN-Commit-Revision: 366919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 01:03:45 -0000 Author: philip Date: Thu Oct 22 01:03:43 2020 New Revision: 366919 URL: https://svnweb.freebsd.org/changeset/base/366919 Log: Import tzdata 2020d Modified: vendor/tzdata/dist/Makefile vendor/tzdata/dist/NEWS vendor/tzdata/dist/asia vendor/tzdata/dist/europe vendor/tzdata/dist/version Modified: vendor/tzdata/dist/Makefile ============================================================================== --- vendor/tzdata/dist/Makefile Wed Oct 21 21:40:33 2020 (r366918) +++ vendor/tzdata/dist/Makefile Thu Oct 22 01:03:43 2020 (r366919) @@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. - touch -md 2020-10-12T22:53:00Z \ + TZ=UTC0 touch -mt 202010122253.00 \ tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ Modified: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Wed Oct 21 21:40:33 2020 (r366918) +++ vendor/tzdata/dist/NEWS Thu Oct 22 01:03:43 2020 (r366919) @@ -1,5 +1,23 @@ News for the tz database +Release 2020d - 2020-10-21 11:24:13 -0700 + + Briefly: + Palestine ends DST earlier than predicted, on 2020-10-24. + + Changes to past and future timestamps + + Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31 + as previously predicted (thanks to Sharef Mustafa.) Its + 2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen + Thorsen.) Its 2015-10-23 transition was at 01:00 not 00:00, and + its spring 2020 transition was on March 28 at 00:00, not March 27 + (thanks to Pierre Cashon.) This affects Asia/Gaza and + Asia/Hebron. Assume future spring and fall transitions will be on + the Saturday preceding the last Sunday of March and October, + respectively. + + Release 2020c - 2020-10-16 11:15:53 -0700 Briefly: Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Wed Oct 21 21:40:33 2020 (r366918) +++ vendor/tzdata/dist/asia Thu Oct 22 01:03:43 2020 (r366919) @@ -3221,14 +3221,41 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharef Mustafa (2019-10-18): # Palestine summer time will end on midnight Oct 26th 2019 ... -# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # -# From Paul Eggert (2019-04-10): -# For now, guess spring-ahead transitions are March's last Friday at 00:00. +# From Steffen Thorsen (2020-10-20): +# Some sources such as these say, and display on clocks, that DST ended at +# midnight last year... +# https://www.amad.ps/ar/post/320006 # -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. +# From Tim Parenti (2020-10-20): +# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms +# a decision on (translated): "The start of the winter time in Palestine, by +# delaying the clock by sixty minutes, starting from midnight on Friday / +# Saturday corresponding to 26/10/2019." +# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948 +# From Sharef Mustafa (2020-10-20): +# As per the palestinian cabinet announcement yesterday , the day light saving +# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. +# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 + +# From Tim Parenti (2020-10-20): +# Predict future fall transitions at 01:00 on the Saturday preceding October's +# last Sunday (i.e., Sat>=24). This is consistent with our predictions since +# 2016, although the time of the change differed slightly in 2019. + +# From Pierre Cashon (2020-10-20): +# The summer time this year started on March 28 at 00:00. +# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ +# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284 +# The winter time in 2015 started on October 23 at 01:00. +# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY +# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 +# +# From Paul Eggert (2019-04-10): +# For now, guess spring-ahead transitions are at 00:00 on the Saturday +# preceding March's last Sunday (i.e., Sat>=24). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3243,10 +3270,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - -Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - +Rule Palestine 2007 only - Sep 13 2:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 - -Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2009 only - Sep 4 1:00 0 - Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2011 only - Apr 1 0:01 1:00 S @@ -3255,12 +3282,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - -Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S +Rule Palestine 2013 only - Sep 27 0:00 0 - +Rule Palestine 2014 only - Oct 24 0:00 0 - +Rule Palestine 2015 only - Mar 28 0:00 1:00 S +Rule Palestine 2015 only - Oct 23 1:00 0 - Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 max - Oct lastSat 1:00 0 - -Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2019 only - Mar 29 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - +Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Wed Oct 21 21:40:33 2020 (r366918) +++ vendor/tzdata/dist/europe Thu Oct 22 01:03:43 2020 (r366919) @@ -1029,17 +1029,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # Denmark, Faroe Islands, and Greenland # From Jesper Nørgaard Welen (2005-04-26): -# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law -# [introducing standard time] was in effect from 1894-01-01.... -# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL +# the law [introducing standard time] was in effect from 1894-01-01.... +# The page https://www.retsinformation.dk/eli/lta/1893/83 # confirms this, and states that the law was put forth 1893-03-29. # # The EU [actually, EEC and Euratom] treaty with effect from 1973: -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL +# https://www.retsinformation.dk/eli/lta/1972/21100 # # This provoked a new law from 1974 to make possible summer time changes # in subsequent decrees with the law -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL +# https://www.retsinformation.dk/eli/lta/1974/223 # # It seems however that no decree was set forward until 1980. I have # not found any decree, but in another related law, the effecting DST @@ -1051,7 +1050,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The law is about the management of the extra hour, concerning # working hours reported and effect on obligatory-rest rules (which # was suspended on that night): -# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL +# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267 # From Jesper Nørgaard Welen (2005-06-11): # The Herning Folkeblad (1980-09-26) reported that the night between Modified: vendor/tzdata/dist/version ============================================================================== --- vendor/tzdata/dist/version Wed Oct 21 21:40:33 2020 (r366918) +++ vendor/tzdata/dist/version Thu Oct 22 01:03:43 2020 (r366919) @@ -1 +1 @@ -2020c +2020d From owner-svn-src-all@freebsd.org Thu Oct 22 01:04:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1619435C34; Thu, 22 Oct 2020 01:04:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGpz74yJsz43kQ; Thu, 22 Oct 2020 01:04:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76610E876; Thu, 22 Oct 2020 01:04:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09M1439K019020; Thu, 22 Oct 2020 01:04:03 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M1430o019019; Thu, 22 Oct 2020 01:04:03 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010220104.09M1430o019019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 22 Oct 2020 01:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366920 - vendor/tzdata/tzdata2020d X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/tzdata2020d X-SVN-Commit-Revision: 366920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 01:04:03 -0000 Author: philip Date: Thu Oct 22 01:04:02 2020 New Revision: 366920 URL: https://svnweb.freebsd.org/changeset/base/366920 Log: Tag import of tzdata 2020d Added: vendor/tzdata/tzdata2020d/ - copied from r366919, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Thu Oct 22 01:05:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C444435E82; Thu, 22 Oct 2020 01:05:36 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGq0w1m0bz44CJ; Thu, 22 Oct 2020 01:05:36 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F897E739; Thu, 22 Oct 2020 01:05:36 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09M15atl019144; Thu, 22 Oct 2020 01:05:36 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M15ZGa019139; Thu, 22 Oct 2020 01:05:35 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010220105.09M15ZGa019139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 22 Oct 2020 01:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366921 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 366921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 01:05:36 -0000 Author: philip Date: Thu Oct 22 01:05:34 2020 New Revision: 366921 URL: https://svnweb.freebsd.org/changeset/base/366921 Log: Import tzdata 2020c Changes: https://github.com/eggert/tz/blob/2020d/NEWS MFC after: 1 day Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/asia head/contrib/tzdata/europe head/contrib/tzdata/version Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Thu Oct 22 01:04:02 2020 (r366920) +++ head/contrib/tzdata/Makefile Thu Oct 22 01:05:34 2020 (r366921) @@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. - touch -md 2020-10-12T22:53:00Z \ + TZ=UTC0 touch -mt 202010122253.00 \ tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Thu Oct 22 01:04:02 2020 (r366920) +++ head/contrib/tzdata/NEWS Thu Oct 22 01:05:34 2020 (r366921) @@ -1,5 +1,23 @@ News for the tz database +Release 2020d - 2020-10-21 11:24:13 -0700 + + Briefly: + Palestine ends DST earlier than predicted, on 2020-10-24. + + Changes to past and future timestamps + + Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31 + as previously predicted (thanks to Sharef Mustafa.) Its + 2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen + Thorsen.) Its 2015-10-23 transition was at 01:00 not 00:00, and + its spring 2020 transition was on March 28 at 00:00, not March 27 + (thanks to Pierre Cashon.) This affects Asia/Gaza and + Asia/Hebron. Assume future spring and fall transitions will be on + the Saturday preceding the last Sunday of March and October, + respectively. + + Release 2020c - 2020-10-16 11:15:53 -0700 Briefly: Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Oct 22 01:04:02 2020 (r366920) +++ head/contrib/tzdata/asia Thu Oct 22 01:05:34 2020 (r366921) @@ -3221,14 +3221,41 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharef Mustafa (2019-10-18): # Palestine summer time will end on midnight Oct 26th 2019 ... -# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # -# From Paul Eggert (2019-04-10): -# For now, guess spring-ahead transitions are March's last Friday at 00:00. +# From Steffen Thorsen (2020-10-20): +# Some sources such as these say, and display on clocks, that DST ended at +# midnight last year... +# https://www.amad.ps/ar/post/320006 # -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. +# From Tim Parenti (2020-10-20): +# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms +# a decision on (translated): "The start of the winter time in Palestine, by +# delaying the clock by sixty minutes, starting from midnight on Friday / +# Saturday corresponding to 26/10/2019." +# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948 +# From Sharef Mustafa (2020-10-20): +# As per the palestinian cabinet announcement yesterday , the day light saving +# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. +# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 + +# From Tim Parenti (2020-10-20): +# Predict future fall transitions at 01:00 on the Saturday preceding October's +# last Sunday (i.e., Sat>=24). This is consistent with our predictions since +# 2016, although the time of the change differed slightly in 2019. + +# From Pierre Cashon (2020-10-20): +# The summer time this year started on March 28 at 00:00. +# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ +# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284 +# The winter time in 2015 started on October 23 at 01:00. +# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY +# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 +# +# From Paul Eggert (2019-04-10): +# For now, guess spring-ahead transitions are at 00:00 on the Saturday +# preceding March's last Sunday (i.e., Sat>=24). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3243,10 +3270,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - -Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - +Rule Palestine 2007 only - Sep 13 2:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 - -Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2009 only - Sep 4 1:00 0 - Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2011 only - Apr 1 0:01 1:00 S @@ -3255,12 +3282,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - -Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S +Rule Palestine 2013 only - Sep 27 0:00 0 - +Rule Palestine 2014 only - Oct 24 0:00 0 - +Rule Palestine 2015 only - Mar 28 0:00 1:00 S +Rule Palestine 2015 only - Oct 23 1:00 0 - Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 max - Oct lastSat 1:00 0 - -Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2019 only - Mar 29 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - +Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Thu Oct 22 01:04:02 2020 (r366920) +++ head/contrib/tzdata/europe Thu Oct 22 01:05:34 2020 (r366921) @@ -1029,17 +1029,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # Denmark, Faroe Islands, and Greenland # From Jesper Nørgaard Welen (2005-04-26): -# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law -# [introducing standard time] was in effect from 1894-01-01.... -# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL +# the law [introducing standard time] was in effect from 1894-01-01.... +# The page https://www.retsinformation.dk/eli/lta/1893/83 # confirms this, and states that the law was put forth 1893-03-29. # # The EU [actually, EEC and Euratom] treaty with effect from 1973: -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL +# https://www.retsinformation.dk/eli/lta/1972/21100 # # This provoked a new law from 1974 to make possible summer time changes # in subsequent decrees with the law -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL +# https://www.retsinformation.dk/eli/lta/1974/223 # # It seems however that no decree was set forward until 1980. I have # not found any decree, but in another related law, the effecting DST @@ -1051,7 +1050,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The law is about the management of the extra hour, concerning # working hours reported and effect on obligatory-rest rules (which # was suspended on that night): -# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL +# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267 # From Jesper Nørgaard Welen (2005-06-11): # The Herning Folkeblad (1980-09-26) reported that the night between Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Thu Oct 22 01:04:02 2020 (r366920) +++ head/contrib/tzdata/version Thu Oct 22 01:05:34 2020 (r366921) @@ -1 +1 @@ -2020c +2020d From owner-svn-src-all@freebsd.org Thu Oct 22 01:08:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73689435EC2; Thu, 22 Oct 2020 01:08:02 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGq3k2RXNz442n; Thu, 22 Oct 2020 01:08:02 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [IPv6:2a00:1098:82:3a::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 21227118E1; Thu, 22 Oct 2020 01:08:02 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [95.216.22.234]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 4CGq3h1k7mz1dMQ; Thu, 22 Oct 2020 01:08:00 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 4CGq3g5MWpz4wPt; Thu, 22 Oct 2020 01:07:59 +0000 (UTC) Date: Thu, 22 Oct 2020 09:07:59 +0800 From: Philip Paeps To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366921 - head/contrib/tzdata Message-ID: <20201022010759.GK44806@rincewind.trouble.is> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010220105.09M15ZGa019139@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <202010220105.09M15ZGa019139@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Setting Orange, the 3rd day of The Aftermath in the YOLD 3186 X-Phase-of-Moon: The Moon is Waxing Crescent (35% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 01:08:02 -0000 On 2020-10-22 01:05:35 (+0000), Philip Paeps wrote: >Author: philip >Date: Thu Oct 22 01:05:34 2020 >New Revision: 366921 >URL: https://svnweb.freebsd.org/changeset/base/366921 > >Log: > Import tzdata 2020c > > Changes: https://github.com/eggert/tz/blob/2020d/NEWS Argh. Import tzdata 2020d of course. I got the link right at least. While it feels like a lot of churn in tzdata land recently, the actual changes are very small. Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises From owner-svn-src-all@freebsd.org Thu Oct 22 03:30:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A86D843C92C; Thu, 22 Oct 2020 03:30:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGtDJ42wLz4GZJ; Thu, 22 Oct 2020 03:30:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EE86102D4; Thu, 22 Oct 2020 03:30:40 +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 09M3UeC8017301; Thu, 22 Oct 2020 03:30:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M3UdgL017298; Thu, 22 Oct 2020 03:30:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010220330.09M3UdgL017298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Oct 2020 03:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366922 - in head/sys/dev: ahci mvs siis X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: ahci mvs siis X-SVN-Commit-Revision: 366922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 03:30:40 -0000 Author: mav Date: Thu Oct 22 03:30:39 2020 New Revision: 366922 URL: https://svnweb.freebsd.org/changeset/base/366922 Log: Pass lower 3 bits of sector_count for FPDMA commands. When this code was written those bits were N/A, but now the lowest bit is Rebuild Assist Recovery Control (RARC). MFC after: 1 month Modified: head/sys/dev/ahci/ahci.c head/sys/dev/mvs/mvs.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Oct 22 01:05:34 2020 (r366921) +++ head/sys/dev/ahci/ahci.c Thu Oct 22 03:30:39 2020 (r366922) @@ -2578,10 +2578,10 @@ ahci_setup_fis(struct ahci_channel *ch, struct ahci_cm fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - } else { - fis[12] = ccb->ataio.cmd.sector_count; + fis[12] &= 0xf8; + fis[12] |= tag << 3; } fis[13] = ccb->ataio.cmd.sector_count_exp; fis[15] = ATA_A_4BIT; Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Thu Oct 22 01:05:34 2020 (r366921) +++ head/sys/dev/mvs/mvs.c Thu Oct 22 03:30:39 2020 (r366922) @@ -1493,7 +1493,8 @@ mvs_execute_transaction(struct mvs_slot *slot) crqb->cmd[i++] = ccb->ataio.cmd.features; crqb->cmd[i++] = 0x11; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - crqb->cmd[i++] = slot->tag << 3; + crqb->cmd[i++] = (slot->tag << 3) | + (ccb->ataio.cmd.sector_count & 0x07); crqb->cmd[i++] = 0x12; } else { crqb->cmd[i++] = ccb->ataio.cmd.sector_count_exp; Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Thu Oct 22 01:05:34 2020 (r366921) +++ head/sys/dev/siis/siis.c Thu Oct 22 03:30:39 2020 (r366922) @@ -1723,13 +1723,12 @@ siis_setup_fis(device_t dev, struct siis_cmd *ctp, uni fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - fis[13] = 0; - } else { - fis[12] = ccb->ataio.cmd.sector_count; - fis[13] = ccb->ataio.cmd.sector_count_exp; + fis[12] &= 0xf8; + fis[12] |= tag << 3; } + fis[13] = ccb->ataio.cmd.sector_count_exp; fis[15] = ATA_A_4BIT; if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { fis[16] = ccb->ataio.aux & 0xff; From owner-svn-src-all@freebsd.org Thu Oct 22 04:49:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DE5A43D74E; Thu, 22 Oct 2020 04:49:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGvyy6J2nz4KnB; Thu, 22 Oct 2020 04:49:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9AB1159F; Thu, 22 Oct 2020 04:49:14 +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 09M4nEmD065164; Thu, 22 Oct 2020 04:49:14 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M4nEXI065163; Thu, 22 Oct 2020 04:49:14 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202010220449.09M4nEXI065163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 22 Oct 2020 04:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366923 - head/sys/crypto/armv8 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/crypto/armv8 X-SVN-Commit-Revision: 366923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 04:49:15 -0000 Author: gonzo Date: Thu Oct 22 04:49:14 2020 New Revision: 366923 URL: https://svnweb.freebsd.org/changeset/base/366923 Log: [armv8crypto] Fix cryptodev probe logic in armv8crypto Add missing break to prevent falling through to the default case statement and returning EINVAL for all session configs. Sponsored by: Ampere Computing Submitted by: Klara, Inc. Modified: head/sys/crypto/armv8/armv8_crypto.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Thu Oct 22 03:30:39 2020 (r366922) +++ head/sys/crypto/armv8/armv8_crypto.c Thu Oct 22 04:49:14 2020 (r366923) @@ -207,6 +207,7 @@ armv8_crypto_probesession(device_t dev, default: return (EINVAL); } + break; default: return (EINVAL); } From owner-svn-src-all@freebsd.org Thu Oct 22 05:07:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B4D143DA6B; Thu, 22 Oct 2020 05:07:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CGwMy12vXz4LJg; Thu, 22 Oct 2020 05:07:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02C49114F9; Thu, 22 Oct 2020 05:07:26 +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 09M57PRZ077213; Thu, 22 Oct 2020 05:07:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M57PXf077212; Thu, 22 Oct 2020 05:07:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202010220507.09M57PXf077212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 22 Oct 2020 05:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366924 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 366924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 05:07:26 -0000 Author: gonzo Date: Thu Oct 22 05:07:25 2020 New Revision: 366924 URL: https://svnweb.freebsd.org/changeset/base/366924 Log: [hwpmc] Fix call chain capture for ARM64 Use ELR register value instead of LR for PMC_TRAPFRAME_TO_PC macro since it's the former that indicates PC if the interrupted execution thread. This fixes a bug where pmcstat lost the leaf function of the call chain and started with the second function in the chain. Although this change is an improvement over the previous logic there is still posibility for incomplete data: if the leaf function does not have stack variables and does not call any other functions compiler would not generate a stack frame for it and the FP value would point to the caller's frame, so instead of the actual "caller1 -> caller2 -> leaf" chain only "caller1 -> leaf" would be captured. Sponsored by: Ampere Computing Submitted by: Klara, Inc. Modified: head/sys/arm64/include/pmc_mdep.h Modified: head/sys/arm64/include/pmc_mdep.h ============================================================================== --- head/sys/arm64/include/pmc_mdep.h Thu Oct 22 04:49:14 2020 (r366923) +++ head/sys/arm64/include/pmc_mdep.h Thu Oct 22 05:07:25 2020 (r366924) @@ -54,7 +54,7 @@ union pmc_md_pmc { ((S) >= (START) && (S) < (END)) #define PMC_IN_KERNEL(va) INKERNEL((va)) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) -#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_lr) +#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->tf_elr) #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_x[29]) /* From owner-svn-src-all@freebsd.org Thu Oct 22 08:40:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C36D9442A16; Thu, 22 Oct 2020 08:40:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH15k4mXfz4YKr; Thu, 22 Oct 2020 08:40:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 881931411D; Thu, 22 Oct 2020 08:40:26 +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 09M8eQ1J008097; Thu, 22 Oct 2020 08:40:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M8ePsI008093; Thu, 22 Oct 2020 08:40:25 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010220840.09M8ePsI008093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 22 Oct 2020 08:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366929 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 08:40:26 -0000 Author: np Date: Thu Oct 22 08:40:25 2020 New Revision: 366929 URL: https://svnweb.freebsd.org/changeset/base/366929 Log: cxgbe(4): fix the size of the iq/eq maps. The firmware can allocate ingress and egress context ids anywhere from its configured range. Size the iq/eq maps to match the entire range instead of assuming that the firmware always allocates the first available context id. Reported by: Baptiste Wicht @ Verisign MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Oct 22 06:51:47 2020 (r366928) +++ head/sys/dev/cxgbe/adapter.h Thu Oct 22 08:40:25 2020 (r366929) @@ -799,6 +799,8 @@ struct sge { uint16_t iq_base; /* first abs_id */ int eq_start; /* first cntxt_id */ int eq_base; /* first abs_id */ + int iqmap_sz; + int eqmap_sz; struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 22 06:51:47 2020 (r366928) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 22 08:40:25 2020 (r366929) @@ -1358,6 +1358,8 @@ t4_attach(device_t dev) s->nm_txq = malloc(s->nnmtxq * sizeof(struct sge_nm_txq), M_CXGBE, M_ZERO | M_WAITOK); #endif + MPASS(s->niq <= s->iqmap_sz); + MPASS(s->neq <= s->eqmap_sz); s->ctrlq = malloc(nports * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); @@ -1365,9 +1367,9 @@ t4_attach(device_t dev) M_ZERO | M_WAITOK); s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE, M_ZERO | M_WAITOK); - s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE, + s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE, M_ZERO | M_WAITOK); - s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE, + s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE, M_ZERO | M_WAITOK); sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE, @@ -4456,6 +4458,19 @@ get_params__post_init(struct adapter *sc) ("%s: L2 table size (%u) larger than expected (%u)", __func__, sc->vres.l2t.size, L2T_SIZE)); sc->params.core_vdd = val[6]; + + param[0] = FW_PARAM_PFVF(IQFLINT_END); + param[1] = FW_PARAM_PFVF(EQ_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query parameters (post_init2): %d.\n", rc); + return (rc); + } + MPASS(val[0] >= sc->sge.iq_start); + sc->sge.iqmap_sz = val[0] - sc->sge.iq_start + 1; + MPASS(val[1] >= sc->sge.eq_start); + sc->sge.eqmap_sz = val[1] - sc->sge.eq_start + 1; if (chip_id(sc) >= CHELSIO_T6) { Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Oct 22 06:51:47 2020 (r366928) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Oct 22 08:40:25 2020 (r366929) @@ -188,9 +188,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq nm_rxq->iq_cntxt_id = be16toh(c.iqid); nm_rxq->iq_abs_id = be16toh(c.physiqid); cntxt_id = nm_rxq->iq_cntxt_id - sc->sge.iq_start; - if (cntxt_id >= sc->sge.niq) { + if (cntxt_id >= sc->sge.iqmap_sz) { panic ("%s: nm_rxq->iq_cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.niq - 1); + __func__, cntxt_id, sc->sge.iqmap_sz - 1); } sc->sge.iqmap[cntxt_id] = (void *)nm_rxq; @@ -201,9 +201,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4; MPASS(nm_rxq->fl_sidx == na->num_rx_desc); cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) { + if (cntxt_id >= sc->sge.eqmap_sz) { panic("%s: nm_rxq->fl_cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.neq - 1); + __func__, cntxt_id, sc->sge.eqmap_sz - 1); } sc->sge.eqmap[cntxt_id] = (void *)nm_rxq; @@ -300,9 +300,9 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq nm_txq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd)); cntxt_id = nm_txq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: nm_txq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = (void *)nm_txq; nm_txq->pidx = nm_txq->cidx = 0; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Oct 22 06:51:47 2020 (r366928) +++ head/sys/dev/cxgbe/t4_sge.c Thu Oct 22 08:40:25 2020 (r366929) @@ -3567,9 +3567,9 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str iq->flags |= IQ_ALLOCATED; cntxt_id = iq->cntxt_id - sc->sge.iq_start; - if (cntxt_id >= sc->sge.niq) { + if (cntxt_id >= sc->sge.iqmap_sz) { panic ("%s: iq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.niq - 1); + cntxt_id, sc->sge.iqmap_sz - 1); } sc->sge.iqmap[cntxt_id] = iq; @@ -3581,9 +3581,9 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str fl->pidx = fl->cidx = 0; cntxt_id = fl->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) { + if (cntxt_id >= sc->sge.eqmap_sz) { panic("%s: fl->cntxt_id (%d) more than the max (%d)", - __func__, cntxt_id, sc->sge.neq - 1); + __func__, cntxt_id, sc->sge.eqmap_sz - 1); } sc->sge.eqmap[cntxt_id] = (void *)fl; @@ -4152,9 +4152,9 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) eq->cntxt_id = G_FW_EQ_CTRL_CMD_EQID(be32toh(c.cmpliqid_eqid)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); @@ -4198,9 +4198,9 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, s eq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd)); eq->abs_id = G_FW_EQ_ETH_CMD_PHYSEQID(be32toh(c.physeqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); @@ -4243,9 +4243,9 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, eq->cntxt_id = G_FW_EQ_OFLD_CMD_EQID(be32toh(c.eqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; - if (cntxt_id >= sc->sge.neq) + if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, - cntxt_id, sc->sge.neq - 1); + cntxt_id, sc->sge.eqmap_sz - 1); sc->sge.eqmap[cntxt_id] = eq; return (rc); From owner-svn-src-all@freebsd.org Thu Oct 22 09:09:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5909D4432C4; Thu, 22 Oct 2020 09:09:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH1ll1zTNz4b3P; Thu, 22 Oct 2020 09: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A57143FC; Thu, 22 Oct 2020 09:09:55 +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 09M99tnM026751; Thu, 22 Oct 2020 09:09:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M99r3D026742; Thu, 22 Oct 2020 09:09:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010220909.09M99r3D026742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 09:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366930 - in head/sys: conf modules modules/if_infiniband net ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf modules modules/if_infiniband net ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 366930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 09:09:55 -0000 Author: hselasky Date: Thu Oct 22 09:09:53 2020 New Revision: 366930 URL: https://svnweb.freebsd.org/changeset/base/366930 Log: Factor out generic IP over infiniband, IPoIB, definitions and code into net/if_infiniband.c and net/infiniband.h . No functional change intended. Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Added: head/sys/modules/if_infiniband/ head/sys/modules/if_infiniband/Makefile (contents, props changed) head/sys/net/if_infiniband.c (contents, props changed) head/sys/net/infiniband.h (contents, props changed) Modified: head/sys/conf/files head/sys/modules/Makefile head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/conf/files Thu Oct 22 09:09:53 2020 (r366930) @@ -4571,6 +4571,7 @@ compat/lindebugfs/lindebugfs.c optional lindebugfs \ compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) +net/if_infiniband.c optional ofed ofed/drivers/infiniband/core/ib_addr.c optional ofed \ compile-with "${OFED_C}" ofed/drivers/infiniband/core/ib_agent.c optional ofed \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/modules/Makefile Thu Oct 22 09:09:53 2020 (r366930) @@ -154,6 +154,7 @@ SUBDIR= \ ${_if_gif} \ ${_if_gre} \ ${_if_me} \ + if_infiniband \ if_lagg \ ${_if_ndis} \ ${_if_stf} \ Added: head/sys/modules/if_infiniband/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/if_infiniband/Makefile Thu Oct 22 09:09:53 2020 (r366930) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/net + +KMOD= if_infiniband +SRCS= if_infiniband.c \ + opt_inet.h \ + opt_inet6.h + +.include Added: head/sys/net/if_infiniband.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/if_infiniband.c Thu Oct 22 09:09:53 2020 (r366930) @@ -0,0 +1,538 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies. 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 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 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 "opt_inet.h" +#include "opt_inet6.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#ifdef INET +static inline void +infiniband_ipv4_multicast_map(uint32_t addr, + const uint8_t *broadcast, uint8_t *buf) +{ + uint8_t scope; + + addr = ntohl(addr); + scope = broadcast[5] & 0xF; + + buf[0] = 0; + buf[1] = 0xff; + buf[2] = 0xff; + buf[3] = 0xff; + buf[4] = 0xff; + buf[5] = 0x10 | scope; + buf[6] = 0x40; + buf[7] = 0x1b; + buf[8] = broadcast[8]; + buf[9] = broadcast[9]; + buf[10] = 0; + buf[11] = 0; + buf[12] = 0; + buf[13] = 0; + buf[14] = 0; + buf[15] = 0; + buf[16] = (addr >> 24) & 0xff; + buf[17] = (addr >> 16) & 0xff; + buf[18] = (addr >> 8) & 0xff; + buf[19] = addr & 0xff; +} +#endif + +#ifdef INET6 +static inline void +infiniband_ipv6_multicast_map(const struct in6_addr *addr, + const uint8_t *broadcast, uint8_t *buf) +{ + uint8_t scope; + + scope = broadcast[5] & 0xF; + + buf[0] = 0; + buf[1] = 0xff; + buf[2] = 0xff; + buf[3] = 0xff; + buf[4] = 0xff; + buf[5] = 0x10 | scope; + buf[6] = 0x60; + buf[7] = 0x1b; + buf[8] = broadcast[8]; + buf[9] = broadcast[9]; + memcpy(&buf[10], &addr->s6_addr[6], 10); +} +#endif + +/* + * This is for clients that have an infiniband_header in the mbuf. + */ +void +infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb) +{ + struct infiniband_header *ibh; + struct ether_header eh; + + if (mb->m_len < sizeof(*ibh)) + return; + + ibh = mtod(mb, struct infiniband_header *); + eh.ether_type = ibh->ib_protocol; + memset(eh.ether_shost, 0, ETHER_ADDR_LEN); + memcpy(eh.ether_dhost, ibh->ib_hwaddr + 4, ETHER_ADDR_LEN); + mb->m_data += sizeof(*ibh); + mb->m_len -= sizeof(*ibh); + mb->m_pkthdr.len -= sizeof(*ibh); + bpf_mtap2(ifp->if_bpf, &eh, sizeof(eh), mb); + mb->m_data -= sizeof(*ibh); + mb->m_len += sizeof(*ibh); + mb->m_pkthdr.len += sizeof(*ibh); +} + +/* + * Infiniband output routine. + */ +static int +infiniband_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, + struct route *ro) +{ + uint8_t edst[INFINIBAND_ADDR_LEN]; +#if defined(INET) || defined(INET6) + struct llentry *lle = NULL; +#endif + struct infiniband_header *ibh; + int error = 0; + uint16_t type; + bool is_gw; + + NET_EPOCH_ASSERT(); + + is_gw = ((ro != NULL) && (ro->ro_flags & RT_HAS_GW) != 0); + +#ifdef MAC + error = mac_ifnet_check_transmit(ifp, m); + if (error) + goto bad; +#endif + + M_PROFILE(m); + if (ifp->if_flags & IFF_MONITOR) { + error = ENETDOWN; + goto bad; + } + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { + error = ENETDOWN; + goto bad; + } + + switch (dst->sa_family) { + case AF_LINK: + goto output; +#ifdef INET + case AF_INET: + if (lle != NULL && (lle->la_flags & LLE_VALID)) { + memcpy(edst, lle->ll_addr, sizeof(edst)); + } else if (m->m_flags & M_MCAST) { + infiniband_ipv4_multicast_map( + ((const struct sockaddr_in *)dst)->sin_addr.s_addr, + ifp->if_broadcastaddr, edst); + } else { + error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); + if (error) { + if (error == EWOULDBLOCK) + error = 0; + m = NULL; /* mbuf is consumed by resolver */ + goto bad; + } + } + type = htons(ETHERTYPE_IP); + break; + case AF_ARP: { + struct arphdr *ah; + + if (m->m_len < sizeof(*ah)) { + error = EINVAL; + goto bad; + } + + ah = mtod(m, struct arphdr *); + + if (m->m_len < arphdr_len(ah)) { + error = EINVAL; + goto bad; + } + ah->ar_hrd = htons(ARPHRD_INFINIBAND); + + switch (ntohs(ah->ar_op)) { + case ARPOP_REVREQUEST: + case ARPOP_REVREPLY: + type = htons(ETHERTYPE_REVARP); + break; + case ARPOP_REQUEST: + case ARPOP_REPLY: + default: + type = htons(ETHERTYPE_ARP); + break; + } + + if (m->m_flags & M_BCAST) { + memcpy(edst, ifp->if_broadcastaddr, INFINIBAND_ADDR_LEN); + } else { + if (ah->ar_hln != INFINIBAND_ADDR_LEN) { + error = EINVAL; + goto bad; + } + memcpy(edst, ar_tha(ah), INFINIBAND_ADDR_LEN); + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: { + const struct ip6_hdr *ip6; + + ip6 = mtod(m, const struct ip6_hdr *); + if (m->m_len < sizeof(*ip6)) { + error = EINVAL; + goto bad; + } else if (lle != NULL && (lle->la_flags & LLE_VALID)) { + memcpy(edst, lle->ll_addr, sizeof(edst)); + } else if (m->m_flags & M_MCAST) { + infiniband_ipv6_multicast_map( + &((const struct sockaddr_in6 *)dst)->sin6_addr, + ifp->if_broadcastaddr, edst); + } else if (ip6->ip6_nxt == IPPROTO_ICMPV6) { + memcpy(edst, ifp->if_broadcastaddr, INFINIBAND_ADDR_LEN); + } else { + error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, NULL); + if (error) { + if (error == EWOULDBLOCK) + error = 0; + m = NULL; /* mbuf is consumed by resolver */ + goto bad; + } + } + type = htons(ETHERTYPE_IPV6); + break; + } +#endif + default: + error = EAFNOSUPPORT; + goto bad; + } + + /* + * Add local net header. If no space in first mbuf, + * allocate another. + */ + M_PREPEND(m, INFINIBAND_HDR_LEN, M_NOWAIT); + if (m == NULL) { + error = ENOBUFS; + goto bad; + } + ibh = mtod(m, struct infiniband_header *); + + ibh->ib_protocol = type; + memcpy(ibh->ib_hwaddr, edst, sizeof(edst)); + + /* + * Queue message on interface, update output statistics if + * successful, and start output if interface not yet active. + */ +output: + return (ifp->if_transmit(ifp, m)); +bad: + if (m != NULL) + m_freem(m); + return (error); +} + +/* + * Process a received Infiniband packet. + */ +static void +infiniband_input(struct ifnet *ifp, struct mbuf *m) +{ + struct infiniband_header *ibh; + struct epoch_tracker et; + int isr; + + CURVNET_SET_QUIET(ifp->if_vnet); + + if ((ifp->if_flags & IFF_UP) == 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + goto done; + } + + ibh = mtod(m, struct infiniband_header *); + + /* + * Reset layer specific mbuf flags to avoid confusing upper + * layers: + */ + m->m_flags &= ~M_VLANTAG; + m_clrprotoflags(m); + + if (INFINIBAND_IS_MULTICAST(ibh->ib_hwaddr)) { + if (memcmp(ibh->ib_hwaddr, ifp->if_broadcastaddr, + ifp->if_addrlen) == 0) + m->m_flags |= M_BCAST; + else + m->m_flags |= M_MCAST; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); + } + + /* Let BPF have it before we strip the header. */ + INFINIBAND_BPF_MTAP(ifp, m); + + /* Allow monitor mode to claim this frame, after stats are updated. */ + if (ifp->if_flags & IFF_MONITOR) { + m_freem(m); + goto done; + } + + /* Direct packet to correct FIB based on interface config. */ + M_SETFIB(m, ifp->if_fib); + + /* + * Dispatch frame to upper layer. + */ + switch (ibh->ib_protocol) { +#ifdef INET + case htons(ETHERTYPE_IP): + isr = NETISR_IP; + break; + + case htons(ETHERTYPE_ARP): + if (ifp->if_flags & IFF_NOARP) { + /* Discard packet if ARP is disabled on interface */ + m_freem(m); + goto done; + } + isr = NETISR_ARP; + break; +#endif +#ifdef INET6 + case htons(ETHERTYPE_IPV6): + isr = NETISR_IPV6; + break; +#endif + default: + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + goto done; + } + + /* Strip off the Infiniband header. */ + m_adj(m, INFINIBAND_HDR_LEN); + +#ifdef MAC + /* + * Tag the mbuf with an appropriate MAC label before any other + * consumers can get to it. + */ + mac_ifnet_create_mbuf(ifp, m); +#endif + /* Allow monitor mode to claim this frame, after stats are updated. */ + NET_EPOCH_ENTER(et); + netisr_dispatch(isr, m); + NET_EPOCH_EXIT(et); +done: + CURVNET_RESTORE(); +} + +static int +infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, + struct sockaddr *sa) +{ + struct sockaddr_dl *sdl; +#ifdef INET + struct sockaddr_in *sin; +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; +#endif + uint8_t *e_addr; + + switch (sa->sa_family) { + case AF_LINK: + /* + * No mapping needed. Just check that it's a valid MC address. + */ + sdl = (struct sockaddr_dl *)sa; + e_addr = LLADDR(sdl); + if (!INFINIBAND_IS_MULTICAST(e_addr)) + return (EADDRNOTAVAIL); + *llsa = NULL; + return 0; + +#ifdef INET + case AF_INET: + sin = (struct sockaddr_in *)sa; + if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) + return (EADDRNOTAVAIL); + sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); + sdl->sdl_alen = INFINIBAND_ADDR_LEN; + e_addr = LLADDR(sdl); + infiniband_ipv4_multicast_map(sin->sin_addr.s_addr, ifp->if_broadcastaddr, + e_addr); + *llsa = (struct sockaddr *)sdl; + return (0); +#endif +#ifdef INET6 + case AF_INET6: + sin6 = (struct sockaddr_in6 *)sa; + /* + * An IP6 address of 0 means listen to all of the + * multicast address used for IP6. This has no meaning + * in infiniband. + */ + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) + return (EADDRNOTAVAIL); + if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) + return (EADDRNOTAVAIL); + sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); + sdl->sdl_alen = INFINIBAND_ADDR_LEN; + e_addr = LLADDR(sdl); + infiniband_ipv6_multicast_map(&sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); + *llsa = (struct sockaddr *)sdl; + return (0); +#endif + default: + return (EAFNOSUPPORT); + } +} + +void +infiniband_ifattach(struct ifnet *ifp, const uint8_t *lla, const uint8_t *llb) +{ + struct sockaddr_dl *sdl; + struct ifaddr *ifa; + int i; + + ifp->if_addrlen = INFINIBAND_ADDR_LEN; + ifp->if_hdrlen = INFINIBAND_HDR_LEN; + ifp->if_mtu = INFINIBAND_MTU; + if_attach(ifp); + ifp->if_output = infiniband_output; + ifp->if_input = infiniband_input; + ifp->if_resolvemulti = infiniband_resolvemulti; + + if (ifp->if_baudrate == 0) + ifp->if_baudrate = IF_Gbps(10); /* default value */ + if (llb != NULL) + ifp->if_broadcastaddr = llb; + + ifa = ifp->if_addr; + KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + sdl->sdl_type = IFT_INFINIBAND; + sdl->sdl_alen = ifp->if_addrlen; + + if (lla != NULL) { + memcpy(LLADDR(sdl), lla, ifp->if_addrlen); + + if (ifp->if_hw_addr != NULL) + memcpy(ifp->if_hw_addr, lla, ifp->if_addrlen); + } else { + lla = LLADDR(sdl); + } + + /* Attach ethernet compatible network device */ + bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN); + + /* Announce Infiniband MAC address if non-zero. */ + for (i = 0; i < ifp->if_addrlen; i++) + if (lla[i] != 0) + break; + if (i != ifp->if_addrlen) + if_printf(ifp, "Infiniband address: %20D\n", lla, ":"); + + /* Add necessary bits are setup; announce it now. */ + EVENTHANDLER_INVOKE(infiniband_ifattach_event, ifp); + + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("INFINIBAND", ifp->if_xname, "IFATTACH", NULL); +} + +/* + * Perform common duties while detaching an Infiniband interface + */ +void +infiniband_ifdetach(struct ifnet *ifp) +{ + bpfdetach(ifp); + if_detach(ifp); +} + +static int +infiniband_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + case MOD_UNLOAD: + return (0); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t infiniband_mod = { + .name = "if_infiniband", + .evhand = &infiniband_modevent, +}; + +DECLARE_MODULE(if_infiniband, infiniband_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); +MODULE_VERSION(if_infiniband, 1); Added: head/sys/net/infiniband.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/infiniband.h Thu Oct 22 09:09:53 2020 (r366930) @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __INFINIBAND_H__ +#define __INFINIBAND_H__ + +#include +#include + +#define INFINIBAND_ADDR_LEN 20 /* bytes */ +#define INFINIBAND_MTU 1500 /* bytes - default value */ + +#define INFINIBAND_ENC_LEN 4 /* bytes */ +#define INFINIBAND_HDR_LEN \ + (INFINIBAND_ADDR_LEN + INFINIBAND_ENC_LEN) + +#define INFINIBAND_IS_MULTICAST(addr) \ + ((addr)[4] == 0xff) + +#define INFINIBAND_BPF_MTAP(_ifp, _m) \ +do { \ + if (bpf_peers_present((_ifp)->if_bpf)) { \ + M_ASSERTVALID(_m); \ + infiniband_bpf_mtap(_ifp, _m); \ + } \ +} while (0) + +struct infiniband_header { + uint8_t ib_hwaddr[INFINIBAND_ADDR_LEN]; + uint16_t ib_protocol; /* big endian */ + uint16_t ib_reserved; /* zero */ +} __packed; + +struct infiniband_address { + uint8_t octet[INFINIBAND_ADDR_LEN]; +} __packed; + +#ifdef _KERNEL + +#include + +struct ifnet; +struct mbuf; + +extern void infiniband_ifattach(struct ifnet *, const uint8_t *hwaddr, const uint8_t *bcaddr); +extern void infiniband_ifdetach(struct ifnet *); +extern void infiniband_bpf_mtap(struct ifnet *, struct mbuf *); + +/* new infiniband interface attached event */ +typedef void (*infiniband_ifattach_event_handler_t)(void *, struct ifnet *); + +EVENTHANDLER_DECLARE(infiniband_ifattach_event, infiniband_ifattach_event_handler_t); + +#endif + +#endif /* __INFINIBAND_H__ */ Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Thu Oct 22 09:09:53 2020 (r366930) @@ -438,16 +438,7 @@ struct ipoib_path { extern struct workqueue_struct *ipoib_workqueue; -#define IPOIB_MTAP_PROTO(_ifp, _m, _proto) \ -do { \ - if (bpf_peers_present((_ifp)->if_bpf)) { \ - M_ASSERTVALID(_m); \ - ipoib_mtap_proto((_ifp), (_m), (_proto)); \ - } \ -} while (0) - /* functions */ -void ipoib_mtap_proto(struct ifnet *ifp, struct mbuf *mb, uint16_t proto); void ipoib_ib_completion(struct ib_cq *cq, void *dev_ptr); void ipoib_send_comp_handler(struct ib_cq *cq, void *dev_ptr); @@ -463,8 +454,6 @@ int ipoib_open(struct ipoib_dev_priv *priv); int ipoib_add_pkey_attr(struct ipoib_dev_priv *priv); int ipoib_add_umcast_attr(struct ipoib_dev_priv *priv); -void ipoib_demux(struct ifnet *ifp, struct mbuf *m, u_short proto); - void ipoib_send(struct ipoib_dev_priv *priv, struct mbuf *mb, struct ipoib_ah *address, u32 qpn); void ipoib_reap_ah(struct work_struct *work); @@ -540,7 +529,7 @@ int ipoib_poll_tx(struct ipoib_dev_priv *priv, bool do void ipoib_dma_unmap_rx(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req); void ipoib_dma_mb(struct ipoib_dev_priv *priv, struct mbuf *mb, unsigned int length); -struct mbuf *ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, int size); +struct mbuf *ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, int align, int size); void ipoib_set_ethtool_ops(struct ifnet *dev); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Oct 22 09:09:53 2020 (r366930) @@ -153,7 +153,7 @@ static struct mbuf * ipoib_cm_alloc_rx_mb(struct ipoib_dev_priv *priv, struct ipoib_cm_rx_buf *rx_req) { return ipoib_alloc_map_mb(priv, (struct ipoib_rx_buf *)rx_req, - priv->cm.max_cm_mtu); + sizeof(struct ipoib_pseudoheader), priv->cm.max_cm_mtu); } static void ipoib_cm_free_rx_ring(struct ipoib_dev_priv *priv, @@ -484,10 +484,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv struct mbuf *mb, *newmb; struct ipoib_cm_rx *p; int has_srq; - u_short proto; - CURVNET_SET_QUIET(dev->if_vnet); - ipoib_dbg_data(priv, "cm recv completion: id %d, status: %d\n", wr_id, wc->status); @@ -561,16 +558,24 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv ipoib_dma_mb(priv, mb, wc->byte_len); - if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); - if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); - mb->m_pkthdr.rcvif = dev; - proto = *mtod(mb, uint16_t *); - m_adj(mb, IPOIB_ENCAP_LEN); - IPOIB_MTAP_PROTO(dev, mb, proto); - ipoib_demux(dev, mb, ntohs(proto)); + M_PREPEND(mb, sizeof(struct ipoib_pseudoheader), M_NOWAIT); + if (likely(mb != NULL)) { + struct ipoib_header *ibh; + if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); + if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); + + /* fixup destination infiniband address */ + ibh = mtod(mb, struct ipoib_header *); + memset(ibh->hwaddr, 0, 4); + memcpy(ibh->hwaddr + 4, priv->local_gid.raw, sizeof(union ib_gid)); + + dev->if_input(dev, mb); + } else { + if_inc_counter(dev, IFCOUNTER_IERRORS, 1); + } repost: if (has_srq) { if (unlikely(ipoib_cm_post_receive_srq(priv, wr_id))) @@ -587,7 +592,6 @@ repost: } } done: - CURVNET_RESTORE(); return; } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Oct 22 09:09:53 2020 (r366930) @@ -112,17 +112,19 @@ ipoib_dma_mb(struct ipoib_dev_priv *priv, struct mbuf struct mbuf * ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, - int size) + int align, int size) { struct mbuf *mb, *m; int i, j; rx_req->mb = NULL; - mb = m_getm2(NULL, size, M_NOWAIT, MT_DATA, M_PKTHDR); + mb = m_getm2(NULL, align + size, M_NOWAIT, MT_DATA, M_PKTHDR); if (mb == NULL) return (NULL); for (i = 0, m = mb; m != NULL; m = m->m_next, i++) { - m->m_len = M_SIZE(m); + m->m_len = M_SIZE(m) - align; + m->m_data += align; + align = 0; mb->m_pkthdr.len += m->m_len; rx_req->mapping[i] = ib_dma_map_single(priv->ca, mtod(m, void *), m->m_len, DMA_FROM_DEVICE); @@ -174,7 +176,7 @@ ipoib_alloc_rx_mb(struct ipoib_dev_priv *priv, int id) { return ipoib_alloc_map_mb(priv, &priv->rx_ring[id], - priv->max_ib_mtu + IB_GRH_BYTES); + 0, priv->max_ib_mtu + IB_GRH_BYTES); } static int ipoib_ib_post_receives(struct ipoib_dev_priv *priv) Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Oct 22 08:40:25 2020 (r366929) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Oct 22 09:09:53 2020 (r366930) @@ -40,21 +40,16 @@ __FBSDID("$FreeBSD$"); #include "ipoib.h" #include -static int ipoib_resolvemulti(struct ifnet *, struct sockaddr **, - struct sockaddr *); - - #include #include #include #include -#include /* For ARPHRD_xxx */ #include -#include -#include +#include + #include MODULE_AUTHOR("Roland Dreier"); @@ -98,19 +93,8 @@ static struct net_device *ipoib_get_net_dev_by_params( const union ib_gid *gid, const struct sockaddr *addr, void *client_data); static void ipoib_start(struct ifnet *dev); -static int ipoib_output(struct ifnet *ifp, struct mbuf *m, - const struct sockaddr *dst, struct route *ro); static int ipoib_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static void ipoib_input(struct ifnet *ifp, struct mbuf *m); -#define IPOIB_MTAP(_ifp, _m) \ -do { \ - if (bpf_peers_present((_ifp)->if_bpf)) { \ - M_ASSERTVALID(_m); \ - ipoib_mtap_mb((_ifp), (_m)); \ - } \ -} while (0) - static struct unrhdr *ipoib_unrhdr; static void @@ -136,37 +120,6 @@ ipoib_unrhdr_uninit(void *arg) } SYSUNINIT(ipoib_unrhdr_uninit, SI_SUB_KLD - 1, SI_ORDER_ANY, ipoib_unrhdr_uninit, NULL); -/* - * This is for clients that have an ipoib_header in the mbuf. - */ -static void -ipoib_mtap_mb(struct ifnet *ifp, struct mbuf *mb) -{ - struct ipoib_header *ih; - struct ether_header eh; - - ih = mtod(mb, struct ipoib_header *); - eh.ether_type = ih->proto; - bcopy(ih->hwaddr, &eh.ether_dhost, ETHER_ADDR_LEN); - bzero(&eh.ether_shost, ETHER_ADDR_LEN); - mb->m_data += sizeof(struct ipoib_header); - mb->m_len -= sizeof(struct ipoib_header); - bpf_mtap2(ifp->if_bpf, &eh, sizeof(eh), mb); - mb->m_data -= sizeof(struct ipoib_header); - mb->m_len += sizeof(struct ipoib_header); -} - -void -ipoib_mtap_proto(struct ifnet *ifp, struct mbuf *mb, uint16_t proto) -{ - struct ether_header eh; - - eh.ether_type = proto; - bzero(&eh.ether_shost, ETHER_ADDR_LEN); - bzero(&eh.ether_dhost, ETHER_ADDR_LEN); - bpf_mtap2(ifp->if_bpf, &eh, sizeof(eh), mb); -} - static struct ib_client ipoib_client = { .name = "ipoib", .add = ipoib_add_one, @@ -787,7 +740,7 @@ ipoib_start_locked(struct ifnet *dev, struct ipoib_dev IFQ_DRV_DEQUEUE(&dev->if_snd, mb); if (mb == NULL) break; - IPOIB_MTAP(dev, mb); + INFINIBAND_BPF_MTAP(dev, mb); ipoib_send_one(priv, mb); } } @@ -875,8 +828,7 @@ ipoib_detach(struct ipoib_dev_priv *priv) dev = priv->dev; if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { priv->gone = 1; - bpfdetach(dev); - if_detach(dev); + infiniband_ifdetach(dev); if_free(dev); free_unr(ipoib_unrhdr, priv->unit); } else @@ -935,7 +887,6 @@ struct ipoib_dev_priv * ipoib_intf_alloc(const char *name) { struct ipoib_dev_priv *priv; - struct sockaddr_dl *sdl; struct ifnet *dev; priv = ipoib_priv_alloc(); @@ -953,24 +904,17 @@ ipoib_intf_alloc(const char *name) } if_initname(dev, name, priv->unit); dev->if_flags = IFF_BROADCAST | IFF_MULTICAST; - dev->if_addrlen = INFINIBAND_ALEN; - dev->if_hdrlen = IPOIB_HEADER_LEN; - if_attach(dev); + + infiniband_ifattach(dev, NULL, priv->broadcastaddr); + dev->if_init = ipoib_init; dev->if_ioctl = ipoib_ioctl; dev->if_start = ipoib_start; - dev->if_output = ipoib_output; - dev->if_input = ipoib_input; - dev->if_resolvemulti = ipoib_resolvemulti; - dev->if_baudrate = IF_Gbps(10); - dev->if_broadcastaddr = priv->broadcastaddr; + dev->if_snd.ifq_maxlen = ipoib_sendq_size * 2; - sdl = (struct sockaddr_dl *)dev->if_addr->ifa_addr; - sdl->sdl_type = IFT_INFINIBAND; - sdl->sdl_alen = dev->if_addrlen; + priv->dev = dev; if_link_state_change(dev, LINK_STATE_DOWN); - bpfattach(dev, DLT_EN10MB, ETHER_HDR_LEN); return dev->if_softc; } @@ -1165,7 +1109,6 @@ ipoib_match_dev_addr(const struct sockaddr *addr, stru struct ifaddr *ifa; int retval = 0; - CURVNET_SET(dev->if_vnet); NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) { if (ifa->ifa_addr == NULL || @@ -1179,7 +1122,6 @@ ipoib_match_dev_addr(const struct sockaddr *addr, stru } } NET_EPOCH_EXIT(et); - CURVNET_RESTORE(); return (retval); } @@ -1475,286 +1417,6 @@ ipoib_cleanup_module(void) ib_sa_unregister_client(&ipoib_sa_client); destroy_workqueue(ipoib_workqueue); } - -/* - * Infiniband output routine. - */ -static int -ipoib_output(struct ifnet *ifp, struct mbuf *m, - const struct sockaddr *dst, struct route *ro) -{ - u_char edst[INFINIBAND_ALEN]; -#if defined(INET) || defined(INET6) - struct llentry *lle = NULL; -#endif - struct ipoib_header *eh; - int error = 0, is_gw = 0; - short type; - - NET_EPOCH_ASSERT(); - - if (ro != NULL) - is_gw = (ro->ro_flags & RT_HAS_GW) != 0; -#ifdef MAC - error = mac_ifnet_check_transmit(ifp, m); - if (error) - goto bad; -#endif - - M_PROFILE(m); - if (ifp->if_flags & IFF_MONITOR) { - error = ENETDOWN; - goto bad; - } - if (!((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING))) { - error = ENETDOWN; - goto bad; - } - - switch (dst->sa_family) { -#ifdef INET - case AF_INET: - if (lle != NULL && (lle->la_flags & LLE_VALID)) - memcpy(edst, lle->ll_addr, sizeof(edst)); - else if (m->m_flags & M_MCAST) - ip_ib_mc_map(((struct sockaddr_in *)dst)->sin_addr.s_addr, ifp->if_broadcastaddr, edst); - else - error = arpresolve(ifp, is_gw, m, dst, edst, NULL, NULL); - if (error) - return (error == EWOULDBLOCK ? 0 : error); - type = htons(ETHERTYPE_IP); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 22 09:17:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9DFC4435C9; Thu, 22 Oct 2020 09:17:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH1x15jtkz4bfj; Thu, 22 Oct 2020 09:17:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A77D214751; Thu, 22 Oct 2020 09:17:57 +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 09M9Hvix032741; Thu, 22 Oct 2020 09:17:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M9Hv3q032739; Thu, 22 Oct 2020 09:17:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010220917.09M9Hv3q032739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 09:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366931 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 09:17:58 -0000 Author: hselasky Date: Thu Oct 22 09:17:56 2020 New Revision: 366931 URL: https://svnweb.freebsd.org/changeset/base/366931 Log: Implement mbuf hashing routines for IP over infiniband, IPoIB. No functional change intended. Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/kern/uipc_mbufhash.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbufhash.c ============================================================================== --- head/sys/kern/uipc_mbufhash.c Thu Oct 22 09:09:53 2020 (r366930) +++ head/sys/kern/uipc_mbufhash.c Thu Oct 22 09:17:56 2020 (r366931) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #if defined(INET) || defined(INET6) #include @@ -42,7 +43,7 @@ __FBSDID("$FreeBSD$"); #endif static const void * -m_ether_tcpip_hash_gethdr(const struct mbuf *m, const u_int off, +m_common_hash_gethdr(const struct mbuf *m, const u_int off, const u_int len, void *buf) { @@ -65,9 +66,19 @@ m_ether_tcpip_hash_init(void) } uint32_t -m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m, - const uint32_t key) +m_infiniband_tcpip_hash_init(void) { + uint32_t seed; + + seed = arc4random(); + return (fnv_32_buf(&seed, sizeof(seed), FNV1_32_INIT)); +} + +static inline uint32_t +m_tcpip_hash(const uint32_t flags, const struct mbuf *m, + uint32_t p, int off, const uint16_t etype) +{ +#if defined(INET) || defined(INET6) union { #ifdef INET struct ip ip; @@ -75,49 +86,19 @@ m_ether_tcpip_hash(const uint32_t flags, const struct #ifdef INET6 struct ip6_hdr ip6; #endif - struct ether_vlan_header vlan; uint32_t port; } buf; - const struct ether_header *eh; - const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; #endif #ifdef INET6 const struct ip6_hdr *ip6; #endif - uint32_t p; - int off; - uint16_t etype; - - p = key; - off = sizeof(*eh); - if (m->m_len < off) - goto done; - eh = mtod(m, struct ether_header *); - etype = ntohs(eh->ether_type); - if (flags & MBUF_HASHFLAG_L2) { - p = fnv_32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); - p = fnv_32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); - } - /* Special handling for encapsulating VLAN frames */ - if ((m->m_flags & M_VLANTAG) && (flags & MBUF_HASHFLAG_L2)) { - p = fnv_32_buf(&m->m_pkthdr.ether_vtag, - sizeof(m->m_pkthdr.ether_vtag), p); - } else if (etype == ETHERTYPE_VLAN) { - vlan = m_ether_tcpip_hash_gethdr(m, off, sizeof(*vlan), &buf); - if (vlan == NULL) - goto done; - - if (flags & MBUF_HASHFLAG_L2) - p = fnv_32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); - etype = ntohs(vlan->evl_proto); - off += sizeof(*vlan) - sizeof(*eh); - } +#endif switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip), &buf); + ip = m_common_hash_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) break; if (flags & MBUF_HASHFLAG_L3) { @@ -136,7 +117,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct if (iphlen < sizeof(*ip)) break; off += iphlen; - ports = m_ether_tcpip_hash_gethdr(m, + ports = m_common_hash_gethdr(m, off, sizeof(*ports), &buf); if (ports == NULL) break; @@ -150,7 +131,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct #endif #ifdef INET6 case ETHERTYPE_IPV6: - ip6 = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip6), &buf); + ip6 = m_common_hash_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) break; if (flags & MBUF_HASHFLAG_L3) { @@ -169,6 +150,62 @@ m_ether_tcpip_hash(const uint32_t flags, const struct default: break; } -done: return (p); +} + +uint32_t +m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m, + uint32_t p) +{ + union { + struct ether_vlan_header vlan; + } buf; + const struct ether_header *eh; + const struct ether_vlan_header *vlan; + int off; + uint16_t etype; + + off = sizeof(*eh); + if (m->m_len < off) + return (p); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + if (flags & MBUF_HASHFLAG_L2) { + p = fnv_32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = fnv_32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + } + /* Special handling for encapsulating VLAN frames */ + if ((m->m_flags & M_VLANTAG) && (flags & MBUF_HASHFLAG_L2)) { + p = fnv_32_buf(&m->m_pkthdr.ether_vtag, + sizeof(m->m_pkthdr.ether_vtag), p); + } else if (etype == ETHERTYPE_VLAN) { + vlan = m_common_hash_gethdr(m, off, sizeof(*vlan), &buf); + if (vlan == NULL) + return (p); + + if (flags & MBUF_HASHFLAG_L2) + p = fnv_32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + etype = ntohs(vlan->evl_proto); + off += sizeof(*vlan) - sizeof(*eh); + } + return (m_tcpip_hash(flags, m, p, off, etype)); +} + +uint32_t +m_infiniband_tcpip_hash(const uint32_t flags, const struct mbuf *m, + uint32_t p) +{ + const struct infiniband_header *ibh; + int off; + uint16_t etype; + + off = sizeof(*ibh); + if (m->m_len < off) + return (p); + ibh = mtod(m, struct infiniband_header *); + etype = ntohs(ibh->ib_protocol); + if (flags & MBUF_HASHFLAG_L2) + p = fnv_32_buf(&ibh->ib_hwaddr, INFINIBAND_ADDR_LEN, p); + + return (m_tcpip_hash(flags, m, p, off, etype)); } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Oct 22 09:09:53 2020 (r366930) +++ head/sys/sys/mbuf.h Thu Oct 22 09:17:56 2020 (r366931) @@ -1455,14 +1455,16 @@ rt_m_getfib(struct mbuf *m) ((_m)->m_pkthdr.fibnum) = (_fib); \ } while (0) -/* flags passed as first argument for "m_ether_tcpip_hash()" */ +/* flags passed as first argument for "m_xxx_tcpip_hash()" */ #define MBUF_HASHFLAG_L2 (1 << 2) #define MBUF_HASHFLAG_L3 (1 << 3) #define MBUF_HASHFLAG_L4 (1 << 4) /* mbuf hashing helper routines */ uint32_t m_ether_tcpip_hash_init(void); -uint32_t m_ether_tcpip_hash(const uint32_t, const struct mbuf *, const uint32_t); +uint32_t m_ether_tcpip_hash(const uint32_t, const struct mbuf *, uint32_t); +uint32_t m_infiniband_tcpip_hash_init(void); +uint32_t m_infiniband_tcpip_hash(const uint32_t, const struct mbuf *, uint32_t); #ifdef MBUF_PROFILING void m_profile(struct mbuf *m); From owner-svn-src-all@freebsd.org Thu Oct 22 09:28:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 590124435F1; Thu, 22 Oct 2020 09:28:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH28r1dxHz4bx2; Thu, 22 Oct 2020 09:28: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 192FF148BD; Thu, 22 Oct 2020 09:28: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 09M9SBnM038829; Thu, 22 Oct 2020 09:28:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M9SBrC038828; Thu, 22 Oct 2020 09:28:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010220928.09M9SBrC038828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Oct 2020 09:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366932 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 09:28:12 -0000 Author: kib Date: Thu Oct 22 09:28:11 2020 New Revision: 366932 URL: https://svnweb.freebsd.org/changeset/base/366932 Log: sysv_sem: semusz depends on semume. Size of the per-process semaphore undo structure (semusz) depends on the number of the per-process undos. If kern.ipc.semume is adjusted, semusz must be adjusted as well, and it makes no sense to delegate adjustment to user. Make it automatic. Reported and tested by: Olef PR: 250361 Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26826 Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Thu Oct 22 09:17:56 2020 (r366931) +++ head/sys/kern/sysv_sem.c Thu Oct 22 09:28:11 2020 (r366932) @@ -187,13 +187,13 @@ struct sem_undo { #define SEM_ALIGN(bytes) roundup2(bytes, sizeof(long)) /* actual size of an undo structure */ -#define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME])) +#define SEMUSZ(x) SEM_ALIGN(offsetof(struct sem_undo, un_ent[(x)])) /* * Macro to find a particular sem_undo vector */ #define SEMU(ix) \ - ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz)) + ((struct sem_undo *)(((intptr_t)semu) + (ix) * seminfo.semusz)) /* * semaphore info struct @@ -205,7 +205,7 @@ struct seminfo seminfo = { .semmsl = SEMMSL, /* max # of semaphores per id */ .semopm = SEMOPM, /* max # of operations per semop call */ .semume = SEMUME, /* max # of undo entries per process */ - .semusz = SEMUSZ, /* size in bytes of undo structure */ + .semusz = SEMUSZ(SEMUME), /* size in bytes of undo structure */ .semvmx = SEMVMX, /* semaphore maximum value */ .semaem = SEMAEM, /* adjust on exit max value */ }; @@ -222,7 +222,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semopm, CTLFLAG_RDTUN, "Max operations per semop call"); SYSCTL_INT(_kern_ipc, OID_AUTO, semume, CTLFLAG_RDTUN, &seminfo.semume, 0, "Max undo entries per process"); -SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RDTUN, &seminfo.semusz, 0, +SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RD, &seminfo.semusz, 0, "Size in bytes of undo structure"); SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RWTUN, &seminfo.semvmx, 0, "Semaphore maximum value"); @@ -284,6 +284,7 @@ seminit(void) M_WAITOK | M_ZERO); sema_mtx = malloc(sizeof(struct mtx) * seminfo.semmni, M_SEM, M_WAITOK | M_ZERO); + seminfo.semusz = SEMUSZ(seminfo.semume); semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK); for (i = 0; i < seminfo.semmni; i++) { From owner-svn-src-all@freebsd.org Thu Oct 22 09:47:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DC48444042; Thu, 22 Oct 2020 09:47:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH2Zp2hhKz4dwS; Thu, 22 Oct 2020 09:47:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FC2214A5F; Thu, 22 Oct 2020 09:47:14 +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 09M9lEAV051500; Thu, 22 Oct 2020 09:47:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09M9lCYA051492; Thu, 22 Oct 2020 09:47:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010220947.09M9lCYA051492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 09:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366933 - in head: sbin/ifconfig share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: sbin/ifconfig share/man/man4 sys/net X-SVN-Commit-Revision: 366933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 09:47:14 -0000 Author: hselasky Date: Thu Oct 22 09:47:12 2020 New Revision: 366933 URL: https://svnweb.freebsd.org/changeset/base/366933 Log: Add support for IP over infiniband, IPoIB, to lagg(4). Currently only the failover protocol is supported due to limitations in the IPoIB architecture. Refer to the lagg(4) manual page for how to configure and use this new feature. A new network interface type, IFT_INFINIBANDLAG, has been added, similar to the existing IFT_IEEE8023ADLAG . ifconfig(8) has been updated to accept a new laggtype argument when creating lagg(4) network interfaces. This new argument is used to distinguish between ethernet and infiniband type of lagg(4) network interface. The laggtype argument is optional and defaults to ethernet. The lagg(4) command line syntax is backwards compatible. Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/share/man/man4/lagg.4 head/sys/net/ieee8023ad_lacp.c head/sys/net/if_ethersubr.c head/sys/net/if_infiniband.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_types.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Thu Oct 22 09:28:11 2020 (r366932) +++ head/sbin/ifconfig/ifconfig.8 Thu Oct 22 09:47:12 2020 (r366933) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 17, 2020 +.Dd October 21, 2020 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2481,6 +2481,12 @@ Set to 0 to disable. .Pp The following parameters are specific to lagg interfaces: .Bl -tag -width indent +.It Cm laggtype Ar type +When creating a lagg interface the type can be specified as either +.Cm ethernet +or +.Cm infiniband . +If not specified ethernet is the default lagg type. .It Cm laggport Ar interface Add the interface named by .Ar interface Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Oct 22 09:28:11 2020 (r366932) +++ head/sbin/ifconfig/iflagg.c Thu Oct 22 09:47:12 2020 (r366933) @@ -30,8 +30,12 @@ static const char rcsid[] = #include "ifconfig.h" -char lacpbuf[120]; /* LACP peer '[(a,a,a),(p,p,p)]' */ +static struct iflaggparam params = { + .lagg_type = LAGG_TYPE_DEFAULT, +}; +static char lacpbuf[120]; /* LACP peer '[(a,a,a),(p,p,p)]' */ + static void setlaggport(const char *val, int d, int s, const struct afswtch *afp) { @@ -301,7 +305,31 @@ lagg_status(int s) } } +static +DECL_CMD_FUNC(setlaggtype, arg, d) +{ + static const struct lagg_types lt[] = LAGG_TYPES; + int i; + + for (i = 0; i < nitems(lt); i++) { + if (strcmp(arg, lt[i].lt_name) == 0) { + params.lagg_type = lt[i].lt_value; + return; + } + } + errx(1, "invalid lagg type: %s", arg); +} + +static void +lagg_create(int s, struct ifreq *ifr) +{ + ifr->ifr_data = (caddr_t) ¶ms; + if (ioctl(s, SIOCIFCREATE2, ifr) < 0) + err(1, "SIOCIFCREATE2"); +} + static struct cmd lagg_cmds[] = { + DEF_CLONE_CMD_ARG("laggtype", setlaggtype), DEF_CMD_ARG("laggport", setlaggport), DEF_CMD_ARG("-laggport", unsetlaggport), DEF_CMD_ARG("laggproto", setlaggproto), @@ -335,4 +363,5 @@ lagg_ctor(void) for (i = 0; i < nitems(lagg_cmds); i++) cmd_register(&lagg_cmds[i]); af_register(&af_lagg); + clone_setdefcallback("lagg", lagg_create); } Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Thu Oct 22 09:28:11 2020 (r366932) +++ head/share/man/man4/lagg.4 Thu Oct 22 09:47:12 2020 (r366933) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2017 +.Dd October 21, 2020 .Dt LAGG 4 .Os .Sh NAME @@ -192,6 +192,15 @@ device will be used: .Pp (Note the mac address of the wireless device is forced to match the wired device as a workaround.) +.Pp +The following example shows how to create an infiniband failover interface. +.Bd -literal -offset indent +# ifconfig ib0 up +# ifconfig ib1 up +# ifconfig lagg0 create laggtype infiniband +# ifconfig lagg0 laggproto failover laggport ib0 laggport ib1 \e + 1.1.1.1 netmask 255.255.255.0 +.Ed .Sh SEE ALSO .Xr ng_one2many 4 , .Xr ifconfig 8 , Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/ieee8023ad_lacp.c Thu Oct 22 09:47:12 2020 (r366933) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/if_ethersubr.c Thu Oct 22 09:47:12 2020 (r366933) @@ -110,7 +110,7 @@ void (*vlan_input_p)(struct ifnet *, struct mbuf *); void (*bridge_dn_p)(struct mbuf *, struct ifnet *); /* if_lagg(4) support */ -struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); +struct mbuf *(*lagg_input_ethernet_p)(struct ifnet *, struct mbuf *); static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -608,9 +608,9 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m /* Handle input from a lagg(4) port */ if (ifp->if_type == IFT_IEEE8023ADLAG) { - KASSERT(lagg_input_p != NULL, + KASSERT(lagg_input_ethernet_p != NULL, ("%s: if_lagg not loaded!", __func__)); - m = (*lagg_input_p)(ifp, m); + m = (*lagg_input_ethernet_p)(ifp, m); if (m != NULL) ifp = m->m_pkthdr.rcvif; else { Modified: head/sys/net/if_infiniband.c ============================================================================== --- head/sys/net/if_infiniband.c Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/if_infiniband.c Thu Oct 22 09:47:12 2020 (r366933) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -58,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include +/* if_lagg(4) support */ +struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); + #ifdef INET static inline void infiniband_ipv4_multicast_map(uint32_t addr, @@ -345,6 +349,16 @@ infiniband_input(struct ifnet *ifp, struct mbuf *m) /* Direct packet to correct FIB based on interface config. */ M_SETFIB(m, ifp->if_fib); + + /* Handle input from a lagg port */ + if (ifp->if_type == IFT_INFINIBANDLAG) { + KASSERT(lagg_input_infiniband_p != NULL, + ("%s: if_lagg not loaded!", __func__)); + m = (*lagg_input_infiniband_p)(ifp, m); + if (__predict_false(m == NULL)) + goto done; + ifp = m->m_pkthdr.rcvif; + } /* * Dispatch frame to upper layer. Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/if_lagg.c Thu Oct 22 09:47:12 2020 (r366933) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #if defined(INET) || defined(INET6) #include @@ -131,7 +132,8 @@ static MALLOC_DEFINE(M_LAGG, laggname, "802.3AD Link A static void lagg_capabilities(struct lagg_softc *); static int lagg_port_create(struct lagg_softc *, struct ifnet *); static int lagg_port_destroy(struct lagg_port *, int); -static struct mbuf *lagg_input(struct ifnet *, struct mbuf *); +static struct mbuf *lagg_input_ethernet(struct ifnet *, struct mbuf *); +static struct mbuf *lagg_input_infiniband(struct ifnet *, struct mbuf *); static void lagg_linkstate(struct lagg_softc *); static void lagg_port_state(struct ifnet *, int); static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t); @@ -164,7 +166,8 @@ static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); static uint64_t lagg_get_counter(struct ifnet *ifp, ift_counter cnt); -static int lagg_transmit(struct ifnet *, struct mbuf *); +static int lagg_transmit_ethernet(struct ifnet *, struct mbuf *); +static int lagg_transmit_infiniband(struct ifnet *, struct mbuf *); static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); static void lagg_media_status(struct ifnet *, struct ifmediareq *); @@ -327,7 +330,8 @@ lagg_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - lagg_input_p = lagg_input; + lagg_input_ethernet_p = lagg_input_ethernet; + lagg_input_infiniband_p = lagg_input_infiniband; lagg_linkstate_p = lagg_port_state; lagg_detach_cookie = EVENTHANDLER_REGISTER( ifnet_departure_event, lagg_port_ifdetach, NULL, @@ -336,7 +340,8 @@ lagg_modevent(module_t mod, int type, void *data) case MOD_UNLOAD: EVENTHANDLER_DEREGISTER(ifnet_departure_event, lagg_detach_cookie); - lagg_input_p = NULL; + lagg_input_ethernet_p = NULL; + lagg_input_infiniband_p = NULL; lagg_linkstate_p = NULL; break; default: @@ -353,6 +358,7 @@ static moduledata_t lagg_mod = { DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(if_lagg, 1); +MODULE_DEPEND(if_lagg, if_infiniband, 1, 1, 1); static void lagg_proto_attach(struct lagg_softc *sc, lagg_proto pr) @@ -504,18 +510,48 @@ lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_i static int lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) { + struct iflaggparam iflp; struct lagg_softc *sc; struct ifnet *ifp; - static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ + int if_type; + int error; + static const uint8_t eaddr[LAGG_ADDR_LEN]; + static const uint8_t ib_bcast_addr[INFINIBAND_ADDR_LEN] = { + 0x00, 0xff, 0xff, 0xff, + 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff + }; + if (params != NULL) { + error = copyin(params, &iflp, sizeof(iflp)); + if (error) + return (error); + + switch (iflp.lagg_type) { + case LAGG_TYPE_ETHERNET: + if_type = IFT_ETHER; + break; + case LAGG_TYPE_INFINIBAND: + if_type = IFT_INFINIBAND; + break; + default: + return (EINVAL); + } + } else { + if_type = IFT_ETHER; + } + sc = malloc(sizeof(*sc), M_LAGG, M_WAITOK|M_ZERO); - ifp = sc->sc_ifp = if_alloc(IFT_ETHER); + ifp = sc->sc_ifp = if_alloc(if_type); if (ifp == NULL) { free(sc, M_LAGG); return (ENOSPC); } LAGG_SX_INIT(sc); + mtx_init(&sc->sc_mtx, "lagg-mtx", NULL, MTX_DEF); + callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + LAGG_XLOCK(sc); if (V_def_use_flowid) sc->sc_opts |= LAGG_OPT_USE_FLOWID; @@ -530,15 +566,25 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd CK_SLIST_INIT(&sc->sc_ports); - /* Initialise pseudo media types */ - ifmedia_init(&sc->sc_media, 0, lagg_media_change, - lagg_media_status); - ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO); + switch (if_type) { + case IFT_ETHER: + /* Initialise pseudo media types */ + ifmedia_init(&sc->sc_media, 0, lagg_media_change, + lagg_media_status); + ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO); - if_initname(ifp, laggname, unit); + if_initname(ifp, laggname, unit); + ifp->if_transmit = lagg_transmit_ethernet; + break; + case IFT_INFINIBAND: + if_initname(ifp, laggname, unit); + ifp->if_transmit = lagg_transmit_infiniband; + break; + default: + break; + } ifp->if_softc = sc; - ifp->if_transmit = lagg_transmit; ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; @@ -555,9 +601,18 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd /* * Attach as an ordinary ethernet device, children will be attached - * as special device IFT_IEEE8023ADLAG. + * as special device IFT_IEEE8023ADLAG or IFT_INFINIBANDLAG. */ - ether_ifattach(ifp, eaddr); + switch (if_type) { + case IFT_ETHER: + ether_ifattach(ifp, eaddr); + break; + case IFT_INFINIBAND: + infiniband_ifattach(ifp, eaddr, ib_bcast_addr); + break; + default: + break; + } sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, lagg_register_vlan, sc, EVENTHANDLER_PRI_FIRST); @@ -595,14 +650,24 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_proto_detach(sc); LAGG_XUNLOCK(sc); - ifmedia_removeall(&sc->sc_media); - ether_ifdetach(ifp); + switch (ifp->if_type) { + case IFT_ETHER: + ifmedia_removeall(&sc->sc_media); + ether_ifdetach(ifp); + break; + case IFT_INFINIBAND: + infiniband_ifdetach(ifp); + break; + default: + break; + } if_free(ifp); LAGG_LIST_LOCK(); SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries); LAGG_LIST_UNLOCK(); + mtx_destroy(&sc->sc_mtx); LAGG_SX_DESTROY(sc); free(sc, M_LAGG); } @@ -669,6 +734,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * struct lagg_port *lp, *tlp; struct ifreq ifr; int error, i, oldmtu; + int if_type; uint64_t *pval; LAGG_XLOCK_ASSERT(sc); @@ -695,9 +761,22 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * return (EBUSY); } - /* XXX Disallow non-ethernet interfaces (this should be any of 802) */ - if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) - return (EPROTONOSUPPORT); + switch (sc->sc_ifp->if_type) { + case IFT_ETHER: + /* XXX Disallow non-ethernet interfaces (this should be any of 802) */ + if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) + return (EPROTONOSUPPORT); + if_type = IFT_IEEE8023ADLAG; + break; + case IFT_INFINIBAND: + /* XXX Disallow non-infiniband interfaces */ + if (ifp->if_type != IFT_INFINIBAND) + return (EPROTONOSUPPORT); + if_type = IFT_INFINIBANDLAG; + break; + default: + break; + } /* Allow the first Ethernet member to define the MTU */ oldmtu = -1; @@ -754,14 +833,14 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if_ref(ifp); lp->lp_ifp = ifp; - bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); + bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ifp->if_addrlen); lp->lp_ifcapenable = ifp->if_capenable; if (CK_SLIST_EMPTY(&sc->sc_ports)) { - bcopy(IF_LLADDR(ifp), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + bcopy(IF_LLADDR(ifp), IF_LLADDR(sc->sc_ifp), ifp->if_addrlen); lagg_proto_lladdr(sc); EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); } else { - if_setlladdr(ifp, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + if_setlladdr(ifp, IF_LLADDR(sc->sc_ifp), ifp->if_addrlen); } lagg_setflags(lp, 1); @@ -770,7 +849,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * /* Change the interface type */ lp->lp_iftype = ifp->if_type; - ifp->if_type = IFT_IEEE8023ADLAG; + ifp->if_type = if_type; ifp->if_lagg = lp; lp->lp_ioctl = ifp->if_ioctl; ifp->if_ioctl = lagg_port_ioctl; @@ -887,15 +966,15 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport /* Update the primary interface */ if (lp == sc->sc_primary) { - uint8_t lladdr[ETHER_ADDR_LEN]; + uint8_t lladdr[LAGG_ADDR_LEN]; if ((lp0 = CK_SLIST_FIRST(&sc->sc_ports)) == NULL) - bzero(&lladdr, ETHER_ADDR_LEN); + bzero(&lladdr, LAGG_ADDR_LEN); else - bcopy(lp0->lp_lladdr, lladdr, ETHER_ADDR_LEN); + bcopy(lp0->lp_lladdr, lladdr, LAGG_ADDR_LEN); sc->sc_primary = lp0; if (sc->sc_destroying == 0) { - bcopy(lladdr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + bcopy(lladdr, IF_LLADDR(sc->sc_ifp), sc->sc_ifp->if_addrlen); lagg_proto_lladdr(sc); EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); } @@ -905,7 +984,7 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport * as well, to switch from old lladdr to its 'real' one) */ CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries) - if_setlladdr(lp_ptr->lp_ifp, lladdr, ETHER_ADDR_LEN); + if_setlladdr(lp_ptr->lp_ifp, lladdr, lp_ptr->lp_ifp->if_addrlen); } if (lp->lp_ifflags) @@ -914,7 +993,7 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport if (lp->lp_detaching == 0) { lagg_setflags(lp, 0); lagg_setcaps(lp, lp->lp_ifcapenable); - if_setlladdr(ifp, lp->lp_lladdr, ETHER_ADDR_LEN); + if_setlladdr(ifp, lp->lp_lladdr, ifp->if_addrlen); } /* @@ -938,9 +1017,15 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t int error = 0; /* Should be checked by the caller */ - if (ifp->if_type != IFT_IEEE8023ADLAG || - (lp = ifp->if_lagg) == NULL || (sc = lp->lp_softc) == NULL) + switch (ifp->if_type) { + case IFT_IEEE8023ADLAG: + case IFT_INFINIBANDLAG: + if ((lp = ifp->if_lagg) == NULL || (sc = lp->lp_softc) == NULL) + goto fallback; + break; + default: goto fallback; + } switch (cmd) { case SIOCGLAGGPORT: @@ -1130,6 +1215,44 @@ lagg_port2req(struct lagg_port *lp, struct lagg_reqpor } static void +lagg_watchdog_infiniband(void *arg) +{ + struct lagg_softc *sc; + struct lagg_port *lp; + struct ifnet *ifp; + struct ifnet *lp_ifp; + + sc = arg; + + /* + * Because infiniband nodes have a fixed MAC address, which is + * generated by the so-called GID, we need to regularly update + * the link level address of the parent lagg device when + * the active port changes. Possibly we could piggy-back on + * link up/down events aswell, but using a timer also provides + * a guarantee against too frequent events. This operation + * does not have to be atomic. + */ + LAGG_RLOCK(); + lp = lagg_link_active(sc, sc->sc_primary); + if (lp != NULL) { + ifp = sc->sc_ifp; + lp_ifp = lp->lp_ifp; + + if (ifp != NULL && lp_ifp != NULL && + memcmp(IF_LLADDR(ifp), IF_LLADDR(lp_ifp), ifp->if_addrlen) != 0) { + memcpy(IF_LLADDR(ifp), IF_LLADDR(lp_ifp), ifp->if_addrlen); + CURVNET_SET(ifp->if_vnet); + EVENTHANDLER_INVOKE(iflladdr_event, ifp); + CURVNET_RESTORE(); + } + } + LAGG_RUNLOCK(); + + callout_reset(&sc->sc_watchdog, hz, &lagg_watchdog_infiniband, arg); +} + +static void lagg_init(void *xsc) { struct lagg_softc *sc = (struct lagg_softc *)xsc; @@ -1151,12 +1274,18 @@ lagg_init(void *xsc) */ CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (memcmp(IF_LLADDR(ifp), IF_LLADDR(lp->lp_ifp), - ETHER_ADDR_LEN) != 0) - if_setlladdr(lp->lp_ifp, IF_LLADDR(ifp), ETHER_ADDR_LEN); + ifp->if_addrlen) != 0) + if_setlladdr(lp->lp_ifp, IF_LLADDR(ifp), ifp->if_addrlen); } lagg_proto_init(sc); + if (ifp->if_type == IFT_INFINIBAND) { + mtx_lock(&sc->sc_mtx); + lagg_watchdog_infiniband(sc); + mtx_unlock(&sc->sc_mtx); + } + LAGG_XUNLOCK(sc); } @@ -1173,6 +1302,12 @@ lagg_stop(struct lagg_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; lagg_proto_stop(sc); + + mtx_lock(&sc->sc_mtx); + callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mtx); + + callout_drain(&sc->sc_watchdog); } static int @@ -1228,7 +1363,12 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data error = EPROTONOSUPPORT; break; } - + /* Infiniband only supports the failover protocol. */ + if (ra->ra_proto != LAGG_PROTO_FAILOVER && + ifp->if_type == IFT_INFINIBAND) { + error = EPROTONOSUPPORT; + break; + } LAGG_XLOCK(sc); lagg_proto_detach(sc); LAGG_UNLOCK_ASSERT(); @@ -1546,7 +1686,10 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: - error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); + if (ifp->if_type == IFT_INFINIBAND) + error = EINVAL; + else + error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); break; case SIOCSIFCAP: @@ -1855,7 +1998,7 @@ lagg_setflags(struct lagg_port *lp, int status) } static int -lagg_transmit(struct ifnet *ifp, struct mbuf *m) +lagg_transmit_ethernet(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; int error; @@ -1880,6 +2023,32 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m) return (error); } +static int +lagg_transmit_infiniband(struct ifnet *ifp, struct mbuf *m) +{ + struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; + int error; + +#if defined(KERN_TLS) || defined(RATELIMIT) + if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) + MPASS(m->m_pkthdr.snd_tag->ifp == ifp); +#endif + LAGG_RLOCK(); + /* We need a Tx algorithm and at least one port */ + if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { + LAGG_RUNLOCK(); + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ENXIO); + } + + INFINIBAND_BPF_MTAP(ifp, m); + + error = lagg_proto_start(sc, m); + LAGG_RUNLOCK(); + return (error); +} + /* * The ifp->if_qflush entry point for lagg(4) is no-op. */ @@ -1889,7 +2058,7 @@ lagg_qflush(struct ifnet *ifp __unused) } static struct mbuf * -lagg_input(struct ifnet *ifp, struct mbuf *m) +lagg_input_ethernet(struct ifnet *ifp, struct mbuf *m) { struct lagg_port *lp = ifp->if_lagg; struct lagg_softc *sc = lp->lp_softc; @@ -1905,6 +2074,34 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) } ETHER_BPF_MTAP(scifp, m); + + m = lagg_proto_input(sc, lp, m); + if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + m = NULL; + } + + LAGG_RUNLOCK(); + return (m); +} + +static struct mbuf * +lagg_input_infiniband(struct ifnet *ifp, struct mbuf *m) +{ + struct lagg_port *lp = ifp->if_lagg; + struct lagg_softc *sc = lp->lp_softc; + struct ifnet *scifp = sc->sc_ifp; + + LAGG_RLOCK(); + if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + lp->lp_detaching != 0 || + sc->sc_proto == LAGG_PROTO_NONE) { + LAGG_RUNLOCK(); + m_freem(m); + return (NULL); + } + + INFINIBAND_BPF_MTAP(scifp, m); m = lagg_proto_input(sc, lp, m); if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/if_lagg.h Thu Oct 22 09:47:12 2020 (r366933) @@ -72,7 +72,34 @@ struct lagg_protos { { "default", LAGG_PROTO_DEFAULT } \ } +/* Supported lagg TYPEs */ +typedef enum { + LAGG_TYPE_ETHERNET = 0, /* ethernet (default) */ + LAGG_TYPE_INFINIBAND, /* infiniband */ + LAGG_TYPE_MAX, +} lagg_type; + +struct lagg_types { + const char *lt_name; + lagg_type lt_value; +}; + +#define LAGG_TYPE_DEFAULT LAGG_TYPE_ETHERNET +#define LAGG_TYPES { \ + { "ethernet", LAGG_TYPE_ETHERNET }, \ + { "infiniband", LAGG_TYPE_INFINIBAND }, \ +} + /* + * lagg create clone params + */ +struct iflaggparam { + uint8_t lagg_type; /* see LAGG_TYPE_XXX */ + uint8_t reserved_8[3]; + uint32_t reserved_32[3]; +}; + +/* * lagg ioctls. */ @@ -206,7 +233,7 @@ struct lagg_counters { struct lagg_softc { struct ifnet *sc_ifp; /* virtual interface */ - struct rmlock sc_mtx; + struct mtx sc_mtx; /* watchdog mutex */ struct sx sc_sx; int sc_proto; /* lagg protocol */ u_int sc_count; /* number of ports */ @@ -230,12 +257,15 @@ struct lagg_softc { u_int sc_opts; int flowid_shift; /* shift the flowid */ struct lagg_counters detached_counters; /* detached ports sum */ + struct callout sc_watchdog; /* watchdog timer */ }; struct lagg_port { struct ifnet *lp_ifp; /* physical interface */ struct lagg_softc *lp_softc; /* parent lagg */ - uint8_t lp_lladdr[ETHER_ADDR_LEN]; +#define LAGG_ADDR_LEN \ + MAX(INFINIBAND_ADDR_LEN, ETHER_ADDR_LEN) + uint8_t lp_lladdr[LAGG_ADDR_LEN]; u_char lp_iftype; /* interface type */ uint32_t lp_prio; /* port priority */ @@ -257,7 +287,8 @@ struct lagg_port { struct epoch_context lp_epoch_ctx; }; -extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); +extern struct mbuf *(*lagg_input_ethernet_p)(struct ifnet *, struct mbuf *); +extern struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); Modified: head/sys/net/if_types.h ============================================================================== --- head/sys/net/if_types.h Thu Oct 22 09:28:11 2020 (r366932) +++ head/sys/net/if_types.h Thu Oct 22 09:47:12 2020 (r366933) @@ -242,6 +242,7 @@ typedef enum { IFT_OPTICALCHANNEL = 0xc3, /* Optical Channel */ IFT_OPTICALTRANSPORT = 0xc4, /* Optical Transport */ IFT_INFINIBAND = 0xc7, /* Infiniband */ + IFT_INFINIBANDLAG = 0xc8, /* Infiniband Link Aggregate */ IFT_BRIDGE = 0xd1, /* Transparent bridge interface */ IFT_STF = 0xd7, /* 6to4 interface */ From owner-svn-src-all@freebsd.org Thu Oct 22 10:29:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A1F9444A71; Thu, 22 Oct 2020 10:29:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH3WX0Xglz3SRj; Thu, 22 Oct 2020 10:29:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9D8D15621; Thu, 22 Oct 2020 10:29:27 +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 09MATRfA075796; Thu, 22 Oct 2020 10:29:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MATRtK075795; Thu, 22 Oct 2020 10:29:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010221029.09MATRtK075795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 10:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366934 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 10:29:28 -0000 Author: hselasky Date: Thu Oct 22 10:29:27 2020 New Revision: 366934 URL: https://svnweb.freebsd.org/changeset/base/366934 Log: Fix for monotolithic kernel builds using device lagg(4). Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 22 09:47:12 2020 (r366933) +++ head/sys/conf/files Thu Oct 22 10:29:27 2020 (r366934) @@ -4571,7 +4571,7 @@ compat/lindebugfs/lindebugfs.c optional lindebugfs \ compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) -net/if_infiniband.c optional ofed +net/if_infiniband.c optional ofed | lagg ofed/drivers/infiniband/core/ib_addr.c optional ofed \ compile-with "${OFED_C}" ofed/drivers/infiniband/core/ib_agent.c optional ofed \ From owner-svn-src-all@freebsd.org Thu Oct 22 10:36:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C6D9444D2C; Thu, 22 Oct 2020 10:36:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH3gP20NSz3SR6; Thu, 22 Oct 2020 10:36: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2371C157A2; Thu, 22 Oct 2020 10:36:17 +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 09MAaGgi081829; Thu, 22 Oct 2020 10:36:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MAaGn6081828; Thu, 22 Oct 2020 10:36:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010221036.09MAaGn6081828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 10:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366935 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 366935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 10:36:17 -0000 Author: hselasky Date: Thu Oct 22 10:36:16 2020 New Revision: 366935 URL: https://svnweb.freebsd.org/changeset/base/366935 Log: Fix for colliding change (r366917). Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sbin/ifconfig/iflagg.c Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Thu Oct 22 10:29:27 2020 (r366934) +++ head/sbin/ifconfig/iflagg.c Thu Oct 22 10:36:16 2020 (r366935) @@ -363,5 +363,5 @@ lagg_ctor(void) for (i = 0; i < nitems(lagg_cmds); i++) cmd_register(&lagg_cmds[i]); af_register(&af_lagg); - clone_setdefcallback("lagg", lagg_create); + clone_setdefcallback_prefix("lagg", lagg_create); } From owner-svn-src-all@freebsd.org Thu Oct 22 12:22:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 673F7447AD9; Thu, 22 Oct 2020 12:22:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH61Y29Wbz3YM3; Thu, 22 Oct 2020 12:22: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D95F16CC3; Thu, 22 Oct 2020 12:22: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 09MCM870048408; Thu, 22 Oct 2020 12:22:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MCM8qo048407; Thu, 22 Oct 2020 12:22:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010221222.09MCM8qo048407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 22 Oct 2020 12:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366936 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 12:22:09 -0000 Author: hselasky Date: Thu Oct 22 12:22:08 2020 New Revision: 366936 URL: https://svnweb.freebsd.org/changeset/base/366936 Log: Compile fix for MIPS, MIPS64, POWERPC and POWERPC64. Add missing include files. Differential Revision: https://reviews.freebsd.org/D26254 Reviewed by: melifaro@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c ============================================================================== --- head/sys/net/if_infiniband.c Thu Oct 22 10:36:16 2020 (r366935) +++ head/sys/net/if_infiniband.c Thu Oct 22 12:22:08 2020 (r366936) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include From owner-svn-src-all@freebsd.org Thu Oct 22 13:22:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F96F448A1E; Thu, 22 Oct 2020 13:22:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CH7Mb05dkz3cd8; Thu, 22 Oct 2020 13:22:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D61E518385; Thu, 22 Oct 2020 13:22:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f42.google.com with SMTP id t6so808835qvz.4; Thu, 22 Oct 2020 06:22:50 -0700 (PDT) X-Gm-Message-State: AOAM532W777w1WITHkDIiozX7vt++2AfiXfXfjRb2DZgq9kJW4231Uv1 gWULstbt5W1DEhOAkbPc12e+W6Vaq7dDyTo5GnQ= X-Google-Smtp-Source: ABdhPJzIi2RoZyRlYpt9VIIZC7qfkuXXath43UeS166VmN0mmmJHObVj8vx/V+AvO2v++hlG3RDYVov+9VBH8ovBTV0= X-Received: by 2002:a0c:c709:: with SMTP id w9mr2130396qvi.26.1603372970325; Thu, 22 Oct 2020 06:22:50 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: From: Kyle Evans Date: Thu, 22 Oct 2020 08:22:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Warner Losh Cc: "Alexander V. Chernikov" , Hans Petter Selasky , Emmanuel Vadot , "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.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 13:22:51 -0000 On Sat, Oct 17, 2020 at 11:40 AM Warner Losh wrote: > > > > On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov wrote: >> >> 17.10.2020, 14:07, "Hans Petter Selasky" : >> >> On 2020-10-17 14:34, Alexander V. Chernikov wrote: >> >> 17.10.2020, 12:32, "Hans Petter Selasky" : >> >> On 2020-10-17 13:27, Alexander V. Chernikov wrote: >> >> 02.10.2020, 19:26, "Emmanuel Vadot" > >: >> >> Author: manu >> Date: Fri Oct 2 18:26:41 2020 >> New Revision: 366372 >> URL: https://svnweb.freebsd.org/changeset/base/366372 >> >> Log: >> linuxkpi: Add backlight support >> >> Add backlight function to linuxkpi. >> Graphics drivers expose the backlight of the panel directly so >> allow them >> to use the backlight subsystem so >> user can use backlight(8) to configure them. >> >> Reviewed by: hselasky >> Relnotes: yes >> Differential Revision: The FreeBSD Foundation >> >> Added: >> head/sys/compat/linuxkpi/common/include/linux/backlight.h >> (contents, >> props changed) >> Modified: >> head/sys/compat/linuxkpi/common/include/linux/device.h >> head/sys/compat/linuxkpi/common/src/linux_kmod.c >> head/sys/compat/linuxkpi/common/src/linux_pci.c >> head/sys/conf/kmod.mk >> >> It breaks the build for me with >> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: >> fatal error: 'backlight_if.h' file not found >> >> >> How do you build? Doesn't break over here. >> >> GENERIC + COMPAT_LINUXKPI. >> >> >> >> Try adding: >> >> options backlight >> >> To the kernel config. >> >> Yep, thank you! >> Maybe it's worth considering adding static assert with the message describing this dependency? > > > Yes. It likely is worth doing something to highlight this issue. > > Warner > I think we just need to slap the two core backlight files with an ` | compat_linux` so that they simply get pulled in if you specify COMPAT_LINUX. config(8) handles this terribly, configng must have a better provides/requires/implies/whatever functionality so we can specify that compat_linux implies backlight and not do crud like this where it becomes more complicated to see what any given option really entails. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Oct 22 15:23:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC3F144B584; Thu, 22 Oct 2020 15:23:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHB346LGwz429G; Thu, 22 Oct 2020 15:23:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCC8818A55; Thu, 22 Oct 2020 15:23:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MFNiFT061779; Thu, 22 Oct 2020 15:23:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MFNfWS061763; Thu, 22 Oct 2020 15:23:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010221523.09MFNfWS061763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 22 Oct 2020 15:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366937 - in stable/12: lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/ufs/ffs X-SVN-Commit-Revision: 366937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 15:23:45 -0000 Author: kib Date: Thu Oct 22 15:23:41 2020 New Revision: 366937 URL: https://svnweb.freebsd.org/changeset/base/366937 Log: MFC r339748, r340343, r340347, r341256, r366015-r366023, r366549: O_BENEATH and related features. Sponsored by: The FreeBSD Foundation Tested by: pho Modified: stable/12/lib/libc/sys/access.2 stable/12/lib/libc/sys/chflags.2 stable/12/lib/libc/sys/chmod.2 stable/12/lib/libc/sys/chown.2 stable/12/lib/libc/sys/fhlink.2 stable/12/lib/libc/sys/getfh.2 stable/12/lib/libc/sys/link.2 stable/12/lib/libc/sys/open.2 stable/12/lib/libc/sys/stat.2 stable/12/lib/libc/sys/unlink.2 stable/12/lib/libc/sys/utimensat.2 stable/12/sys/cddl/compat/opensolaris/sys/vnode.h stable/12/sys/compat/cloudabi/cloudabi_file.c stable/12/sys/compat/linux/linux_file.c stable/12/sys/kern/vfs_lookup.c stable/12/sys/kern/vfs_mountroot.c stable/12/sys/kern/vfs_syscalls.c stable/12/sys/kern/vfs_vnops.c stable/12/sys/sys/fcntl.h stable/12/sys/sys/namei.h stable/12/sys/sys/syscallsubr.h stable/12/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/access.2 ============================================================================== --- stable/12/lib/libc/sys/access.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/access.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt ACCESS 2 .Os .Sh NAME @@ -120,6 +120,20 @@ list, defined in The checks for accessibility are performed using the effective user and group IDs instead of the real user and group ID as required in a call to .Fn access . +.It Dv AT_BENEATH +Only operate on files and directories below the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp Even if a process's real or effective user has appropriate privileges @@ -197,6 +211,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn faccessat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chmod 2 , Modified: stable/12/lib/libc/sys/chflags.2 ============================================================================== --- stable/12/lib/libc/sys/chflags.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/chflags.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt CHFLAGS 2 .Os .Sh NAME @@ -94,6 +94,21 @@ defined in If .Fa path names a symbolic link, then the flags of the symbolic link are changed. +.It Dv AT_BENEATH +Only allow to change flags for a file which is beneath of +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -306,6 +321,24 @@ Corrupted data was detected while reading from the fil The underlying file system does not support file flags, or does not support all of the flags set in .Fa flags . +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn chflagsat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chflags 1 , Modified: stable/12/lib/libc/sys/chmod.2 ============================================================================== --- stable/12/lib/libc/sys/chmod.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/chmod.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt CHMOD 2 .Os .Sh NAME @@ -101,6 +101,21 @@ in If .Fa path names a symbolic link, then the mode of the symbolic link is changed. +.It Dv AT_BENEATH +Only allow to change permissions of a file which is beneath of +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -289,6 +304,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn fchmodat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chmod 1 , Modified: stable/12/lib/libc/sys/chown.2 ============================================================================== --- stable/12/lib/libc/sys/chown.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/chown.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt CHOWN 2 .Os .Sh NAME @@ -118,6 +118,21 @@ list, defined in If .Fa path names a symbolic link, ownership of the symbolic link is changed. +.It Dv AT_BENEATH +Only allow to change ownership of a file which is beneath of +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -231,6 +246,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn fchownat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chgrp 1 , Modified: stable/12/lib/libc/sys/fhlink.2 ============================================================================== --- stable/12/lib/libc/sys/fhlink.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/fhlink.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt FHLINK 2 .Os .Sh NAME @@ -110,6 +110,13 @@ created. Only allow to link to a file which is beneath of the topping directory. See the description of the .Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH flag in the .Xr open 2 manual page. Modified: stable/12/lib/libc/sys/getfh.2 ============================================================================== --- stable/12/lib/libc/sys/getfh.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/getfh.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt GETFH 2 .Os .Sh NAME @@ -109,6 +109,13 @@ names a symbolic link, the status of the symbolic link Only stat files and directories below the topping directory. See the description of the .Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH flag in the .Xr open 2 manual page. Modified: stable/12/lib/libc/sys/link.2 ============================================================================== --- stable/12/lib/libc/sys/link.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/link.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt LINK 2 .Os .Sh NAME @@ -115,6 +115,20 @@ If .Fa name1 names a symbolic link, a new link for the target of the symbolic link is created. +.It Dv AT_BENEATH +Only allow to link to a file which is beneath of the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -259,6 +273,26 @@ or respectively, is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa name1 +is not strictly relative to the starting directory. +For example, +.Fa name1 +is absolute or includes a ".." component that escapes +the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fa linkat +and the absolute path +.Fa name1 +does not have its tail fully contained under the topping directory, +or the relative path +.Fa name1 +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , Modified: stable/12/lib/libc/sys/open.2 ============================================================================== --- stable/12/lib/libc/sys/open.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/open.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt OPEN 2 .Os .Sh NAME @@ -75,8 +75,14 @@ function is equivalent to the .Fn open function except in the case where the .Fa path -specifies a relative path. -In this case the file to be opened is determined relative to the directory +specifies a relative path, or the +.Dv O_BENEATH +flag is provided. +For +.Fn openat +and relative +.Fa path , +the file to be opened is determined relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. @@ -95,6 +101,32 @@ parameter, the current working directory is used and the behavior is identical to a call to .Fn open . .Pp +When +.Fn openat +is called with an absolute +.Fa path +without the +.Dv O_BENEATH +flag, it ignores the +.Fa fd +argument. +When +.Dv O_BENEATH +is specified with an absolute +.Fa path , +a directory passed by the +.Fa fd +argument is used as the topping point for the resolution. +When +.Dv O_BENEATH +is specified with a relative path, the +.Fa fd +argument is used both as the starting point, and as the topping point +for the resolution. +See the definition of the +.Dv O_BENEATH +flag below. +.Pp In .Xr capsicum 4 capability mode, @@ -109,14 +141,28 @@ must be strictly relative to a file descriptor as defined in .Pa sys/kern/vfs_lookup.c . .Fa path -must not be an absolute path and must not contain ".." components. +must not be an absolute path and must not contain ".." components +which cause the path resolution to escape the directory hierarchy +starting at +.Fa fd . Additionally, no symbolic link in .Fa path -may contain ".." components either. +may target absolute path or contain escaping ".." components. .Fa fd must not be .Dv AT_FDCWD . .Pp +If the +.Dv vfs.lookup_cap_dotdot +.Xr sysctl 3 +MIB is set to zero, ".." components in the paths, +used in capability mode, or with the +.Dv O_BENEATH +flag, are completely disabled. +If the +.Dv vfs.lookup_cap_dotdot_nonlocal +MIB is set to zero, ".." is not allowed if found on non-local filesystem. +.Pp The flags specified are formed by .Em or Ns 'ing the following values @@ -143,6 +189,8 @@ O_TTY_INIT ignored O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file +O_BENEATH require resolved path to be strictly relative to topping directory +O_RESOLVE_BENEATH require walked path to be strictly relative to topping directory .Ed .Pp Opening a file with @@ -266,7 +314,34 @@ The details of what means is implementation specific. The run-time linker (rtld) uses this flag to ensure shared objects have been verified before operating on them. +.Dv O_BENEATH +returns +.Er ENOTCAPABLE +if the specified path, after resolving all symlinks and ".." +references, does not end up with tail residing in the directory hierarchy of +children beneath the topping directory. +Topping directory is the process current directory if relative +.Fa path +is used for +.Fn open , +and the directory referenced by the +.Fa fd +argument when using +.Fn openat . +.Dv O_BENEATH +allows arbitrary prefix that ends up at the topping directory, +after which all further resolved components must be under it. .Pp +.Dv O_RESOLVE_BENEATH +returns +.Er ENOTCAPABLE +if any intermediate component of the specified relative path does not +reside in the directory hierarchy beneath the topping directory. +Comparing to +.Dv O_BENEATH, +absolute paths or even the temporal escape from beneath of the topping +directory is not allowed. +.Pp When .Fa fd is opened with @@ -280,6 +355,7 @@ The primary use for this descriptor will be as the loo .Fn *at family of functions. .Pp +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. @@ -480,6 +556,12 @@ and .Dv O_EXEC or .Dv O_SEARCH . +.It Bq Er EINVAL +The +.Dv O_RESOLVE_BENEATH +flag is specified and +.Dv path +is absolute. .It Bq Er EBADF The .Fa path @@ -508,9 +590,26 @@ is specified and the process is in capability mode. was called and the process is in capability mode. .It Bq Er ENOTCAPABLE .Fa path -is an absolute path or contained a ".." component leading to a +is an absolute path, +or contained a ".." component leading to a directory outside of the directory hierarchy specified by -.Fa fd . +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv O_BENEATH +flag was provided, and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. +.It Bq Er ENOTCAPABLE +The +.Dv O_RESOLVE_BENEATH +flag was provided, and the relative +.Fa path +escapes topping directory. .El .Sh SEE ALSO .Xr chmod 2 , Modified: stable/12/lib/libc/sys/stat.2 ============================================================================== --- stable/12/lib/libc/sys/stat.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/stat.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt STAT 2 .Os .Sh NAME @@ -84,11 +84,24 @@ and .Fn lstat except when the .Fa path -specifies a relative path. -In this case the status is retrieved from a file relative to +specifies a relative path, or the +.Dv AT_BENEATH +flag is provided. +For +.Fn fstatat +and relative +.Fa path , +the status is retrieved from a file relative to the directory associated with the file descriptor .Fa fd instead of the current working directory. +For +.Dv AT_BENEATH +and absolute +.Fa path , +the status is retrieved from a file specified by the +.Fa path , +but additional permission checks are performed, see below. .Pp The values for the .Fa flag @@ -100,6 +113,20 @@ defined in If .Fa path names a symbolic link, the status of the symbolic link is returned. +.It Dv AT_BENEATH +Only stat files and directories below the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -118,6 +145,23 @@ respectively, depending on whether or not the bit is set in .Fa flag . .Pp +When +.Fn fstatat +is called with an absolute +.Fa path +without the +.Dv AT_BENEATH +flag, it ignores the +.Fa fd +argument. +When +.Dv AT_BENEATH +is specified with an absolute +.Fa path , +a directory passed by the +.Fa fd +argument is used as the topping point for the resolution. +.Pp The .Fa sb argument is a pointer to a @@ -409,6 +453,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn fstatat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr access 2 , Modified: stable/12/lib/libc/sys/unlink.2 ============================================================================== --- stable/12/lib/libc/sys/unlink.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/unlink.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt UNLINK 2 .Os .Sh NAME @@ -89,6 +89,21 @@ Remove the directory entry specified by and .Fa path as a directory, not a normal file. +.It Dv AT_BENEATH +Only unlink files and directories which are beneath of the topping +directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Pp If @@ -202,6 +217,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn unlinkat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , Modified: stable/12/lib/libc/sys/utimensat.2 ============================================================================== --- stable/12/lib/libc/sys/utimensat.2 Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/lib/libc/sys/utimensat.2 Thu Oct 22 15:23:41 2020 (r366937) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd September 23, 2020 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -146,6 +146,21 @@ names a symbolic link, the symbolic link's times are c By default, .Fn utimensat changes the times of the file referenced by the symbolic link. +.It Dv AT_BENEATH +Only allow to change the times of a file which is beneath of +the topping directory. +See the description of the +.Dv O_BENEATH +flag in the +.Xr open 2 +manual page. +.It Dv AT_RESOLVE_BENEATH +Only walks paths below the topping directory. +See the description of the +.Dv O_RESOLVE_BENEATH +flag in the +.Xr open 2 +manual page. .El .Sh RETURN VALUES .Rv -std @@ -269,6 +284,24 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path, +or contained a ".." component leading to a +directory outside of the directory hierarchy specified by +.Fa fd , +and the process is in capability mode. +.It Bq Er ENOTCAPABLE +The +.Dv AT_BENEATH +flag was provided to +.Fn utimensat , +and the absolute +.Fa path +does not have its tail fully contained under the topping directory, +or the relative +.Fa path +escapes it. .El .Sh SEE ALSO .Xr chflags 2 , Modified: stable/12/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/sys/vnode.h Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/sys/cddl/compat/opensolaris/sys/vnode.h Thu Oct 22 15:23:41 2020 (r366937) @@ -278,7 +278,7 @@ vn_remove(char *fnamep, enum uio_seg seg, enum rm dirf ASSERT(seg == UIO_SYSSPACE); ASSERT(dirflag == RMFILE); - return (kern_unlinkat(curthread, AT_FDCWD, fnamep, seg, 0)); + return (kern_unlinkat(curthread, AT_FDCWD, fnamep, seg, 0, 0)); } #endif /* _KERNEL */ Modified: stable/12/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- stable/12/sys/compat/cloudabi/cloudabi_file.c Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/sys/compat/cloudabi/cloudabi_file.c Thu Oct 22 15:23:41 2020 (r366937) @@ -752,9 +752,9 @@ cloudabi_sys_file_unlink(struct thread *td, return (error); if (uap->flags & CLOUDABI_UNLINK_REMOVEDIR) - error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE); + error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE, 0); else - error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0, 0); cloudabi_freestr(path); return (error); } Modified: stable/12/sys/compat/linux/linux_file.c ============================================================================== --- stable/12/sys/compat/linux/linux_file.c Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/sys/compat/linux/linux_file.c Thu Oct 22 15:23:41 2020 (r366937) @@ -540,7 +540,7 @@ linux_unlink(struct thread *td, struct linux_unlink_ar LCONVPATHEXIST(td, args->path, &path); - error = kern_unlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, 0); if (error == EPERM) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, @@ -568,9 +568,9 @@ linux_unlinkat(struct thread *td, struct linux_unlinka LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); if (args->flag & LINUX_AT_REMOVEDIR) - error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE); + error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE, 0); else - error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0); + error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0, 0); if (error == EPERM && !(args->flag & LINUX_AT_REMOVEDIR)) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, AT_SYMLINK_NOFOLLOW, dfd, path, @@ -661,7 +661,7 @@ linux_rmdir(struct thread *td, struct linux_rmdir_args LCONVPATHEXIST(td, args->path, &path); - error = kern_rmdirat(td, AT_FDCWD, path, UIO_SYSSPACE); + error = kern_rmdirat(td, AT_FDCWD, path, UIO_SYSSPACE, 0); LFREEPATH(path); return (error); } Modified: stable/12/sys/kern/vfs_lookup.c ============================================================================== --- stable/12/sys/kern/vfs_lookup.c Thu Oct 22 12:22:08 2020 (r366936) +++ stable/12/sys/kern/vfs_lookup.c Thu Oct 22 15:23:41 2020 (r366937) @@ -174,9 +174,18 @@ static void nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) { struct nameicap_tracker *nt; + struct componentname *cnp; if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; + cnp = &ndp->ni_cnd; + if ((cnp->cn_flags & BENEATH) != 0 && + (ndp->ni_lcf & NI_LCF_BENEATH_LATCHED) == 0) { + MPASS((ndp->ni_lcf & NI_LCF_LATCH) != 0); + if (dp != ndp->ni_beneath_latch) + return; + ndp->ni_lcf |= NI_LCF_BENEATH_LATCHED; + } nt = uma_zalloc(nt_zone, M_WAITOK); vhold(dp); nt->dp = dp; @@ -184,7 +193,7 @@ nameicap_tracker_add(struct nameidata *ndp, struct vno } static void -nameicap_cleanup(struct nameidata *ndp) +nameicap_cleanup(struct nameidata *ndp, bool clean_latch) { struct nameicap_tracker *nt, *nt1; @@ -195,12 +204,20 @@ nameicap_cleanup(struct nameidata *ndp) vdrop(nt->dp); uma_zfree(nt_zone, nt); } + if (clean_latch && (ndp->ni_lcf & NI_LCF_LATCH) != 0) { + ndp->ni_lcf &= ~NI_LCF_LATCH; + vrele(ndp->ni_beneath_latch); + } } /* * For dotdot lookups in capability mode, only allow the component * lookup to succeed if the resulting directory was already traversed - * during the operation. Also fail dotdot lookups for non-local + * during the operation. This catches situations where already + * traversed directory is moved to different parent, and then we walk + * over it with dotdots. + * + * Also allow to force failure of dotdot lookups for non-local * filesystems, where external agents might assist local lookups to * escape the compartment. */ @@ -219,6 +236,12 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vn return (ENOTCAPABLE); TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head, nm_link) { + if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 && + ndp->ni_beneath_latch == nt->dp) { + ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; + nameicap_cleanup(ndp, false); + return (0); + } if (dp == nt->dp) return (0); } @@ -249,6 +272,11 @@ namei_handle_root(struct nameidata *ndp, struct vnode #endif return (ENOTCAPABLE); } + if ((cnp->cn_flags & BENEATH) != 0) { + ndp->ni_lcf |= NI_LCF_BENEATH_ABS; + ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED; + nameicap_cleanup(ndp, false); + } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -290,6 +318,7 @@ namei(struct nameidata *ndp) struct thread *td; struct proc *p; cap_rights_t rights; + struct filecaps dirfd_caps; struct uio auio; int error, linklen, startdir_used; @@ -347,6 +376,7 @@ namei(struct nameidata *ndp) if (error == 0 && IN_CAPABILITY_MODE(td) && (cnp->cn_flags & NOCAPCHECK) == 0) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; + ndp->ni_resflags |= NIRES_STRICTREL; if (ndp->ni_dirfd == AT_FDCWD) { #ifdef KTRACE if (KTRPOINT(td, KTR_CAPFAIL)) @@ -441,13 +471,42 @@ namei(struct nameidata *ndp) ndp->ni_filecaps.fc_fcntls != CAP_FCNTL_ALL || ndp->ni_filecaps.fc_nioctls != -1) { ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; + ndp->ni_resflags |= NIRES_STRICTREL; } #endif } if (error == 0 && dp->v_type != VDIR) error = ENOTDIR; } + if (error == 0 && (cnp->cn_flags & BENEATH) != 0) { + if (ndp->ni_dirfd == AT_FDCWD) { + ndp->ni_beneath_latch = fdp->fd_cdir; + vrefact(ndp->ni_beneath_latch); + } else { + rights = ndp->ni_rightsneeded; + cap_rights_set(&rights, CAP_LOOKUP); + error = fgetvp_rights(td, ndp->ni_dirfd, &rights, + &dirfd_caps, &ndp->ni_beneath_latch); + if (error == 0 && dp->v_type != VDIR) { + vrele(ndp->ni_beneath_latch); + error = ENOTDIR; + } + } + if (error == 0) + ndp->ni_lcf |= NI_LCF_LATCH; + } FILEDESC_SUNLOCK(fdp); + + if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { + if (cnp->cn_pnbuf[0] == '/' || + (ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) { + error = EINVAL; + } else if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0) { + ndp->ni_lcf |= NI_LCF_STRICTRELATIVE | + NI_LCF_CAP_DOTDOT; + } + } + if (ndp->ni_startdir != NULL && !startdir_used) vrele(ndp->ni_startdir); if (error != 0) { @@ -455,16 +514,29 @@ namei(struct nameidata *ndp) vrele(dp); goto out; } - if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && - lookup_cap_dotdot != 0) + MPASS((ndp->ni_lcf & (NI_LCF_BENEATH_ABS | NI_LCF_LATCH)) != + NI_LCF_BENEATH_ABS); + if (((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 && + lookup_cap_dotdot != 0) || + ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && + (cnp->cn_flags & BENEATH) != 0)) ndp->ni_lcf |= NI_LCF_CAP_DOTDOT; SDT_PROBE3(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, cnp->cn_flags); for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) + if (error != 0) { + /* + * Override an error to not allow user to use + * BENEATH as an oracle. + */ + if ((ndp->ni_lcf & (NI_LCF_LATCH | + NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) + error = ENOTCAPABLE; goto out; + } + /* * If not a symbolic link, we're done. */ @@ -474,9 +546,15 @@ namei(struct nameidata *ndp) namei_cleanup_cnp(cnp); } else cnp->cn_flags |= HASBUF; - nameicap_cleanup(ndp); - SDT_PROBE2(vfs, namei, lookup, return, 0, ndp->ni_vp); - return (0); + if ((ndp->ni_lcf & (NI_LCF_LATCH | + NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) { + NDFREE(ndp, 0); + error = ENOTCAPABLE; + } + nameicap_cleanup(ndp, true); + SDT_PROBE2(vfs, namei, lookup, return, error, + (error == 0 ? ndp->ni_vp : NULL)); + return (error); } if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { error = ELOOP; @@ -547,8 +625,9 @@ namei(struct nameidata *ndp) vrele(ndp->ni_dvp); out: vrele(ndp->ni_rootdir); + MPASS(error != 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Oct 22 16:27:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 011B444C85F; Thu, 22 Oct 2020 16:27:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHCSX6K6gz462J; Thu, 22 Oct 2020 16:27:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4844196E3; Thu, 22 Oct 2020 16:27:24 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MGRO3C000215; Thu, 22 Oct 2020 16:27:24 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MGROIC000214; Thu, 22 Oct 2020 16:27:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010221627.09MGROIC000214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 22 Oct 2020 16:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366938 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 366938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 16:27:25 -0000 Author: brooks Date: Thu Oct 22 16:27:24 2020 New Revision: 366938 URL: https://svnweb.freebsd.org/changeset/base/366938 Log: MFC r366731: physio: Don't store user addresses in bio_data Only assign the address from the iovec to bio_data if it is a kernel address. This was the single place where bio_data stored (however briefly) a userspace pointer. Reviewed by: imp, markj Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26783 Modified: stable/12/sys/kern/kern_physio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_physio.c ============================================================================== --- stable/12/sys/kern/kern_physio.c Thu Oct 22 15:23:41 2020 (r366937) +++ stable/12/sys/kern/kern_physio.c Thu Oct 22 16:27:24 2020 (r366938) @@ -45,7 +45,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) struct buf *pbuf; struct bio *bp; struct vm_page **pages; - caddr_t sa; + char *base, *sa; u_int iolen, poff; int error, i, npages, maxpages; vm_prot_t prot; @@ -140,7 +140,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) curthread->td_ru.ru_oublock++; } bp->bio_offset = uio->uio_offset; - bp->bio_data = uio->uio_iov[i].iov_base; + base = uio->uio_iov[i].iov_base; bp->bio_length = uio->uio_iov[i].iov_len; if (bp->bio_length > dev->si_iosize_max) bp->bio_length = dev->si_iosize_max; @@ -153,13 +153,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) * larger than MAXPHYS - PAGE_SIZE must be * page aligned or it will be fragmented. */ - poff = (vm_offset_t)bp->bio_data & PAGE_MASK; + poff = (vm_offset_t)base & PAGE_MASK; if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) { if (dev->si_flags & SI_NOSPLIT) { uprintf("%s: request ptr %p is not " "on a page boundary; cannot split " "request\n", devtoname(dev), - bp->bio_data); + base); error = EFBIG; goto doerror; } @@ -174,7 +174,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) if (pages) { if ((npages = vm_fault_quick_hold_pages( &curproc->p_vmspace->vm_map, - (vm_offset_t)bp->bio_data, bp->bio_length, + (vm_offset_t)base, bp->bio_length, prot, pages, maxpages)) < 0) { error = EFAULT; goto doerror; @@ -190,7 +190,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) bp->bio_data = unmapped_buf; bp->bio_flags |= BIO_UNMAPPED; } - } + } else + bp->bio_data = base; csw->d_strategy(bp); if (uio->uio_rw == UIO_READ) From owner-svn-src-all@freebsd.org Thu Oct 22 16:29:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 938C944CC1B; Thu, 22 Oct 2020 16:29:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHCVp3N28z4616; Thu, 22 Oct 2020 16:29:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3951B19879; Thu, 22 Oct 2020 16:29:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MGTMhE000357; Thu, 22 Oct 2020 16:29:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MGTMxY000356; Thu, 22 Oct 2020 16:29:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010221629.09MGTMxY000356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 22 Oct 2020 16:29: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: r366939 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 366939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 16:29:22 -0000 Author: brooks Date: Thu Oct 22 16:29:21 2020 New Revision: 366939 URL: https://svnweb.freebsd.org/changeset/base/366939 Log: MFC r366731: physio: Don't store user addresses in bio_data Only assign the address from the iovec to bio_data if it is a kernel address. This was the single place where bio_data stored (however briefly) a userspace pointer. Reviewed by: imp, markj Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26783 Modified: stable/11/sys/kern/kern_physio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_physio.c ============================================================================== --- stable/11/sys/kern/kern_physio.c Thu Oct 22 16:27:24 2020 (r366938) +++ stable/11/sys/kern/kern_physio.c Thu Oct 22 16:29:21 2020 (r366939) @@ -43,7 +43,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) struct buf *pbuf; struct bio *bp; struct vm_page **pages; - caddr_t sa; + char *base, *sa; u_int iolen, poff; int error, i, npages, maxpages; vm_prot_t prot; @@ -136,7 +136,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) curthread->td_ru.ru_oublock++; } bp->bio_offset = uio->uio_offset; - bp->bio_data = uio->uio_iov[i].iov_base; + base = uio->uio_iov[i].iov_base; bp->bio_length = uio->uio_iov[i].iov_len; if (bp->bio_length > dev->si_iosize_max) bp->bio_length = dev->si_iosize_max; @@ -149,13 +149,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) * larger than MAXPHYS - PAGE_SIZE must be * page aligned or it will be fragmented. */ - poff = (vm_offset_t)bp->bio_data & PAGE_MASK; + poff = (vm_offset_t)base & PAGE_MASK; if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) { if (dev->si_flags & SI_NOSPLIT) { uprintf("%s: request ptr %p is not " "on a page boundary; cannot split " "request\n", devtoname(dev), - bp->bio_data); + base); error = EFBIG; goto doerror; } @@ -170,7 +170,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) if (pages) { if ((npages = vm_fault_quick_hold_pages( &curproc->p_vmspace->vm_map, - (vm_offset_t)bp->bio_data, bp->bio_length, + (vm_offset_t)base, bp->bio_length, prot, pages, maxpages)) < 0) { error = EFAULT; goto doerror; @@ -186,7 +186,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) bp->bio_data = unmapped_buf; bp->bio_flags |= BIO_UNMAPPED; } - } + } else + bp->bio_data = base; csw->d_strategy(bp); if (uio->uio_rw == UIO_READ) From owner-svn-src-all@freebsd.org Thu Oct 22 16:41:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A35CE44CBD9; Thu, 22 Oct 2020 16:41:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHCmV3tD0z46jQ; Thu, 22 Oct 2020 16:41:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 697B019D09; Thu, 22 Oct 2020 16:41:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MGfEs7009497; Thu, 22 Oct 2020 16:41:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MGfEj1009457; Thu, 22 Oct 2020 16:41:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010221641.09MGfEj1009457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 22 Oct 2020 16:41: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: r366940 - stable/11/lib/libgssapi X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libgssapi X-SVN-Commit-Revision: 366940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 16:41:14 -0000 Author: brooks Date: Thu Oct 22 16:41:13 2020 New Revision: 366940 URL: https://svnweb.freebsd.org/changeset/base/366940 Log: MFC r366671: libgssapi: modernize static string array use Use designated initializers to document positions in the arrays rather than requiring counting. Use nitems() rather than rolling it by hand to count elements. Also, passify a Clang 12 warning about suspcious string concatenation within an array initializer by adding parentheses. Reviewed by: emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26592 Modified: stable/11/lib/libgssapi/gss_display_status.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libgssapi/gss_display_status.c ============================================================================== --- stable/11/lib/libgssapi/gss_display_status.c Thu Oct 22 16:29:21 2020 (r366939) +++ stable/11/lib/libgssapi/gss_display_status.c Thu Oct 22 16:41:13 2020 (r366940) @@ -90,6 +90,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -103,17 +104,15 @@ static const char * calling_error(OM_uint32 v) { static const char *msgs[] = { - NULL, /* 0 */ - "A required input parameter could not be read.", /* */ - "A required output parameter could not be written.", /* */ - "A parameter was malformed" + [0] = "", + [1] = "A required input parameter could not be read.", + [2] = "A required output parameter could not be written.", + [3] = "A parameter was malformed", }; v >>= GSS_C_CALLING_ERROR_OFFSET; - if (v == 0) - return ""; - else if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown calling error"; else return msgs[v]; @@ -123,31 +122,31 @@ static const char * routine_error(OM_uint32 v) { static const char *msgs[] = { - "Function completed successfully", /* 0 */ - "An unsupported mechanism was requested", - "An invalid name was supplied", - "A supplied name was of an unsupported type", - "Incorrect channel bindings were supplied", - "An invalid status code was supplied", - "A token had an invalid MIC", - "No credentials were supplied, " - "or the credentials were unavailable or inaccessible.", - "No context has been established", - "A token was invalid", - "A credential was invalid", - "The referenced credentials have expired", - "The context has expired", - "Miscellaneous failure (see text)", - "The quality-of-protection requested could not be provide", - "The operation is forbidden by local security policy", - "The operation or option is not available", - "The requested credential element already exists", - "The provided name was not a mechanism name.", + [0] = "Function completed successfully", + [1] = "An unsupported mechanism was requested", + [2] = "An invalid name was supplied", + [3] = "A supplied name was of an unsupported type", + [4] = "Incorrect channel bindings were supplied", + [5] = "An invalid status code was supplied", + [6] = "A token had an invalid MIC", + [7] = ("No credentials were supplied, " + "or the credentials were unavailable or inaccessible."), + [8] = "No context has been established", + [9] = "A token was invalid", + [10] = "A credential was invalid", + [11] = "The referenced credentials have expired", + [12] = "The context has expired", + [13] = "Miscellaneous failure (see text)", + [14] = "The quality-of-protection requested could not be provide", + [15] = "The operation is forbidden by local security policy", + [16] = "The operation or option is not available", + [17] = "The requested credential element already exists", + [18] = "The provided name was not a mechanism name.", }; v >>= GSS_C_ROUTINE_ERROR_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; @@ -157,17 +156,17 @@ static const char * supplementary_error(OM_uint32 v) { static const char *msgs[] = { - "normal completion", - "continuation call to routine required", - "duplicate per-message token detected", - "timed-out per-message token detected", - "reordered (early) per-message token detected", - "skipped predecessor token(s) detected" + [0] = "normal completion", + [1] = "continuation call to routine required", + [2] = "duplicate per-message token detected", + [3] = "timed-out per-message token detected", + [4] = "reordered (early) per-message token detected", + [5] = "skipped predecessor token(s) detected", }; v >>= GSS_C_SUPPLEMENTARY_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; From owner-svn-src-all@freebsd.org Thu Oct 22 16:48:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A207544CDB4; Thu, 22 Oct 2020 16:48:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHCwg08BYz473l; Thu, 22 Oct 2020 16:48:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09MGm4qM047016 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 22 Oct 2020 19:48:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09MGm4qM047016 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09MGm4ns047015; Thu, 22 Oct 2020 19:48:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Oct 2020 19:48:04 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366936 - head/sys/net Message-ID: <20201022164804.GQ2643@kib.kiev.ua> References: <202010221222.09MCM8qo048407@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010221222.09MCM8qo048407@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CHCwg08BYz473l X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 16:48:19 -0000 On Thu, Oct 22, 2020 at 12:22:08PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Oct 22 12:22:08 2020 > New Revision: 366936 > URL: https://svnweb.freebsd.org/changeset/base/366936 > > Log: > Compile fix for MIPS, MIPS64, POWERPC and POWERPC64. > Add missing include files. > > Differential Revision: https://reviews.freebsd.org/D26254 > Reviewed by: melifaro@ > MFC after: 1 week > Sponsored by: Mellanox Technologies // NVIDIA Networking > > Modified: > head/sys/net/if_infiniband.c > > Modified: head/sys/net/if_infiniband.c > ============================================================================== > --- head/sys/net/if_infiniband.c Thu Oct 22 10:36:16 2020 (r366935) > +++ head/sys/net/if_infiniband.c Thu Oct 22 12:22:08 2020 (r366936) > @@ -29,6 +29,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include > +#include > #include > #include > #include sys/systm.h already includes sys/param.h. Also, sys/param.h already includes sys/types.h. From owner-svn-src-all@freebsd.org Thu Oct 22 17:05:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 064FF44DA14; Thu, 22 Oct 2020 17:05:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHDJz641Qz4822; Thu, 22 Oct 2020 17:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3D8319A73; Thu, 22 Oct 2020 17:05: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 09MH5ttZ024747; Thu, 22 Oct 2020 17:05:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MH5tXh024746; Thu, 22 Oct 2020 17:05:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010221705.09MH5tXh024746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 22 Oct 2020 17:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366941 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 17:05:56 -0000 Author: np Date: Thu Oct 22 17:05:55 2020 New Revision: 366941 URL: https://svnweb.freebsd.org/changeset/base/366941 Log: if_vxlan(4): csum_flags_to_inner_flags takes the tunnel protocol as a parameter. No functional change. Modified: head/sys/net/if_vxlan.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Thu Oct 22 16:41:13 2020 (r366940) +++ head/sys/net/if_vxlan.c Thu Oct 22 17:05:55 2020 (r366941) @@ -2423,9 +2423,9 @@ vxlan_encap_header(struct vxlan_softc *sc, struct mbuf * Return the CSUM_INNER_* equivalent of CSUM_* caps. */ static uint32_t -csum_flags_to_inner_flags(uint32_t csum_flags_in, uint32_t encap) +csum_flags_to_inner_flags(uint32_t csum_flags_in, const uint32_t encap) { - uint32_t csum_flags = CSUM_ENCAP_VXLAN; + uint32_t csum_flags = encap; const uint32_t v4 = CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP; /* From owner-svn-src-all@freebsd.org Thu Oct 22 17:31:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 649B844E000; Thu, 22 Oct 2020 17:31:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHDtk23lWz4CVN; Thu, 22 Oct 2020 17:31:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10D481A2C7; Thu, 22 Oct 2020 17:31:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MHVfGD042501; Thu, 22 Oct 2020 17:31:41 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MHVfau042500; Thu, 22 Oct 2020 17:31:41 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010221731.09MHVfau042500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 22 Oct 2020 17:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366942 - stable/12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/12/sys/dev/uart X-SVN-Commit-Revision: 366942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 17:31:42 -0000 Author: mw Date: Thu Oct 22 17:31:41 2020 New Revision: 366942 URL: https://svnweb.freebsd.org/changeset/base/366942 Log: MFC r362574 Fix AccessWidth and BitWidth parsing in SPCR table The ACPI Specification defines a Generic Address Structure (GAS), which is used to describe UART controller register layout in the SPCR table. The driver responsible for parsing it (uart_cpu_acpi) wrongly associates the Access Size field to the uart_bas's regshft and the register BitWidth to the regiowidth - according to the definitions it should be opposite. This problem remained hidden most likely because the majority of platforms use 32-bit registers (BitWidth) which are accessed with the according size (Dword). However on Marvell Armada 8k / Cn913x platforms, the 32-bit registers should be accessed with Byte granulity, which unveiled the issue. This patch fixes above by proper values assignment and slightly improved parsing. Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances. Reviewed by: manu, imp, cperciva, greg_unrelenting.technology Obtained from: Semihalf Modified: stable/12/sys/dev/uart/uart_cpu_acpi.c Modified: stable/12/sys/dev/uart/uart_cpu_acpi.c ============================================================================== --- stable/12/sys/dev/uart/uart_cpu_acpi.c Thu Oct 22 17:05:55 2020 (r366941) +++ stable/12/sys/dev/uart/uart_cpu_acpi.c Thu Oct 22 17:31:41 2020 (r366942) @@ -120,11 +120,46 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *d (int)spcr->SerialPort.SpaceId); goto out; } - if (spcr->SerialPort.AccessWidth == 0) + switch (spcr->SerialPort.AccessWidth) { + case 0: /* EFI_ACPI_6_0_UNDEFINED */ + /* FALLTHROUGH */ + case 1: /* EFI_ACPI_6_0_BYTE */ + di->bas.regiowidth = 1; + break; + case 2: /* EFI_ACPI_6_0_WORD */ + di->bas.regiowidth = 2; + break; + case 3: /* EFI_ACPI_6_0_DWORD */ + di->bas.regiowidth = 4; + break; + case 4: /* EFI_ACPI_6_0_QWORD */ + di->bas.regiowidth = 8; + break; + default: + printf("UART unsupported access width: %d!\n", + (int)spcr->SerialPort.AccessWidth); + goto out; + } + switch (spcr->SerialPort.BitWidth) { + case 0: + /* FALLTHROUGH */ + case 8: di->bas.regshft = 0; - else - di->bas.regshft = spcr->SerialPort.AccessWidth - 1; - di->bas.regiowidth = spcr->SerialPort.BitWidth / 8; + break; + case 16: + di->bas.regshft = 1; + break; + case 32: + di->bas.regshft = 2; + break; + case 64: + di->bas.regshft = 3; + break; + default: + printf("UART unsupported bit width: %d!\n", + (int)spcr->SerialPort.BitWidth); + goto out; + } switch (spcr->BaudRate) { case 0: /* Special value; means "keep current value unchanged". */ From owner-svn-src-all@freebsd.org Thu Oct 22 17:46:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D949744E93D; Thu, 22 Oct 2020 17:46:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHFDH5VLPz4GXr; Thu, 22 Oct 2020 17:46:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FC3E1A632; Thu, 22 Oct 2020 17:46:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MHkt32053257; Thu, 22 Oct 2020 17:46:55 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MHktox053256; Thu, 22 Oct 2020 17:46:55 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202010221746.09MHktox053256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 22 Oct 2020 17:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366943 - head/sys/crypto/ccp X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/crypto/ccp X-SVN-Commit-Revision: 366943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 17:46:55 -0000 Author: jkim Date: Thu Oct 22 17:46:55 2020 New Revision: 366943 URL: https://svnweb.freebsd.org/changeset/base/366943 Log: Add a new CCP device ID found on my Ryzen 5 3600XT. MFC after: 1 week Modified: head/sys/crypto/ccp/ccp.c Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Thu Oct 22 17:31:41 2020 (r366942) +++ head/sys/crypto/ccp/ccp.c Thu Oct 22 17:46:55 2020 (r366943) @@ -78,6 +78,7 @@ static struct pciid { } ccp_ids[] = { { 0x14561022, "AMD CCP-5a" }, { 0x14681022, "AMD CCP-5b" }, + { 0x14861022, "AMD CCP-5a" }, { 0x15df1022, "AMD CCP-5a" }, }; From owner-svn-src-all@freebsd.org Thu Oct 22 17:47:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1559A44E9DE; Thu, 22 Oct 2020 17:47:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHFFM6s2mz4GbS; Thu, 22 Oct 2020 17:47:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE7051AA0C; Thu, 22 Oct 2020 17:47:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MHlpIx053344; Thu, 22 Oct 2020 17:47:51 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MHlprO053343; Thu, 22 Oct 2020 17:47:51 GMT (envelope-from alc@FreeBSD.org) Message-Id: <202010221747.09MHlprO053343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 22 Oct 2020 17:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366944 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 17:47:52 -0000 Author: alc Date: Thu Oct 22 17:47:51 2020 New Revision: 366944 URL: https://svnweb.freebsd.org/changeset/base/366944 Log: Micro-optimize uma_small_alloc(). Replace bzero(..., PAGE_SIZE) by pagezero(). Ultimately, they use the same method for bulk zeroing, but the generality of bzero() requires size and alignment checks that pagezero() does not. Eliminate an unnecessary #include. Reviewed by: emaste, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26876 Modified: head/sys/arm64/arm64/uma_machdep.c Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Thu Oct 22 17:46:55 2020 (r366943) +++ head/sys/arm64/arm64/uma_machdep.c Thu Oct 22 17:47:51 2020 (r366944) @@ -36,11 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include -#include +#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, @@ -60,7 +59,7 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); + pagezero(va); return (va); } From owner-svn-src-all@freebsd.org Thu Oct 22 17:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5664644EB54; Thu, 22 Oct 2020 17:55:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHFPX1fngz4HZH; Thu, 22 Oct 2020 17:54:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id BF9012602CC; Thu, 22 Oct 2020 19:54:45 +0200 (CEST) Subject: Re: svn commit: r366936 - head/sys/net To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> From: Hans Petter Selasky Message-ID: <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> Date: Thu, 22 Oct 2020 19:54:06 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201022164804.GQ2643@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CHFPX1fngz4HZH X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.63 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.986]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.47)[-0.469]; NEURAL_HAM_MEDIUM(-0.87)[-0.872]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 17:55:02 -0000 On 2020-10-22 18:48, Konstantin Belousov wrote: > sys/systm.h already includes sys/param.h. Also, sys/param.h already includes > sys/types.h. I'll have a look tomorrow at this. Thanks for pointing out. --HPS From owner-svn-src-all@freebsd.org Thu Oct 22 18:00:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C07C144F313; Thu, 22 Oct 2020 18:00:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHFWW4m2Gz4KdH; Thu, 22 Oct 2020 18:00:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E431A5DC; Thu, 22 Oct 2020 18:00:07 +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 09MI07GP063876; Thu, 22 Oct 2020 18:00:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MI07GS063875; Thu, 22 Oct 2020 18:00:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202010221800.09MI07GS063875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 22 Oct 2020 18:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366945 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 366945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 18:00:07 -0000 Author: glebius Date: Thu Oct 22 18:00:07 2020 New Revision: 366945 URL: https://svnweb.freebsd.org/changeset/base/366945 Log: Fix typo Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Thu Oct 22 17:47:51 2020 (r366944) +++ head/share/man/man9/pfil.9 Thu Oct 22 18:00:07 2020 (r366945) @@ -144,7 +144,7 @@ Link-layer packets. .El .Pp Default rulesets are automatically linked to these heads to preserve -historical behavavior. +historical behaviour. .Sh SEE ALSO .Xr ipfilter 4 , .Xr ipfw 4 , From owner-svn-src-all@freebsd.org Thu Oct 22 18:08:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF2B644F620 for ; Thu, 22 Oct 2020 18:08:26 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHFj56mVpz4LDv for ; Thu, 22 Oct 2020 18:08:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f46.google.com with SMTP id l15so3461451wmi.3 for ; Thu, 22 Oct 2020 11:08:25 -0700 (PDT) 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=rXcj/sQ8OaAf7DlGOhNz+eIEoBhUV6nYblgb1YdD9uA=; b=mUYOn300tAp8PmZk5wdgkHbQ+FBnBs+FlTwLz51eOFncg/2THpLN6L/QrJRWkbZSH8 qtnquxegPSJkx9lBBZP0+S5SjW3zlFkL31pCUDloheTXUaS08hteayPi3NCT4RtufrGE nmN9Qi2H1amwuiShdFx57Oq+T6VrG0zOeBSateVZXmmRMBwlixzZAE03EBFF6FjBfs81 Qjak5XSLNUo6CbRr8Z6r8zLW4cR02GkPJVKQbGnhRPWqcUe76Nu8hbZVq65e5ZPtyWjt 0FoEgQ1vpCiTGqJaraUGxEr/o1kMGM8FeNDLdifISofzavxPQbwEuUSzuJCA7pGqBiNw sGAQ== X-Gm-Message-State: AOAM5337BoqNyoQHoqGZyJwo203dhID+82hoxBJCA7DatHSCpZxnPmer epJBJeW216L++Q0mMqApUJgQtg== X-Google-Smtp-Source: ABdhPJz5DskL3QCTtZrnkhGW5Ja46+3RWVkzd1qI4s3Eh6Dex1vZ00UXv2RrPeKtWyWUMPPZtZogwA== X-Received: by 2002:a7b:cc89:: with SMTP id p9mr3923346wma.4.1603390104368; Thu, 22 Oct 2020 11:08:24 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id p11sm4917122wrm.44.2020.10.22.11.08.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2020 11:08:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366945 - head/share/man/man9 From: Jessica Clarke In-Reply-To: <202010221800.09MI07GS063875@repo.freebsd.org> Date: Thu, 22 Oct 2020 19:08:22 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0E880644-DBCF-4C7B-92AC-46A6FC401D54@freebsd.org> References: <202010221800.09MI07GS063875@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CHFj56mVpz4LDv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.75 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.26)[-0.257]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.016]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.98)[-0.977]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.46:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.46:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 18:08:26 -0000 On 22 Oct 2020, at 19:00, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Thu Oct 22 18:00:07 2020 > New Revision: 366945 > URL: https://svnweb.freebsd.org/changeset/base/366945 >=20 > Log: > Fix typo >=20 > Modified: > head/share/man/man9/pfil.9 >=20 > Modified: head/share/man/man9/pfil.9 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man9/pfil.9 Thu Oct 22 17:47:51 2020 = (r366944) > +++ head/share/man/man9/pfil.9 Thu Oct 22 18:00:07 2020 = (r366945) > @@ -144,7 +144,7 @@ Link-layer packets. > .El > .Pp > Default rulesets are automatically linked to these heads to preserve > -historical behavavior. > +historical behaviour. This doesn't just fix the duplicated "av", it also changes the locale, which is not a typo. That may or may not be feature depending on who you are :) Jess From owner-svn-src-all@freebsd.org Thu Oct 22 18:45:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22BF544FAC1; Thu, 22 Oct 2020 18:45:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHGXF6xRLz4MF6; Thu, 22 Oct 2020 18:45:49 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D11E51B529; Thu, 22 Oct 2020 18:45:49 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MIjnu3094208; Thu, 22 Oct 2020 18:45:49 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MIjndI094207; Thu, 22 Oct 2020 18:45:49 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010221845.09MIjndI094207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 22 Oct 2020 18:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366946 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 366946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 18:45:50 -0000 Author: gbe (doc committer) Date: Thu Oct 22 18:45:49 2020 New Revision: 366946 URL: https://svnweb.freebsd.org/changeset/base/366946 Log: socket(9): Remove duplicate word 'is is' MFC after: 1 week Modified: head/share/man/man9/socket.9 Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Thu Oct 22 18:00:07 2020 (r366945) +++ head/share/man/man9/socket.9 Thu Oct 22 18:45:49 2020 (r366946) @@ -378,7 +378,7 @@ or A kernel system can use the .Fn sodtor_set function to set a destructor for a socket. -The destructor is called when the socket is is about to be freed. +The destructor is called when the socket is about to be freed. The destructor is called before the protocol detach routine. The destructor can serve as a callback to initiate additional cleanup actions. .Ss Socket I/O From owner-svn-src-all@freebsd.org Thu Oct 22 19:19:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CACC4281FD; Thu, 22 Oct 2020 19:19:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHHM3f3Mz4Nqm; Thu, 22 Oct 2020 19:19:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 608481BA8F; Thu, 22 Oct 2020 19:19:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MJJhtc013088; Thu, 22 Oct 2020 19:19:43 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MJJhtX013087; Thu, 22 Oct 2020 19:19:43 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010221919.09MJJhtX013087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 22 Oct 2020 19:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366947 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 366947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:19:43 -0000 Author: gbe (doc committer) Date: Thu Oct 22 19:19:42 2020 New Revision: 366947 URL: https://svnweb.freebsd.org/changeset/base/366947 Log: pnfsserver(4): Fix some issues reported by mandoc - new sentence, new line Modified: head/usr.sbin/nfsd/pnfsserver.4 Modified: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- head/usr.sbin/nfsd/pnfsserver.4 Thu Oct 22 18:45:49 2020 (r366946) +++ head/usr.sbin/nfsd/pnfsserver.4 Thu Oct 22 19:19:42 2020 (r366947) @@ -248,11 +248,12 @@ after the DS failure or network partitioning occurs. the arguments for a LayoutReturn operation. .sp 3 - The system administrator can perform the pnfsdskill(8) command on the MDS -to disable it. If the system administrator does a pnfsdskill(8) and it fails -with ENXIO (Device not configured) that normally means the DS was already -disabled via #1 or #2. Since doing this is harmless, once a system -administrator knows that there is a problem with a mirrored DS, doing the -command is recommended. +to disable it. +If the system administrator does a pnfsdskill(8) and it fails with ENXIO +(Device not configured) that normally means the DS was already +disabled via #1 or #2. +Since doing this is harmless, once a system administrator knows that +there is a problem with a mirrored DS, doing the command is recommended. .sp Once a system administrator knows that a mirrored DS has malfunctioned or has been network partitioned, they should do the following as root/su @@ -266,9 +267,8 @@ Note that the must be the exac string used when the DS was mounted on the MDS. .Pp Once the mirrored DS has been disabled, the pNFS service should continue to -function, but file updates will only happen on the DS(s) -that have not been disabled. Assuming two way mirroring, that implies -the one DS of the pair stored in the +function, but file updates will only happen on the DS(s) that have not been disabled. +Assuming two way mirroring, that implies the one DS of the pair stored in the .Dq pnfsd.dsfile extended attribute for the file on the MDS, for files stored on the disabled DS. .Pp From owner-svn-src-all@freebsd.org Thu Oct 22 19:22:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53A9B428562; Thu, 22 Oct 2020 19:22:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHLg18x9z4PCc; Thu, 22 Oct 2020 19:22:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B4111BD8C; Thu, 22 Oct 2020 19:22:35 +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 09MJMYcF018871; Thu, 22 Oct 2020 19:22:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MJMYVx018870; Thu, 22 Oct 2020 19:22:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010221922.09MJMYVx018870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Oct 2020 19:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366948 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:22:35 -0000 Author: mjg Date: Thu Oct 22 19:22:34 2020 New Revision: 366948 URL: https://svnweb.freebsd.org/changeset/base/366948 Log: cache: assert the created entry does not point to itself Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 22 19:19:42 2020 (r366947) +++ head/sys/kern/vfs_cache.c Thu Oct 22 19:22:34 2020 (r366948) @@ -2104,6 +2104,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, int len; u_long lnumcache; + VNPASS(dvp != vp, dvp); VNPASS(!VN_IS_DOOMED(dvp), dvp); VNPASS(dvp->v_type != VNON, dvp); if (vp != NULL) { From owner-svn-src-all@freebsd.org Thu Oct 22 19:25:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB9B0428924; Thu, 22 Oct 2020 19:25:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHPV4YLZz4PcW; Thu, 22 Oct 2020 19:25:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B58D1BD19; Thu, 22 Oct 2020 19:25:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MJP2LA019022; Thu, 22 Oct 2020 19:25:02 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MJP21k019021; Thu, 22 Oct 2020 19:25:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010221925.09MJP21k019021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 22 Oct 2020 19:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366949 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 366949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:25:02 -0000 Author: gbe (doc committer) Date: Thu Oct 22 19:25:01 2020 New Revision: 366949 URL: https://svnweb.freebsd.org/changeset/base/366949 Log: stablerestart(5): Fix some issues reported by mandoc - New sentence, new line Modified: head/usr.sbin/nfsd/stablerestart.5 Modified: head/usr.sbin/nfsd/stablerestart.5 ============================================================================== --- head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:22:34 2020 (r366948) +++ head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:25:01 2020 (r366949) @@ -52,18 +52,18 @@ first record. The lease duration is used to set the grace period. The boot times are used to avoid the unlikely occurrence of a boot time being reused, -due to a TOD clock going backwards. This record and the previous boot times with this boot time added is re-written at the -end of the grace period. +due to a TOD clock going backwards. +This record and the previous boot times with this boot time +added is re-written at the end of the grace period. .Pp The rest of the file are appended records, as defined by -struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used -represent one of two things. There are records which indicate that a +struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used represent one of two things. +There are records which indicate that a client successfully acquired state and records that indicate a client's state was revoked. State revoke records indicate that state information for a client was discarded, due to lease expiry and an otherwise conflicting open or lock request being made by a different client. -These records can be used -to determine if clients might have done either of the +These records can be used to determine if clients might have done either of the edge conditions. .Pp If a client might have done either edge condition or this file is @@ -71,8 +71,8 @@ empty or corrupted, the server returns NFSERR_NOGRACE request from the client. .Pp For correct operation of the server, it must be ensured that the file -is written to stable storage by the time a write op with IO_SYNC specified -has returned. This might require hardware level caching to be disabled for +is written to stable storage by the time a write op with IO_SYNC specified has returned. +This might require hardware level caching to be disabled for a local disk drive that holds the file, or similar. .Sh FILES .Bl -tag -width /var/db/nfs-stablerestart.bak -compact @@ -86,12 +86,11 @@ backup copy of the file .Xr nfsd 8 .Sh BUGS If the file is empty, the NFSv4 server has no choice but to return -NFSERR_NOGRACE for all reclaim requests. Although correct, this is -a highly undesirable occurrence, so the file should not be lost if -at all possible. The backup copy of the file is maintained -and used by the +NFSERR_NOGRACE for all reclaim requests. +Although correct, this is a highly undesirable occurrence, so the file should not be lost if +at all possible. +The backup copy of the file is maintained and used by the .Xr nfsd 8 to minimize the risk of this occurring. -To move the file, you must edit -the nfsd sources and recompile it. This was done to discourage -accidental relocation of the file. +To move the file, you must edit the nfsd sources and recompile it. +This was done to discourage accidental relocation of the file. From owner-svn-src-all@freebsd.org Thu Oct 22 19:28:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 201F04289A8; Thu, 22 Oct 2020 19:28:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHTB01XKz4PjY; Thu, 22 Oct 2020 19:28:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D36C11BAB4; Thu, 22 Oct 2020 19:28:13 +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 09MJSDJ8019197; Thu, 22 Oct 2020 19:28:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MJSC5h019191; Thu, 22 Oct 2020 19:28:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010221928.09MJSC5h019191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Oct 2020 19:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366950 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:28:14 -0000 Author: mjg Date: Thu Oct 22 19:28:12 2020 New Revision: 366950 URL: https://svnweb.freebsd.org/changeset/base/366950 Log: vfs: prevent avoidable evictions on mkdir of existing directories mkdir -p /foo/bar/baz will mkdir each path component and ignore EEXIST. The NOCACHE lookup will make the namecache unnecessarily evict the existing entry, and then fallback to the fs lookup routine eventually leading namei to return an error as the directory is already there. For invocations like mkdir -p /usr/obj/usr/src/sys/GENERIC/modules this triggers fallbacks to the slowpath for concurrently executing lookups. Tested by: pho Discussed with: kib Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vnode_if.src head/sys/sys/namei.h head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/kern/vfs_cache.c Thu Oct 22 19:28:12 2020 (r366950) @@ -1676,7 +1676,8 @@ cache_lookup_fallback(struct vnode *dvp, struct vnode int error; bool whiteout; - MPASS((cnp->cn_flags & (MAKEENTRY | ISDOTDOT)) == MAKEENTRY); + MPASS((cnp->cn_flags & ISDOTDOT) == 0); + MPASS((cnp->cn_flags & (MAKEENTRY | NC_KEEPPOSENTRY)) != 0); retry: hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); @@ -1768,7 +1769,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st MPASS((cnp->cn_flags & ISDOTDOT) == 0); - if ((cnp->cn_flags & MAKEENTRY) == 0) { + if ((cnp->cn_flags & (MAKEENTRY | NC_KEEPPOSENTRY)) == 0) { cache_remove_cnp(dvp, cnp); return (0); } @@ -2595,6 +2596,35 @@ cache_rename(struct vnode *fdvp, struct vnode *fvp, st cache_remove_cnp(tdvp, tcnp); } } + +#ifdef INVARIANTS +/* + * Validate that if an entry exists it matches. + */ +void +cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + struct namecache *ncp; + struct mtx *blp; + uint32_t hash; + + hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + if (CK_SLIST_EMPTY(NCHHASH(hash))) + return; + blp = HASH2BUCKETLOCK(hash); + mtx_lock(blp); + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) { + if (ncp->nc_vp != vp) + panic("%s: mismatch (%p != %p); ncp %p [%s] dvp %p vp %p\n", + __func__, vp, ncp->nc_vp, ncp, ncp->nc_name, ncp->nc_dvp, + ncp->nc_vp); + } + } + mtx_unlock(blp); +} +#endif /* * Flush all entries referencing a particular filesystem. Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/kern/vfs_subr.c Thu Oct 22 19:28:12 2020 (r366950) @@ -5587,6 +5587,18 @@ vop_mkdir_post(void *ap, int rc) VFS_KNOTE_LOCKED(dvp, NOTE_WRITE | NOTE_LINK); } +#ifdef DEBUG_VFS_LOCKS +void +vop_mkdir_debugpost(void *ap, int rc) +{ + struct vop_mkdir_args *a; + + a = ap; + if (!rc) + cache_validate(a->a_dvp, *a->a_vpp, a->a_cnp); +} +#endif + void vop_mknod_pre(void *ap) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/kern/vfs_syscalls.c Thu Oct 22 19:28:12 2020 (r366950) @@ -3758,8 +3758,8 @@ kern_mkdirat(struct thread *td, int fd, const char *pa restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | - NOCACHE, segflg, path, fd, &cap_mkdirat_rights, - td); + NC_NOMAKEENTRY | NC_KEEPPOSENTRY, segflg, path, fd, + &cap_mkdirat_rights, td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/kern/vnode_if.src Thu Oct 22 19:28:12 2020 (r366950) @@ -336,6 +336,7 @@ vop_rename { %% mkdir vpp - E - %! mkdir pre vop_mkdir_pre %! mkdir post vop_mkdir_post +%! mkdir debugpost vop_mkdir_debugpost vop_mkdir { IN struct vnode *dvp; Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/sys/namei.h Thu Oct 22 19:28:12 2020 (r366950) @@ -125,16 +125,19 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f /* * namei operational modifier flags, stored in ni_cnd.flags */ +#define NC_NOMAKEENTRY 0x0001 /* name must not be added to cache */ +#define NC_KEEPPOSENTRY 0x0002 /* don't evict a positive entry */ +#define NOCACHE NC_NOMAKEENTRY /* for compatibility with older code */ #define LOCKLEAF 0x0004 /* lock vnode on return */ #define LOCKPARENT 0x0008 /* want parent vnode returned locked */ #define WANTPARENT 0x0010 /* want parent vnode returned unlocked */ -#define NOCACHE 0x0020 /* name must not be left in cache */ +/* UNUSED 0x0020 */ #define FOLLOW 0x0040 /* follow symbolic links */ #define BENEATH 0x0080 /* No escape from the start dir */ #define LOCKSHARED 0x0100 /* Shared lock leaf */ #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ #define RBENEATH 0x100000000ULL /* No escape, even tmp, from start dir */ -#define MODMASK 0xf000001fcULL /* mask of operational modifiers */ +#define MODMASK 0xf000001ffULL /* mask of operational modifiers */ /* * Namei parameter descriptors. * Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Oct 22 19:25:01 2020 (r366949) +++ head/sys/sys/vnode.h Thu Oct 22 19:28:12 2020 (r366950) @@ -644,6 +644,15 @@ void cache_purge_negative(struct vnode *vp); void cache_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp, struct vnode *tvp, struct componentname *fcnp, struct componentname *tcnp); void cache_purgevfs(struct mount *mp); +#ifdef INVARIANTS +void cache_validate(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +#else +static inline void +cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ +} +#endif int change_dir(struct vnode *vp, struct thread *td); void cvtstat(struct stat *st, struct ostat *ost); void freebsd11_cvtnstat(struct stat *sb, struct nstat *nsb); @@ -880,6 +889,7 @@ void vop_lock_debugpost(void *a, int rc); void vop_unlock_debugpre(void *a); void vop_need_inactive_debugpre(void *a); void vop_need_inactive_debugpost(void *a, int rc); +void vop_mkdir_debugpost(void *a, int rc); #else #define vop_fplookup_vexec_debugpre(x) do { } while (0) #define vop_fplookup_vexec_debugpost(x, y) do { } while (0) @@ -889,6 +899,7 @@ void vop_need_inactive_debugpost(void *a, int rc); #define vop_unlock_debugpre(x) do { } while (0) #define vop_need_inactive_debugpre(x) do { } while (0) #define vop_need_inactive_debugpost(x, y) do { } while (0) +#define vop_mkdir_debugpost(x, y) do { } while (0) #endif void vop_rename_fail(struct vop_rename_args *ap); From owner-svn-src-all@freebsd.org Thu Oct 22 19:29:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AA6F4288F9; Thu, 22 Oct 2020 19:29:04 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHV81mRTz4PW6; Thu, 22 Oct 2020 19:29:03 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x336.google.com with SMTP id n15so2551687otl.8; Thu, 22 Oct 2020 12:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LACqYI8fx3hAEtkVbriMRr37sBwl65AGreB3vXeduUk=; b=fLtpB+YvFvundI+5FvaH/cJQ/t0tPoTHNUDLZDNKZMkyGTVTCO5IXbKcfi+RtmKTLg SewAIYsi3Od8tViXHGgUKCTwYfrWHClBmgXuFHEUnKj6Qm9NNpt/INwiii7caESxBYYc XsdDbTerqh6BP7wjsbp/QFOxwioL2lh2P6srOy1wFZ5eqQyhwyD/1WgCc/MXR8SpurAc 9xtY/Jk7yEz9LYTl/xSZwj41rlbTao7nqXyVnWkBWTFQ3e0zTYHyD9MwBGEoLYq/8y4S MyWTLtJmhvZ7n3Vk062HzzAxhxt9DK1X8dNCMJbgbv4wmE9fRy1iKJj2Q1xoBzVecB2U eYmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LACqYI8fx3hAEtkVbriMRr37sBwl65AGreB3vXeduUk=; b=rdAoSum2F73dFUGwsg6P6lNHgz3NaGRYupDE10pvo33TgZMfX1UIM9R+nEyMGzPdXU ZFtWjdieXnU96pmA1xD6IAe7tQnP16iRXFlHn+xe6G9Ota11l8OeDoSL/9F41Es0Pk+l o4hj1//FeNPRfiGKUOFFuyCclx9Lk5F4jCoywFMEHg9kh4BgMAr5yFRWCdFvZ/qyPNls QCaHk4+Rc9SGrt7vlDa2vzN8WLE5pPrMlj28ZnMh9dxoV+SJ8VdXESc2IDJ6ubD/A0Pn IFTpFGtAy72XIS+HpL25EGDjryioGoeEevzl01rjauLyCZyZ3Lp7S3PlDWmyNuS6qPev bkEg== X-Gm-Message-State: AOAM533ef5tYLdFHBUUVrFqWjkfpZ6dRgc0QpNcWpy/464h5W3sKa5rj ILZa2c79j8pOcLJ8Y4U2PoureiXJgQVynK+svHQyRika5X8= X-Google-Smtp-Source: ABdhPJzt29I2uyAj6WBLi3szO13XgIluRIJp9zT+Kq2EVmBEadaDJ1jVzXu9qw7rIshhD75hODiBcq896ENRARNXPYY= X-Received: by 2002:a05:6830:100f:: with SMTP id a15mr3003028otp.117.1603394942648; Thu, 22 Oct 2020 12:29:02 -0700 (PDT) MIME-Version: 1.0 References: <202010221925.09MJP21k019021@repo.freebsd.org> In-Reply-To: <202010221925.09MJP21k019021@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 22 Oct 2020 12:28:51 -0700 Message-ID: Subject: Re: svn commit: r366949 - head/usr.sbin/nfsd To: Gordon Bergling Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CHHV81mRTz4PW6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:29:04 -0000 On Thu, Oct 22, 2020 at 12:25 PM Gordon Bergling wrote: > Author: gbe (doc committer) > Date: Thu Oct 22 19:25:01 2020 > New Revision: 366949 > URL: https://svnweb.freebsd.org/changeset/base/366949 > > Log: > stablerestart(5): Fix some issues reported by mandoc > > - New sentence, new line > > Modified: > head/usr.sbin/nfsd/stablerestart.5 > > Modified: head/usr.sbin/nfsd/stablerestart.5 > > ============================================================================== > --- head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:22:34 2020 > (r366948) > +++ head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:25:01 2020 > (r366949) > @@ -52,18 +52,18 @@ first record. > The lease duration is used to set the grace period. > The boot times > are used to avoid the unlikely occurrence of a boot time being reused, > -due to a TOD clock going backwards. This record and the previous boot > times with this boot time added is re-written at the > -end of the grace period. > +due to a TOD clock going backwards. > +This record and the previous boot times with this boot time > +added is re-written at the end of the grace period. > .Pp > The rest of the file are appended records, as defined by > -struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used > -represent one of two things. There are records which indicate that a > +struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used > represent one of two things. > > There are some more markup options here, like (IIRC) .Fa for struct nfst_rec, and .Pa for /usr/include/fs/nfs/nfsrvstate.h -Ben From owner-svn-src-all@freebsd.org Thu Oct 22 19:35:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2891C428C3C; Thu, 22 Oct 2020 19:35:45 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHdr5NWnz4QDW; Thu, 22 Oct 2020 19:35:44 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4CHHdj1wRVz3n0y; Thu, 22 Oct 2020 19:35:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id EgzR6tyJptif; Thu, 22 Oct 2020 19:35:36 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:1201:b119:c381:545a:fb32]) by mail.daemonic.se (Postfix) with ESMTPSA id 4CHHdh1khKz3mQt; Thu, 22 Oct 2020 19:35:36 +0000 (UTC) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Kyle Evans , Warner Losh Cc: "Alexander V. Chernikov" , Hans Petter Selasky , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> From: Niclas Zeising Message-ID: Date: Thu, 22 Oct 2020 21:35:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CHHdr5NWnz4QDW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:35:45 -0000 On 2020-10-22 15:22, Kyle Evans wrote: > On Sat, Oct 17, 2020 at 11:40 AM Warner Losh wrote: >> >> >> >> On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov wrote: >>> >>> 17.10.2020, 14:07, "Hans Petter Selasky" : >>> >>> On 2020-10-17 14:34, Alexander V. Chernikov wrote: >>> >>> 17.10.2020, 12:32, "Hans Petter Selasky" : >>> >>> On 2020-10-17 13:27, Alexander V. Chernikov wrote: >>> >>> 02.10.2020, 19:26, "Emmanuel Vadot" >> >: >>> >>> Author: manu >>> Date: Fri Oct 2 18:26:41 2020 >>> New Revision: 366372 >>> URL: https://svnweb.freebsd.org/changeset/base/366372 >>> >>> Log: >>> linuxkpi: Add backlight support >>> >>> Add backlight function to linuxkpi. >>> Graphics drivers expose the backlight of the panel directly so >>> allow them >>> to use the backlight subsystem so >>> user can use backlight(8) to configure them. >>> >>> Reviewed by: hselasky >>> Relnotes: yes >>> Differential Revision: The FreeBSD Foundation >>> >>> Added: >>> head/sys/compat/linuxkpi/common/include/linux/backlight.h >>> (contents, >>> props changed) >>> Modified: >>> head/sys/compat/linuxkpi/common/include/linux/device.h >>> head/sys/compat/linuxkpi/common/src/linux_kmod.c >>> head/sys/compat/linuxkpi/common/src/linux_pci.c >>> head/sys/conf/kmod.mk >>> >>> It breaks the build for me with >>> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: >>> fatal error: 'backlight_if.h' file not found >>> >>> >>> How do you build? Doesn't break over here. >>> >>> GENERIC + COMPAT_LINUXKPI. >>> >>> >>> >>> Try adding: >>> >>> options backlight >>> >>> To the kernel config. >>> >>> Yep, thank you! >>> Maybe it's worth considering adding static assert with the message describing this dependency? >> >> >> Yes. It likely is worth doing something to highlight this issue. >> >> Warner >> > > I think we just need to slap the two core backlight files with an ` | > compat_linux` so that they simply get pulled in if you specify > COMPAT_LINUX. config(8) handles this terribly, configng must have a > better provides/requires/implies/whatever functionality so we can > specify that compat_linux implies backlight and not do crud like this > where it becomes more complicated to see what any given option really > entails. > > Thanks, COMPAT_LINUX can't be right. Isn't that the linuxolator? Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Thu Oct 22 19:43:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54BB542919F; Thu, 22 Oct 2020 19:43:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHHq41fZXz4QpV; Thu, 22 Oct 2020 19:43:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 145151ACCA; Thu, 22 Oct 2020 19:43:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f174.google.com with SMTP id h12so2216268qtu.1; Thu, 22 Oct 2020 12:43:44 -0700 (PDT) X-Gm-Message-State: AOAM531ScPAH3BjztWL4MGeraw3vXTy6d4POX64AngjWW+1Mhjg+DhFm h2QFKU8XbhRM1EPKrq9Wyiq2utAvoCmfPH9orOo= X-Google-Smtp-Source: ABdhPJwm+Pjx8Rj4nnZSpMU75FWwJCpK82ttNWM/oob9+ieNc0KkP432LGyEVDnMDN3kGCKkisG6pHYpR4x6WHkHG40= X-Received: by 2002:ac8:33e8:: with SMTP id d37mr3444053qtb.310.1603395823515; Thu, 22 Oct 2020 12:43:43 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: From: Kyle Evans Date: Thu, 22 Oct 2020 14:43:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Niclas Zeising Cc: Warner Losh , "Alexander V. Chernikov" , Hans Petter Selasky , Emmanuel Vadot , "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.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 19:43:44 -0000 On Thu, Oct 22, 2020 at 2:35 PM Niclas Zeising wrote: > > On 2020-10-22 15:22, Kyle Evans wrote: > > On Sat, Oct 17, 2020 at 11:40 AM Warner Losh wrote: > >> > >> > >> > >> On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov wrote: > >>> > >>> 17.10.2020, 14:07, "Hans Petter Selasky" : > >>> > >>> On 2020-10-17 14:34, Alexander V. Chernikov wrote: > >>> > >>> 17.10.2020, 12:32, "Hans Petter Selasky" : > >>> > >>> On 2020-10-17 13:27, Alexander V. Chernikov wrote: > >>> > >>> 02.10.2020, 19:26, "Emmanuel Vadot" >>> >: > >>> > >>> Author: manu > >>> Date: Fri Oct 2 18:26:41 2020 > >>> New Revision: 366372 > >>> URL: https://svnweb.freebsd.org/changeset/base/366372 > >>> > >>> Log: > >>> linuxkpi: Add backlight support > >>> > >>> Add backlight function to linuxkpi. > >>> Graphics drivers expose the backlight of the panel directly so > >>> allow them > >>> to use the backlight subsystem so > >>> user can use backlight(8) to configure them. > >>> > >>> Reviewed by: hselasky > >>> Relnotes: yes > >>> Differential Revision: The FreeBSD Foundation > >>> > >>> Added: > >>> head/sys/compat/linuxkpi/common/include/linux/backlight.h > >>> (contents, > >>> props changed) > >>> Modified: > >>> head/sys/compat/linuxkpi/common/include/linux/device.h > >>> head/sys/compat/linuxkpi/common/src/linux_kmod.c > >>> head/sys/compat/linuxkpi/common/src/linux_pci.c > >>> head/sys/conf/kmod.mk > >>> > >>> It breaks the build for me with > >>> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: > >>> fatal error: 'backlight_if.h' file not found > >>> > >>> > >>> How do you build? Doesn't break over here. > >>> > >>> GENERIC + COMPAT_LINUXKPI. > >>> > >>> > >>> > >>> Try adding: > >>> > >>> options backlight > >>> > >>> To the kernel config. > >>> > >>> Yep, thank you! > >>> Maybe it's worth considering adding static assert with the message describing this dependency? > >> > >> > >> Yes. It likely is worth doing something to highlight this issue. > >> > >> Warner > >> > > > > I think we just need to slap the two core backlight files with an ` | > > compat_linux` so that they simply get pulled in if you specify > > COMPAT_LINUX. config(8) handles this terribly, configng must have a > > better provides/requires/implies/whatever functionality so we can > > specify that compat_linux implies backlight and not do crud like this > > where it becomes more complicated to see what any given option really > > entails. > > > > Thanks, > > COMPAT_LINUX can't be right. Isn't that the linuxolator? > Regards > -- > Niclas Zeising Whoops, s/LINUX/LINUXKPI/ :-) From owner-svn-src-all@freebsd.org Thu Oct 22 20:02:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B3954294FD; Thu, 22 Oct 2020 20:02:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHJDC1MBvz4RhB; Thu, 22 Oct 2020 20:02:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11F481C2A4; Thu, 22 Oct 2020 20:02:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MK22Il041520; Thu, 22 Oct 2020 20:02:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MK22Le041519; Thu, 22 Oct 2020 20:02:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202010222002.09MK22Le041519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 22 Oct 2020 20:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366951 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 366951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 20:02:03 -0000 Author: tsoome Date: Thu Oct 22 20:02:02 2020 New Revision: 366951 URL: https://svnweb.freebsd.org/changeset/base/366951 Log: loader: revert r342161 and r342151 We are using asize property from pool label and we do not depend on partition data to find last two pool labels and to validate LBA for disk IO. This does allow us to re-enable support for partitionless disk setups. Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Thu Oct 22 19:28:12 2020 (r366950) +++ head/stand/libsa/zfs/zfs.c Thu Oct 22 20:02:02 2020 (r366951) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1421,7 +1420,6 @@ zfs_attach_nvstore(void *vdev) int zfs_probe_dev(const char *devname, uint64_t *pool_guid) { - struct disk_devdesc *dev; struct ptable *table; struct zfs_probe_args pa; uint64_t mediasz; @@ -1432,22 +1430,10 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid pa.fd = open(devname, O_RDWR); if (pa.fd == -1) return (ENXIO); - /* - * We will not probe the whole disk, we can not boot from such - * disks and some systems will misreport the disk sizes and will - * hang while accessing the disk. - */ - if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { - int partition = dev->d_partition; - int slice = dev->d_slice; - - free(dev); - if (partition != D_PARTNONE && slice != D_SLICENONE) { - ret = zfs_probe(pa.fd, pool_guid); - if (ret == 0) - return (0); - } - } + /* Probe the whole disk */ + ret = zfs_probe(pa.fd, pool_guid); + if (ret == 0) + return (0); /* Probe each partition */ ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); From owner-svn-src-all@freebsd.org Thu Oct 22 20:11:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 973584299D3; Thu, 22 Oct 2020 20:11:02 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHJQY4pBNz4SDY; Thu, 22 Oct 2020 20:11:01 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: by mail-ed1-x536.google.com with SMTP id p13so3021127edi.7; Thu, 22 Oct 2020 13:11:01 -0700 (PDT) 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; bh=U80m58vBFr0C5+K+lKPN/0p1nV3McwLdz5fbV4ojWR8=; b=j7wsr//o7WpZhjl4KdgR7Af12oFm2eVX3Bdv8pZL4SVnyhHyEKJuel3JoUkYavKTI4 3wt/4NC4OLQuOGbFNUg3Bs+SHBzESaoHveB8gylv671TylXqvqr6quvZpQeBAvbOUeZo 7beuIHBJTlYzgfxXyaOm/7j2XZI+BColDrw0MfaN4hoOj8c6IuGRDn+5XUBL778uJ8t3 +JvIMgPA4DWeKqSwGhIIpvYmBHP7ni2AzT2zIX/BXyGUx2++K/BNKmp5Q46L29WryGdi VFtv2klV0YW4vVZ1s1rUf5eZXxYfrg1Jte/h9S/KEOWf0PZNXFl2EAhdbi9tL5AHB4pv QQAQ== X-Gm-Message-State: AOAM5305VzPGTJS1kB/fAy574uZB87yIlynOBNPn0oYHi5kvf3F/YReE WRO5bjN1BBrN+EExxWN2BKA= X-Google-Smtp-Source: ABdhPJwt+VU236ZXH1qPIGDwQbZG6Ndv8UJuKFafWukUQSdD4bxL4zmSImZCQz+5zStITuwLVd69zQ== X-Received: by 2002:aa7:c5c4:: with SMTP id h4mr3972989eds.379.1603397459879; Thu, 22 Oct 2020 13:10:59 -0700 (PDT) Received: from tiny.0xfce3.net (p4fd3a1f5.dip0.t-ipconnect.de. [79.211.161.245]) by smtp.gmail.com with ESMTPSA id p10sm1375971ejy.68.2020.10.22.13.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 13:10:59 -0700 (PDT) Sender: Gordon Bergling Date: Thu, 22 Oct 2020 22:10:57 +0200 From: Gordon Bergling To: Benjamin Kaduk Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366949 - head/usr.sbin/nfsd Message-ID: <20201022201057.GA7794@tiny.0xfce3.net> References: <202010221925.09MJP21k019021@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: FreeBSD 13.0-CURRENT arm64 X-Host-Uptime: 10:07PM up 1 day, 1:49, 3 users, load averages: 0.41, 0.29, 0.20 X-Rspamd-Queue-Id: 4CHJQY4pBNz4SDY X-Spamd-Bar: / X-Spamd-Result: default: False [0.51 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[googlemail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.32)[-0.315]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[gbergling@googlemail.com,gbergling@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[79.211.161.245:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[gbergling@googlemail.com,gbergling@gmail.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_POLICY_QUARANTINE(1.50)[googlemail.com : SPF not aligned (relaxed), DKIM not aligned (relaxed),quarantine]; NEURAL_HAM_LONG(-0.92)[-0.918]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.45)[0.448]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::536:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 20:11:02 -0000 On Thu, Oct 22, 2020 at 12:28:51PM -0700, Benjamin Kaduk wrote: > On Thu, Oct 22, 2020 at 12:25 PM Gordon Bergling wrote: > > > Author: gbe (doc committer) > > Date: Thu Oct 22 19:25:01 2020 > > New Revision: 366949 > > URL: https://svnweb.freebsd.org/changeset/base/366949 > > > > Log: > > stablerestart(5): Fix some issues reported by mandoc > > > > - New sentence, new line > > > > Modified: > > head/usr.sbin/nfsd/stablerestart.5 > > > > Modified: head/usr.sbin/nfsd/stablerestart.5 > > > > ============================================================================== > > --- head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:22:34 2020 > > (r366948) > > +++ head/usr.sbin/nfsd/stablerestart.5 Thu Oct 22 19:25:01 2020 > > (r366949) > > @@ -52,18 +52,18 @@ first record. > > The lease duration is used to set the grace period. > > The boot times > > are used to avoid the unlikely occurrence of a boot time being reused, > > -due to a TOD clock going backwards. This record and the previous boot > > times with this boot time added is re-written at the > > -end of the grace period. > > +due to a TOD clock going backwards. > > +This record and the previous boot times with this boot time > > +added is re-written at the end of the grace period. > > .Pp > > The rest of the file are appended records, as defined by > > -struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used > > -represent one of two things. There are records which indicate that a > > +struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used > > represent one of two things. > > > There are some more markup options here, like (IIRC) .Fa for struct > nfst_rec, and .Pa for /usr/include/fs/nfs/nfsrvstate.h > > -Ben Hi Ben, I'll check further optimizations tomorrow! Thanks for the hint. -- Gordon From owner-svn-src-all@freebsd.org Thu Oct 22 20:21:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14129429B40; Thu, 22 Oct 2020 20:21:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHJfH6qM0z4SXZ; Thu, 22 Oct 2020 20:21:11 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE9F71C59F; Thu, 22 Oct 2020 20:21:11 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09MKLBLr052714; Thu, 22 Oct 2020 20:21:11 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MKLBI6052713; Thu, 22 Oct 2020 20:21:11 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202010222021.09MKLBI6052713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 22 Oct 2020 20:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366952 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 366952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 20:21:12 -0000 Author: vmaffione Date: Thu Oct 22 20:21:11 2020 New Revision: 366952 URL: https://svnweb.freebsd.org/changeset/base/366952 Log: netmap: fix mutex double unlock bug https://github.com/luigirizzo/netmap/pull/733 Submitted by: brian90013 MFC after: 3 days Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Thu Oct 22 20:02:02 2020 (r366951) +++ head/sys/dev/netmap/netmap_mem2.c Thu Oct 22 20:21:11 2020 (r366952) @@ -2007,7 +2007,6 @@ netmap_mem2_if_new(struct netmap_adapter *na, struct n len = sizeof(struct netmap_if) + (ntot * sizeof(ssize_t)); nifp = netmap_if_malloc(na->nm_mem, len); if (nifp == NULL) { - NMA_UNLOCK(na->nm_mem); return NULL; } From owner-svn-src-all@freebsd.org Thu Oct 22 20:26:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7607942A02B; Thu, 22 Oct 2020 20:26:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHJmP2W15z4SrG; Thu, 22 Oct 2020 20:26:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A0CD1C82C; Thu, 22 Oct 2020 20:26:29 +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 09MKQTwq055367; Thu, 22 Oct 2020 20:26:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09MKQRVE055360; Thu, 22 Oct 2020 20:26:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010222026.09MKQRVE055360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Oct 2020 20:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366953 - in head: sys/dev/iscsi usr.sbin/iscsid X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sys/dev/iscsi usr.sbin/iscsid X-SVN-Commit-Revision: 366953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 20:26:29 -0000 Author: mav Date: Thu Oct 22 20:26:27 2020 New Revision: 366953 URL: https://svnweb.freebsd.org/changeset/base/366953 Log: Negotiate iSCSIProtocolLevel of 2 (RFC 7144) in initiator. It does not change anything immediately, but allows further support of Command Priority, Status Qualifier and new task management functions. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi.h head/sys/dev/iscsi/iscsi_ioctl.h head/sys/dev/iscsi/iscsi_proto.h head/usr.sbin/iscsid/iscsid.c head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/login.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu Oct 22 20:21:11 2020 (r366952) +++ head/sys/dev/iscsi/iscsi.c Thu Oct 22 20:26:27 2020 (r366953) @@ -1427,6 +1427,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, sizeof(is->is_target_alias)); is->is_tsih = handoff->idh_tsih; is->is_statsn = handoff->idh_statsn; + is->is_protocol_level = handoff->idh_protocol_level; is->is_initial_r2t = handoff->idh_initial_r2t; is->is_immediate_data = handoff->idh_immediate_data; Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Thu Oct 22 20:21:11 2020 (r366952) +++ head/sys/dev/iscsi/iscsi.h Thu Oct 22 20:26:27 2020 (r366953) @@ -61,8 +61,7 @@ struct iscsi_session { uint32_t is_expcmdsn; uint32_t is_maxcmdsn; uint32_t is_initiator_task_tag; - int is_header_digest; - int is_data_digest; + int is_protocol_level; int is_initial_r2t; int is_max_burst_length; int is_first_burst_length; Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Thu Oct 22 20:21:11 2020 (r366952) +++ head/sys/dev/iscsi/iscsi_ioctl.h Thu Oct 22 20:26:27 2020 (r366953) @@ -124,7 +124,8 @@ struct iscsi_daemon_handoff { unsigned int idh_session_id; int idh_socket; char idh_target_alias[ISCSI_ALIAS_LEN]; - uint8_t idh_spare_isid[6]; + int idh_protocol_level; + uint16_t idh_spare; uint16_t idh_tsih; uint16_t idh_spare_cid; uint32_t idh_statsn; Modified: head/sys/dev/iscsi/iscsi_proto.h ============================================================================== --- head/sys/dev/iscsi/iscsi_proto.h Thu Oct 22 20:21:11 2020 (r366952) +++ head/sys/dev/iscsi/iscsi_proto.h Thu Oct 22 20:26:27 2020 (r366953) @@ -90,10 +90,14 @@ CTASSERT(sizeof(struct iscsi_bhs) == ISCSI_BHS_SIZE); #define BHSSC_FLAGS_ATTR_HOQ 3 #define BHSSC_FLAGS_ATTR_ACA 4 +#define BHSSC_PRI_MASK 0xf0 +#define BHSSC_PRI_SHIFT 4 + struct iscsi_bhs_scsi_command { uint8_t bhssc_opcode; uint8_t bhssc_flags; - uint8_t bhssc_reserved[2]; + uint8_t bhssc_pri; + uint8_t bhssc_reserved; uint8_t bhssc_total_ahs_len; uint8_t bhssc_data_segment_len[3]; uint64_t bhssc_lun; Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Thu Oct 22 20:21:11 2020 (r366952) +++ head/usr.sbin/iscsid/iscsid.c Thu Oct 22 20:26:27 2020 (r366953) @@ -172,6 +172,7 @@ connection_new(int iscsi_fd, const struct iscsi_daemon /* * Default values, from RFC 3720, section 12. */ + conn->conn_protocol_level = 0; conn->conn_header_digest = CONN_DIGEST_NONE; conn->conn_data_digest = CONN_DIGEST_NONE; conn->conn_initial_r2t = true; @@ -329,6 +330,7 @@ handoff(struct connection *conn) sizeof(idh.idh_target_alias)); idh.idh_tsih = conn->conn_tsih; idh.idh_statsn = conn->conn_statsn; + idh.idh_protocol_level = conn->conn_protocol_level; idh.idh_header_digest = conn->conn_header_digest; idh.idh_data_digest = conn->conn_data_digest; idh.idh_initial_r2t = conn->conn_initial_r2t; Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Thu Oct 22 20:21:11 2020 (r366952) +++ head/usr.sbin/iscsid/iscsid.h Thu Oct 22 20:26:27 2020 (r366953) @@ -57,6 +57,7 @@ struct connection { uint8_t conn_isid[6]; uint16_t conn_tsih; uint32_t conn_statsn; + int conn_protocol_level; int conn_header_digest; int conn_data_digest; bool conn_initial_r2t; Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Thu Oct 22 20:21:11 2020 (r366952) +++ head/usr.sbin/iscsid/login.c Thu Oct 22 20:26:27 2020 (r366953) @@ -341,6 +341,11 @@ login_negotiate_key(struct connection *conn, const cha sizeof(conn->conn_target_alias)); } else if (strcmp(value, "Irrelevant") == 0) { /* Ignore. */ + } else if (strcmp(name, "iSCSIProtocolLevel") == 0) { + tmp = strtoul(value, NULL, 10); + if (tmp < 0 || tmp > 31) + log_errx(1, "received invalid iSCSIProtocolLevel"); + conn->conn_protocol_level = tmp; } else if (strcmp(name, "HeaderDigest") == 0) { which = login_list_prefers(value, "CRC32C", "None"); switch (which) { @@ -500,6 +505,7 @@ login_negotiate(struct connection *conn) * The following keys are irrelevant for discovery sessions. */ if (conn->conn_conf.isc_discovery == 0) { + keys_add(request_keys, "iSCSIProtocolLevel", "2"); if (conn->conn_conf.isc_header_digest != 0) keys_add(request_keys, "HeaderDigest", "CRC32C"); else From owner-svn-src-all@freebsd.org Fri Oct 23 00:00:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03CBE42DEA3; Fri, 23 Oct 2020 00:00:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHPWn6Pzzz4dN0; Fri, 23 Oct 2020 00:00:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF6081EE8E; Fri, 23 Oct 2020 00:00:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N00reZ084659; Fri, 23 Oct 2020 00:00:53 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N00rC3084656; Fri, 23 Oct 2020 00:00:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202010230000.09N00rC3084656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 23 Oct 2020 00:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366954 - in releng/12.2: . lib/csu/common sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/12.2: . lib/csu/common sys/conf X-SVN-Commit-Revision: 366954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 00:00:54 -0000 Author: gjb Date: Fri Oct 23 00:00:52 2020 New Revision: 366954 URL: https://svnweb.freebsd.org/changeset/base/366954 Log: - Switch releng/12.2 from RC3 to RELEASE. - Add the anticipated 12.2-RELEASE date to UPDATING. Fix a missing colon in the previous UPDATING entry while here. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/12.2/UPDATING releng/12.2/lib/csu/common/crtbrand.c releng/12.2/sys/conf/newvers.sh Modified: releng/12.2/UPDATING ============================================================================== --- releng/12.2/UPDATING Thu Oct 22 20:26:27 2020 (r366953) +++ releng/12.2/UPDATING Fri Oct 23 00:00:52 2020 (r366954) @@ -16,7 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. -20200915 p1 FreeBSD-SA-20:27.ure +20201027: + 12.2-RELEASE. + +20200915: p1 FreeBSD-SA-20:27.ure FreeBSD-SA-20:28.bhyve_vmcs FreeBSD-SA-20:29.bhyve_svm FreeBSD-SA-20:30.ftpd Modified: releng/12.2/lib/csu/common/crtbrand.c ============================================================================== --- releng/12.2/lib/csu/common/crtbrand.c Thu Oct 22 20:26:27 2020 (r366953) +++ releng/12.2/lib/csu/common/crtbrand.c Fri Oct 23 00:00:52 2020 (r366954) @@ -65,7 +65,7 @@ static const struct { .descsz = sizeof(int32_t), .type = NT_FREEBSD_ABI_TAG, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1202000 }; static const struct { Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- releng/12.2/sys/conf/newvers.sh Thu Oct 22 20:26:27 2020 (r366953) +++ releng/12.2/sys/conf/newvers.sh Fri Oct 23 00:00:52 2020 (r366954) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH="RC3" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Oct 23 00:23:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA03442EBD2; Fri, 23 Oct 2020 00:23:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHQ2M3xtJz4fJg; Fri, 23 Oct 2020 00:23:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C0D71EC7D; Fri, 23 Oct 2020 00:23:55 +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 09N0Nt2m002559; Fri, 23 Oct 2020 00:23:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N0Ns31002555; Fri, 23 Oct 2020 00:23:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010230023.09N0Ns31002555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 23 Oct 2020 00:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366955 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 366955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 00:23:55 -0000 Author: jhb Date: Fri Oct 23 00:23:54 2020 New Revision: 366955 URL: https://svnweb.freebsd.org/changeset/base/366955 Log: Handle CPL_RX_DATA on active TLS sockets. In certain edge cases, the NIC might have only received a partial TLS record which it needs to return to the driver. For example, if the local socket was closed while data was still in flight, a partial TLS record might be pending when the connection is closed. Receiving a RST in the middle of a TLS record is another example. When this happens, the firmware returns the the partial TLS record as plain TCP data via CPL_RX_DATA. Handle these requests by returning an error to OpenSSL (via so_error for KTLS or via an error TLS record header for the older Chelsio OpenSSL interface). Reported by: Sony Arpita Das @ Chelsio Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: Revision: https://reviews.freebsd.org/D26800 Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Oct 23 00:00:52 2020 (r366954) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Oct 23 00:23:54 2020 (r366955) @@ -1537,6 +1537,15 @@ do_rx_data(struct sge_iq *iq, const struct rss_header tp = intotcpcb(inp); + if (__predict_false(ulp_mode(toep) == ULP_MODE_TLS && + toep->flags & TPF_TLS_RECEIVE)) { + /* Received "raw" data on a TLS socket. */ + CTR3(KTR_CXGBE, "%s: tid %u, raw TLS data (%d bytes)", + __func__, tid, len); + do_rx_data_tls(cpl, toep, m); + return (0); + } + if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq))) ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt; Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri Oct 23 00:00:52 2020 (r366954) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Oct 23 00:23:54 2020 (r366955) @@ -707,6 +707,8 @@ program_key_context(struct tcpcb *tp, struct toepcb *t V_TCB_TLS_SEQ(M_TCB_TLS_SEQ), V_TCB_TLS_SEQ(0)); t4_clear_rx_quiesce(toep); + + toep->flags |= TPF_TLS_RECEIVE; } else { unsigned short pdus_per_ulp; @@ -1064,6 +1066,7 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_sessio tls_stop_handshake_timer(toep); toep->flags &= ~TPF_FORCE_CREDITS; + toep->flags |= TPF_TLS_RECEIVE; /* * RX key tags are an index into the key portion of MA @@ -2218,6 +2221,135 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head INP_WUNLOCK(inp); CURVNET_RESTORE(); return (0); +} + +void +do_rx_data_tls(const struct cpl_rx_data *cpl, struct toepcb *toep, + struct mbuf *m) +{ + struct inpcb *inp = toep->inp; + struct tls_ofld_info *tls_ofld = &toep->tls; + struct tls_hdr *hdr; + struct tcpcb *tp; + struct socket *so; + struct sockbuf *sb; + int error, len, rx_credits; + + len = m->m_pkthdr.len; + + INP_WLOCK_ASSERT(inp); + + so = inp_inpcbtosocket(inp); + tp = intotcpcb(inp); + sb = &so->so_rcv; + SOCKBUF_LOCK(sb); + CURVNET_SET(toep->vnet); + + tp->rcv_nxt += len; + KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); + tp->rcv_wnd -= len; + + /* Do we have a full TLS header? */ + if (len < sizeof(*hdr)) { + CTR3(KTR_CXGBE, "%s: tid %u len %d: too short for a TLS header", + __func__, toep->tid, len); + so->so_error = EMSGSIZE; + goto out; + } + hdr = mtod(m, struct tls_hdr *); + + /* Is the header valid? */ + if (be16toh(hdr->version) != tls_ofld->k_ctx.proto_ver) { + CTR3(KTR_CXGBE, "%s: tid %u invalid version %04x", + __func__, toep->tid, be16toh(hdr->version)); + error = EINVAL; + goto report_error; + } + if (be16toh(hdr->length) < sizeof(*hdr)) { + CTR3(KTR_CXGBE, "%s: tid %u invalid length %u", + __func__, toep->tid, be16toh(hdr->length)); + error = EBADMSG; + goto report_error; + } + + /* Did we get a truncated record? */ + if (len < be16toh(hdr->length)) { + CTR4(KTR_CXGBE, "%s: tid %u truncated TLS record (%d vs %u)", + __func__, toep->tid, len, be16toh(hdr->length)); + + error = EMSGSIZE; + goto report_error; + } + + /* Is the header type unknown? */ + switch (hdr->type) { + case CONTENT_TYPE_CCS: + case CONTENT_TYPE_ALERT: + case CONTENT_TYPE_APP_DATA: + case CONTENT_TYPE_HANDSHAKE: + break; + default: + CTR3(KTR_CXGBE, "%s: tid %u invalid TLS record type %u", + __func__, toep->tid, hdr->type); + error = EBADMSG; + goto report_error; + } + + /* + * Just punt. Although this could fall back to software + * decryption, this case should never really happen. + */ + CTR4(KTR_CXGBE, "%s: tid %u dropping TLS record type %u, length %u", + __func__, toep->tid, hdr->type, be16toh(hdr->length)); + error = EBADMSG; + +report_error: +#ifdef KERN_TLS + if (toep->tls.mode == TLS_MODE_KTLS) + so->so_error = error; + else +#endif + { + /* + * Report errors by sending an empty TLS record + * with an error record type. + */ + hdr->type = CONTENT_TYPE_ERROR; + + /* Trim this CPL's mbuf to only include the TLS header. */ + KASSERT(m->m_len == len && m->m_next == NULL, + ("%s: CPL spans multiple mbufs", __func__)); + m->m_len = TLS_HEADER_LENGTH; + m->m_pkthdr.len = TLS_HEADER_LENGTH; + + sbappendstream_locked(sb, m, 0); + m = NULL; + } + +out: + /* + * This connection is going to die anyway, so probably don't + * need to bother with returning credits. + */ + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; +#ifdef VERBOSE_TRACES + CTR4(KTR_CXGBE, "%s: tid %u rx_credits %u rcv_wnd %u", + __func__, toep->tid, rx_credits, tp->rcv_wnd); +#endif + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(toep->vi->adapter, toep, + rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; + } + + sorwakeup_locked(so); + SOCKBUF_UNLOCK_ASSERT(sb); + + INP_WUNLOCK(inp); + CURVNET_RESTORE(); + + m_freem(m); } void Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 23 00:00:52 2020 (r366954) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Oct 23 00:23:54 2020 (r366955) @@ -74,6 +74,7 @@ enum { TPF_FORCE_CREDITS = (1 << 10), /* always send credits */ TPF_KTLS = (1 << 11), /* send TLS records from KTLS */ TPF_INITIALIZED = (1 << 12), /* init_toepcb has been called */ + TPF_TLS_RECEIVE = (1 << 13), /* should receive TLS records */ }; enum { @@ -441,6 +442,7 @@ const struct offload_settings *lookup_offload_policy(s /* t4_tls.c */ bool can_tls_offload(struct adapter *); +void do_rx_data_tls(const struct cpl_rx_data *, struct toepcb *, struct mbuf *); int t4_ctloutput_tls(struct socket *, struct sockopt *); void t4_push_tls_records(struct adapter *, struct toepcb *, int); void t4_push_ktls(struct adapter *, struct toepcb *, int); From owner-svn-src-all@freebsd.org Fri Oct 23 01:06:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D34E442F5C4; Fri, 23 Oct 2020 01:06:34 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHQzZ5F5cz4hCL; Fri, 23 Oct 2020 01:06:34 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 988561F841; Fri, 23 Oct 2020 01:06:34 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N16Y4X026793; Fri, 23 Oct 2020 01:06:34 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N16XiF026787; Fri, 23 Oct 2020 01:06:33 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010230106.09N16XiF026787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 23 Oct 2020 01:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366956 - stable/12/contrib/tzdata X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/tzdata X-SVN-Commit-Revision: 366956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 01:06:34 -0000 Author: philip Date: Fri Oct 23 01:06:33 2020 New Revision: 366956 URL: https://svnweb.freebsd.org/changeset/base/366956 Log: MFC r366921: Import tzdata 2020d Modified: stable/12/contrib/tzdata/Makefile stable/12/contrib/tzdata/NEWS stable/12/contrib/tzdata/asia stable/12/contrib/tzdata/europe stable/12/contrib/tzdata/version Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tzdata/Makefile ============================================================================== --- stable/12/contrib/tzdata/Makefile Fri Oct 23 00:23:54 2020 (r366955) +++ stable/12/contrib/tzdata/Makefile Fri Oct 23 01:06:33 2020 (r366956) @@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. - touch -md 2020-10-12T22:53:00Z \ + TZ=UTC0 touch -mt 202010122253.00 \ tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ Modified: stable/12/contrib/tzdata/NEWS ============================================================================== --- stable/12/contrib/tzdata/NEWS Fri Oct 23 00:23:54 2020 (r366955) +++ stable/12/contrib/tzdata/NEWS Fri Oct 23 01:06:33 2020 (r366956) @@ -1,5 +1,23 @@ News for the tz database +Release 2020d - 2020-10-21 11:24:13 -0700 + + Briefly: + Palestine ends DST earlier than predicted, on 2020-10-24. + + Changes to past and future timestamps + + Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31 + as previously predicted (thanks to Sharef Mustafa.) Its + 2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen + Thorsen.) Its 2015-10-23 transition was at 01:00 not 00:00, and + its spring 2020 transition was on March 28 at 00:00, not March 27 + (thanks to Pierre Cashon.) This affects Asia/Gaza and + Asia/Hebron. Assume future spring and fall transitions will be on + the Saturday preceding the last Sunday of March and October, + respectively. + + Release 2020c - 2020-10-16 11:15:53 -0700 Briefly: Modified: stable/12/contrib/tzdata/asia ============================================================================== --- stable/12/contrib/tzdata/asia Fri Oct 23 00:23:54 2020 (r366955) +++ stable/12/contrib/tzdata/asia Fri Oct 23 01:06:33 2020 (r366956) @@ -3221,14 +3221,41 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharef Mustafa (2019-10-18): # Palestine summer time will end on midnight Oct 26th 2019 ... -# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # -# From Paul Eggert (2019-04-10): -# For now, guess spring-ahead transitions are March's last Friday at 00:00. +# From Steffen Thorsen (2020-10-20): +# Some sources such as these say, and display on clocks, that DST ended at +# midnight last year... +# https://www.amad.ps/ar/post/320006 # -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. +# From Tim Parenti (2020-10-20): +# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms +# a decision on (translated): "The start of the winter time in Palestine, by +# delaying the clock by sixty minutes, starting from midnight on Friday / +# Saturday corresponding to 26/10/2019." +# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948 +# From Sharef Mustafa (2020-10-20): +# As per the palestinian cabinet announcement yesterday , the day light saving +# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. +# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 + +# From Tim Parenti (2020-10-20): +# Predict future fall transitions at 01:00 on the Saturday preceding October's +# last Sunday (i.e., Sat>=24). This is consistent with our predictions since +# 2016, although the time of the change differed slightly in 2019. + +# From Pierre Cashon (2020-10-20): +# The summer time this year started on March 28 at 00:00. +# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ +# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284 +# The winter time in 2015 started on October 23 at 01:00. +# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY +# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 +# +# From Paul Eggert (2019-04-10): +# For now, guess spring-ahead transitions are at 00:00 on the Saturday +# preceding March's last Sunday (i.e., Sat>=24). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3243,10 +3270,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - -Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - +Rule Palestine 2007 only - Sep 13 2:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 - -Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2009 only - Sep 4 1:00 0 - Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2011 only - Apr 1 0:01 1:00 S @@ -3255,12 +3282,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - -Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S +Rule Palestine 2013 only - Sep 27 0:00 0 - +Rule Palestine 2014 only - Oct 24 0:00 0 - +Rule Palestine 2015 only - Mar 28 0:00 1:00 S +Rule Palestine 2015 only - Oct 23 1:00 0 - Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 max - Oct lastSat 1:00 0 - -Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2019 only - Mar 29 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - +Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: stable/12/contrib/tzdata/europe ============================================================================== --- stable/12/contrib/tzdata/europe Fri Oct 23 00:23:54 2020 (r366955) +++ stable/12/contrib/tzdata/europe Fri Oct 23 01:06:33 2020 (r366956) @@ -1029,17 +1029,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # Denmark, Faroe Islands, and Greenland # From Jesper Nørgaard Welen (2005-04-26): -# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law -# [introducing standard time] was in effect from 1894-01-01.... -# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL +# the law [introducing standard time] was in effect from 1894-01-01.... +# The page https://www.retsinformation.dk/eli/lta/1893/83 # confirms this, and states that the law was put forth 1893-03-29. # # The EU [actually, EEC and Euratom] treaty with effect from 1973: -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL +# https://www.retsinformation.dk/eli/lta/1972/21100 # # This provoked a new law from 1974 to make possible summer time changes # in subsequent decrees with the law -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL +# https://www.retsinformation.dk/eli/lta/1974/223 # # It seems however that no decree was set forward until 1980. I have # not found any decree, but in another related law, the effecting DST @@ -1051,7 +1050,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The law is about the management of the extra hour, concerning # working hours reported and effect on obligatory-rest rules (which # was suspended on that night): -# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL +# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267 # From Jesper Nørgaard Welen (2005-06-11): # The Herning Folkeblad (1980-09-26) reported that the night between Modified: stable/12/contrib/tzdata/version ============================================================================== --- stable/12/contrib/tzdata/version Fri Oct 23 00:23:54 2020 (r366955) +++ stable/12/contrib/tzdata/version Fri Oct 23 01:06:33 2020 (r366956) @@ -1 +1 @@ -2020c +2020d From owner-svn-src-all@freebsd.org Fri Oct 23 01:06:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E21742F91B; Fri, 23 Oct 2020 01:06:46 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHQzn6ypkz4hCw; Fri, 23 Oct 2020 01:06:44 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 819D21F66B; Fri, 23 Oct 2020 01:06:43 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N16h25026841; Fri, 23 Oct 2020 01:06:43 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N16gUn026837; Fri, 23 Oct 2020 01:06:42 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010230106.09N16gUn026837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 23 Oct 2020 01:06: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: r366957 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 366957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 01:06:46 -0000 Author: philip Date: Fri Oct 23 01:06:42 2020 New Revision: 366957 URL: https://svnweb.freebsd.org/changeset/base/366957 Log: MFC r366921: Import tzdata 2020d Modified: stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/version Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Fri Oct 23 01:06:33 2020 (r366956) +++ stable/11/contrib/tzdata/Makefile Fri Oct 23 01:06:42 2020 (r366957) @@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. - touch -md 2020-10-12T22:53:00Z \ + TZ=UTC0 touch -mt 202010122253.00 \ tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Fri Oct 23 01:06:33 2020 (r366956) +++ stable/11/contrib/tzdata/NEWS Fri Oct 23 01:06:42 2020 (r366957) @@ -1,5 +1,23 @@ News for the tz database +Release 2020d - 2020-10-21 11:24:13 -0700 + + Briefly: + Palestine ends DST earlier than predicted, on 2020-10-24. + + Changes to past and future timestamps + + Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31 + as previously predicted (thanks to Sharef Mustafa.) Its + 2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen + Thorsen.) Its 2015-10-23 transition was at 01:00 not 00:00, and + its spring 2020 transition was on March 28 at 00:00, not March 27 + (thanks to Pierre Cashon.) This affects Asia/Gaza and + Asia/Hebron. Assume future spring and fall transitions will be on + the Saturday preceding the last Sunday of March and October, + respectively. + + Release 2020c - 2020-10-16 11:15:53 -0700 Briefly: Modified: stable/11/contrib/tzdata/asia ============================================================================== --- stable/11/contrib/tzdata/asia Fri Oct 23 01:06:33 2020 (r366956) +++ stable/11/contrib/tzdata/asia Fri Oct 23 01:06:42 2020 (r366957) @@ -3221,14 +3221,41 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharef Mustafa (2019-10-18): # Palestine summer time will end on midnight Oct 26th 2019 ... -# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # -# From Paul Eggert (2019-04-10): -# For now, guess spring-ahead transitions are March's last Friday at 00:00. +# From Steffen Thorsen (2020-10-20): +# Some sources such as these say, and display on clocks, that DST ended at +# midnight last year... +# https://www.amad.ps/ar/post/320006 # -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. +# From Tim Parenti (2020-10-20): +# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms +# a decision on (translated): "The start of the winter time in Palestine, by +# delaying the clock by sixty minutes, starting from midnight on Friday / +# Saturday corresponding to 26/10/2019." +# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948 +# From Sharef Mustafa (2020-10-20): +# As per the palestinian cabinet announcement yesterday , the day light saving +# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. +# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 + +# From Tim Parenti (2020-10-20): +# Predict future fall transitions at 01:00 on the Saturday preceding October's +# last Sunday (i.e., Sat>=24). This is consistent with our predictions since +# 2016, although the time of the change differed slightly in 2019. + +# From Pierre Cashon (2020-10-20): +# The summer time this year started on March 28 at 00:00. +# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ +# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284 +# The winter time in 2015 started on October 23 at 01:00. +# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY +# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 +# +# From Paul Eggert (2019-04-10): +# For now, guess spring-ahead transitions are at 00:00 on the Saturday +# preceding March's last Sunday (i.e., Sat>=24). + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3243,10 +3270,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - -Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - +Rule Palestine 2007 only - Sep 13 2:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 - -Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2009 only - Sep 4 1:00 0 - Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2011 only - Apr 1 0:01 1:00 S @@ -3255,12 +3282,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - -Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S +Rule Palestine 2013 only - Sep 27 0:00 0 - +Rule Palestine 2014 only - Oct 24 0:00 0 - +Rule Palestine 2015 only - Mar 28 0:00 1:00 S +Rule Palestine 2015 only - Oct 23 1:00 0 - Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 max - Oct lastSat 1:00 0 - -Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2019 only - Mar 29 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - +Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct Modified: stable/11/contrib/tzdata/europe ============================================================================== --- stable/11/contrib/tzdata/europe Fri Oct 23 01:06:33 2020 (r366956) +++ stable/11/contrib/tzdata/europe Fri Oct 23 01:06:42 2020 (r366957) @@ -1029,17 +1029,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # Denmark, Faroe Islands, and Greenland # From Jesper Nørgaard Welen (2005-04-26): -# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law -# [introducing standard time] was in effect from 1894-01-01.... -# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL +# the law [introducing standard time] was in effect from 1894-01-01.... +# The page https://www.retsinformation.dk/eli/lta/1893/83 # confirms this, and states that the law was put forth 1893-03-29. # # The EU [actually, EEC and Euratom] treaty with effect from 1973: -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL +# https://www.retsinformation.dk/eli/lta/1972/21100 # # This provoked a new law from 1974 to make possible summer time changes # in subsequent decrees with the law -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL +# https://www.retsinformation.dk/eli/lta/1974/223 # # It seems however that no decree was set forward until 1980. I have # not found any decree, but in another related law, the effecting DST @@ -1051,7 +1050,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The law is about the management of the extra hour, concerning # working hours reported and effect on obligatory-rest rules (which # was suspended on that night): -# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL +# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267 # From Jesper Nørgaard Welen (2005-06-11): # The Herning Folkeblad (1980-09-26) reported that the night between Modified: stable/11/contrib/tzdata/version ============================================================================== --- stable/11/contrib/tzdata/version Fri Oct 23 01:06:33 2020 (r366956) +++ stable/11/contrib/tzdata/version Fri Oct 23 01:06:42 2020 (r366957) @@ -1 +1 @@ -2020c +2020d From owner-svn-src-all@freebsd.org Fri Oct 23 01:36:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84EF3438301; Fri, 23 Oct 2020 01:36:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHRfb2x0kz4jT9; Fri, 23 Oct 2020 01:36: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 442AE1FEB7; Fri, 23 Oct 2020 01:36: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 09N1at6Z045275; Fri, 23 Oct 2020 01:36:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N1at21045274; Fri, 23 Oct 2020 01:36:55 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010230136.09N1at21045274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 23 Oct 2020 01:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366958 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 01:36:55 -0000 Author: np Date: Fri Oct 23 01:36:54 2020 New Revision: 366958 URL: https://svnweb.freebsd.org/changeset/base/366958 Log: cxgbe(4): refine the values reported in if_ratelimit_query. - Get the number of classes from chip_params. - Get the number of ethofld tids from the firmware. - Do not let tcp_ratelimit allocate all traffic classes. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Fri Oct 23 01:06:42 2020 (r366957) +++ head/sys/dev/cxgbe/t4_sched.c Fri Oct 23 01:36:54 2020 (r366958) @@ -903,34 +903,46 @@ cxgbe_rate_tag_free(struct m_snd_tag *mst) mtx_unlock(&cst->lock); } -#define CXGBE_MAX_FLOWS 4000 /* Testing show so far thats all this adapter can do */ -#define CXGBE_UNIQUE_RATE_COUNT 16 /* Number of unique rates that can be setup */ - void -cxgbe_ratelimit_query(struct ifnet *ifp __unused, - struct if_ratelimit_query_results *q) +cxgbe_ratelimit_query(struct ifnet *ifp, struct if_ratelimit_query_results *q) { - /* - * This is a skeleton and needs future work - * by the driver supporters. It should be - * enhanced to look at the specific type of - * interface and select approprate values - * for these settings. This example goes - * with an earlier card (t5), it has a maximum - * number of 16 rates that the first guys in - * select (thus the flags value RT_IS_SELECTABLE). - * If it was a fixed table then we would setup a - * const array (example mlx5). Note the card tested - * can only support reasonably 4000 flows before - * the adapter has issues with sending so here - * we limit the number of flows using hardware - * pacing to that number, other cards may - * be able to raise or eliminate this limit. - */ + struct vi_info *vi = ifp->if_softc; + struct adapter *sc = vi->adapter; + q->rate_table = NULL; q->flags = RT_IS_SELECTABLE; - q->max_flows = CXGBE_MAX_FLOWS; - q->number_of_rates = CXGBE_UNIQUE_RATE_COUNT; - q->min_segment_burst = 4; /* Driver emits 4 in a burst */ + /* + * Absolute max limits from the firmware configuration. Practical + * limits depend on the burstsize, pktsize (ifp->if_mtu ultimately) and + * the card's cclk. + */ + q->max_flows = sc->tids.netids; + q->number_of_rates = sc->chip_params->nsched_cls; + q->min_segment_burst = 4; /* matches PKTSCHED_BURST in the firmware. */ + +#if 1 + if (chip_id(sc) < CHELSIO_T6) { + /* Based on testing by rrs@ with a T580 at burstsize = 4. */ + MPASS(q->min_segment_burst == 4); + q->max_flows = max(4000, q->max_flows); + } else { + /* XXX: TBD, carried forward from T5 for now. */ + q->max_flows = max(4000, q->max_flows); + } + + /* + * XXX: tcp_ratelimit.c grabs all available rates on link-up before it + * even knows whether hw pacing will be used or not. This prevents + * other consumers like SO_MAX_PACING_RATE or those using cxgbetool or + * the private ioctls from using any of traffic classes. + * + * Underreport the number of rates to tcp_ratelimit so that it doesn't + * hog all of them. This can be removed if/when tcp_ratelimit switches + * to making its allocations on first-use rather than link-up. There is + * nothing wrong with one particular consumer reserving all the classes + * but it should do so only if it'll actually use hw rate limiting. + */ + q->number_of_rates /= 4; +#endif } #endif From owner-svn-src-all@freebsd.org Fri Oct 23 02:24:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3D57439D8C; Fri, 23 Oct 2020 02:24:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHSjl5z5Xz4lZH; Fri, 23 Oct 2020 02:24:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B17552089D; Fri, 23 Oct 2020 02:24:43 +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 09N2Ohwu075534; Fri, 23 Oct 2020 02:24:43 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N2OhWE075533; Fri, 23 Oct 2020 02:24:43 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010230224.09N2OhWE075533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 23 Oct 2020 02:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366959 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 02:24:44 -0000 Author: np Date: Fri Oct 23 02:24:43 2020 New Revision: 366959 URL: https://svnweb.freebsd.org/changeset/base/366959 Log: cxgbe(4): Fix min/max typo in r366958. Modified: head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Fri Oct 23 01:36:54 2020 (r366958) +++ head/sys/dev/cxgbe/t4_sched.c Fri Oct 23 02:24:43 2020 (r366959) @@ -924,10 +924,10 @@ cxgbe_ratelimit_query(struct ifnet *ifp, struct if_rat if (chip_id(sc) < CHELSIO_T6) { /* Based on testing by rrs@ with a T580 at burstsize = 4. */ MPASS(q->min_segment_burst == 4); - q->max_flows = max(4000, q->max_flows); + q->max_flows = min(4000, q->max_flows); } else { /* XXX: TBD, carried forward from T5 for now. */ - q->max_flows = max(4000, q->max_flows); + q->max_flows = min(4000, q->max_flows); } /* From owner-svn-src-all@freebsd.org Fri Oct 23 06:24:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C528343E433; Fri, 23 Oct 2020 06:24:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHZ2Z4qxtz3TXK; Fri, 23 Oct 2020 06:24:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 890182349C; Fri, 23 Oct 2020 06:24:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N6OcpY029726; Fri, 23 Oct 2020 06:24:38 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N6OcPu029725; Fri, 23 Oct 2020 06:24:38 GMT (envelope-from alc@FreeBSD.org) Message-Id: <202010230624.09N6OcPu029725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 23 Oct 2020 06:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366960 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 06:24:38 -0000 Author: alc Date: Fri Oct 23 06:24:38 2020 New Revision: 366960 URL: https://svnweb.freebsd.org/changeset/base/366960 Log: Conditionally compile struct vm_phys_seg's md_first field. This field is only used by arm64's pmap. Reviewed by: kib, markj, scottph Differential Revision: https://reviews.freebsd.org/D26907 Modified: head/sys/vm/vm_phys.h Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Oct 23 02:24:43 2020 (r366959) +++ head/sys/vm/vm_phys.h Fri Oct 23 06:24:38 2020 (r366960) @@ -71,7 +71,9 @@ struct vm_phys_seg { #if VM_NRESERVLEVEL > 0 vm_reserv_t first_reserv; #endif +#ifdef __aarch64__ void *md_first; +#endif int domain; struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; }; From owner-svn-src-all@freebsd.org Fri Oct 23 08:04:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51CD64401EC; Fri, 23 Oct 2020 08:04:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHcGB32s6z3Yqj; Fri, 23 Oct 2020 08:04:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DA54B2602A3; Fri, 23 Oct 2020 10:04:47 +0200 (CEST) Subject: Re: svn commit: r366936 - head/sys/net From: Hans Petter Selasky To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> Message-ID: Date: Fri, 23 Oct 2020 10:04:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CHcGB32s6z3Yqj X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.99)[-0.986]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.26)[-0.261]; NEURAL_HAM_MEDIUM(-0.87)[-0.872]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 08:04:51 -0000 On 2020-10-22 19:54, Hans Petter Selasky wrote: > On 2020-10-22 18:48, Konstantin Belousov wrote: >> sys/systm.h already includes sys/param.h.  Also, sys/param.h already >> includes >> sys/types.h. > > I'll have a look tomorrow at this. Thanks for pointing out. It appears sys/systm.h needs sys/types.h included first: > In file included from /usr/img/freebsd.svn/src/sys/sys/systm.h:44: > ./machine/atomic.h:230:1: error: unknown type name 'u_char'; did you mean 'char'? > ATOMIC_CMPSET(char); --HPS From owner-svn-src-all@freebsd.org Fri Oct 23 08:44:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B49B7440D89; Fri, 23 Oct 2020 08:44:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHd8Q45z9z3bt0; Fri, 23 Oct 2020 08:44:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C9DC24E2C; Fri, 23 Oct 2020 08:44: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 09N8is08016408; Fri, 23 Oct 2020 08:44:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N8isn6016407; Fri, 23 Oct 2020 08:44:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010230844.09N8isn6016407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 23 Oct 2020 08:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366961 - head/sys/fs/cuse X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/fs/cuse X-SVN-Commit-Revision: 366961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 08:44:54 -0000 Author: hselasky Date: Fri Oct 23 08:44:53 2020 New Revision: 366961 URL: https://svnweb.freebsd.org/changeset/base/366961 Log: Fix for loading cuse.ko via rc.d . Make sure we declare the cuse(3) module by name and not only by the version information, so that "kldstat -q -m cuse" works. Found by: Goran Mekic MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Fri Oct 23 06:24:38 2020 (r366960) +++ head/sys/fs/cuse/cuse.c Fri Oct 23 08:44:53 2020 (r366961) @@ -64,6 +64,24 @@ #include #include +static int +cuse_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + case MOD_UNLOAD: + return (0); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t cuse_mod = { + .name = "cuse", + .evhand = &cuse_modevent, +}; + +DECLARE_MODULE(cuse, cuse_mod, SI_SUB_DEVFS, SI_ORDER_FIRST); MODULE_VERSION(cuse, 1); /* From owner-svn-src-all@freebsd.org Fri Oct 23 09:22:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D2E944168C; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHdzh1Y46z3dCh; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19C7E255AA; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N9MNwt040924; Fri, 23 Oct 2020 09:22:23 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N9MNZu040921; Fri, 23 Oct 2020 09:22:23 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010230922.09N9MNZu040921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 23 Oct 2020 09:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366962 - in head: include usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head: include usr.bin/calendar X-SVN-Commit-Revision: 366962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 09:22:24 -0000 Author: se Date: Fri Oct 23 09:22:23 2020 New Revision: 366962 URL: https://svnweb.freebsd.org/changeset/base/366962 Log: Add search of LOCALBASE/share/calendar for calendars supplied by a port. Calendar files in LOCALBASE override similarily named ones in the base system. This could easily be changed if the base system calendars should have precedence, but it could lead to a violation of POLA since then the port's files were ignored unless those in base have been deleted. There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease a consistent modification of this prefix. Reviewed by: imp, pfg Differential Revision: https://reviews.freebsd.org/D26882 Modified: head/include/paths.h head/usr.bin/calendar/io.c head/usr.bin/calendar/pathnames.h Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Fri Oct 23 08:44:53 2020 (r366961) +++ head/include/paths.h Fri Oct 23 09:22:23 2020 (r366962) @@ -37,8 +37,11 @@ #include +#define _PATH_LOCALBASE "/usr/local" + /* Default search path. */ -#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" /* All standard utilities path. */ #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Fri Oct 23 08:44:53 2020 (r366961) +++ head/usr.bin/calendar/io.c Fri Oct 23 09:22:23 2020 (r366962) @@ -71,7 +71,7 @@ enum { }; const char *calendarFile = "calendar"; /* default calendar file */ -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, _PATH_INCLUDE}; /* HOME */ static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ static char path[MAXPATHLEN]; Modified: head/usr.bin/calendar/pathnames.h ============================================================================== --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 (r366961) +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 (r366962) @@ -35,3 +35,4 @@ #include #define _PATH_INCLUDE "/usr/share/calendar" +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" From owner-svn-src-all@freebsd.org Fri Oct 23 09:46:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D762B441CA0; Fri, 23 Oct 2020 09:46:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHfWT5MJHz3f5l; Fri, 23 Oct 2020 09:46:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09N9kMO5089540 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 23 Oct 2020 12:46:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09N9kMO5089540 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09N9kLHC089538; Fri, 23 Oct 2020 12:46:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Oct 2020 12:46:21 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366936 - head/sys/net Message-ID: <20201023094621.GW2643@kib.kiev.ua> References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CHfWT5MJHz3f5l X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [0.47 / 15.00]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.87)[0.868]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.45)[-0.448]; NEURAL_SPAM_LONG(0.05)[0.053]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 09:46:30 -0000 On Fri, Oct 23, 2020 at 10:04:12AM +0200, Hans Petter Selasky wrote: > On 2020-10-22 19:54, Hans Petter Selasky wrote: > > On 2020-10-22 18:48, Konstantin Belousov wrote: > > > sys/systm.h already includes sys/param.h.  Also, sys/param.h already > > > includes > > > sys/types.h. > > > > I'll have a look tomorrow at this. Thanks for pointing out. > > It appears sys/systm.h needs sys/types.h included first: Normally you do #include #include and I do not see why it would not work in this case. > > > In file included from /usr/img/freebsd.svn/src/sys/sys/systm.h:44: > > ./machine/atomic.h:230:1: error: unknown type name 'u_char'; did you mean 'char'? > > ATOMIC_CMPSET(char); > > --HPS From owner-svn-src-all@freebsd.org Fri Oct 23 10:00:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADA6A441FCB; Fri, 23 Oct 2020 10:00:56 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHfr84DfBz3fYQ; Fri, 23 Oct 2020 10:00:56 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756C125C1D; Fri, 23 Oct 2020 10:00:56 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NA0uO5060472; Fri, 23 Oct 2020 10:00:56 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NA0uMJ060471; Fri, 23 Oct 2020 10:00:56 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010231000.09NA0uMJ060471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 23 Oct 2020 10:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366963 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 366963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 10:00:56 -0000 Author: se Date: Fri Oct 23 10:00:56 2020 New Revision: 366963 URL: https://svnweb.freebsd.org/changeset/base/366963 Log: Udpate calendar man-page to mention the search path added in r366962. Calendar files in /usr/lcoal/share/calendar take precedence over files in the base system. They can be provided by a port or package, but since such a port has not been committed, yet, no specific port name is suggested. In fact, multiple ports could exist (e.g. per locale) without conflicting with each other. Modified: head/usr.bin/calendar/calendar.1 Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Fri Oct 23 09:22:23 2020 (r366962) +++ head/usr.bin/calendar/calendar.1 Fri Oct 23 10:00:56 2020 (r366963) @@ -28,7 +28,7 @@ .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd September 29, 2020 +.Dd Oktober 23, 2020 .Dt CALENDAR 1 .Os .Sh NAME @@ -245,7 +245,15 @@ A chdir is done into this directory if it exists. calendar file to use if no calendar file exists in the current directory. .It Pa ~/.calendar/nomail do not send mail if this file exists. +.It Pa /usr/share/calendar +system wide location of calendar files provided as part of the base system. +.It Pa /usr/local/share/calendar +system wide location for calendar files provided by a port or package. .El +.Pp +The order of precedence in searches for a calendar file is: +current directory, ~/.calendar, /usr/local/share/calendar, /usr/share/calendar. +Files of similar names are ignored in lower precedence locations. .Pp The following default calendar files are provided in .Pa /usr/share/calendar : From owner-svn-src-all@freebsd.org Fri Oct 23 10:24:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DEEB442B94; Fri, 23 Oct 2020 10:24:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHgMV1Ny6z3gsg; Fri, 23 Oct 2020 10:24: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EF1E25DF8; Fri, 23 Oct 2020 10:24: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 09NAObkh077715; Fri, 23 Oct 2020 10:24:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NAObMc077714; Fri, 23 Oct 2020 10:24:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010231024.09NAObMc077714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Oct 2020 10:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366964 - stable/12/sys/amd64/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/include X-SVN-Commit-Revision: 366964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 10:24:38 -0000 Author: kib Date: Fri Oct 23 10:24:37 2020 New Revision: 366964 URL: https://svnweb.freebsd.org/changeset/base/366964 Log: MFC r366768: amd64 pmap.h: explicitly provide constants values instead of relying on some more advanced C features. Modified: stable/12/sys/amd64/include/pmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/pmap.h ============================================================================== --- stable/12/sys/amd64/include/pmap.h Fri Oct 23 10:00:56 2020 (r366963) +++ stable/12/sys/amd64/include/pmap.h Fri Oct 23 10:24:37 2020 (r366964) @@ -240,7 +240,7 @@ #define PMAP_PCID_OVERMAX_KERN 0x800 #define PMAP_PCID_USER_PT 0x800 -#define PMAP_NO_CR3 (~0UL) +#define PMAP_NO_CR3 0xffffffffffffffff #ifndef LOCORE From owner-svn-src-all@freebsd.org Fri Oct 23 10:48:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38FF1443185; Fri, 23 Oct 2020 10:48:15 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHgtl0pfPz3ybW; Fri, 23 Oct 2020 10:48:15 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0037B264A4; Fri, 23 Oct 2020 10:48:15 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NAmEi4090392; Fri, 23 Oct 2020 10:48:14 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NAmEW8090391; Fri, 23 Oct 2020 10:48:14 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010231048.09NAmEW8090391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 23 Oct 2020 10:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366965 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 366965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 10:48:15 -0000 Author: freqlabs Date: Fri Oct 23 10:48:14 2020 New Revision: 366965 URL: https://svnweb.freebsd.org/changeset/base/366965 Log: MFC r366771: bhyve: Update TX descriptor base address and host mapping on change bhyve sometimes segfaults when using an e1000 NIC with a Windows guest. We are only updating our tdba and cached host mapping when the low address register is written and when tx is set enabled, but not when the high address or length registers are written. It is observed that Windows 10 is occasionally enabling tx first then writing the registers in the order low, high, len. This leaves us with a bogus base address and mapping, which causes a segfault later when we try to copy from a descriptor that has unpredictable garbage in a pointer. Updating the address and mapping when any of those registers change seems to fix that particular issue. Reviewed by: mav, grehan (bhyve) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26798 Modified: stable/12/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_e82545.c Fri Oct 23 10:24:37 2020 (r366964) +++ stable/12/usr.sbin/bhyve/pci_e82545.c Fri Oct 23 10:48:14 2020 (r366965) @@ -1699,18 +1699,18 @@ e82545_write_register(struct e82545_softc *sc, uint32_ break; case E1000_TDBAL(0): sc->esc_TDBAL = value & ~0xF; - if (sc->esc_tx_enabled) { - /* Apparently legal */ + if (sc->esc_tx_enabled) e82545_tx_update_tdba(sc); - } break; case E1000_TDBAH(0): - //assert(!sc->esc_tx_enabled); sc->esc_TDBAH = value; + if (sc->esc_tx_enabled) + e82545_tx_update_tdba(sc); break; case E1000_TDLEN(0): - //assert(!sc->esc_tx_enabled); sc->esc_TDLEN = value & ~0xFFF0007F; + if (sc->esc_tx_enabled) + e82545_tx_update_tdba(sc); break; case E1000_TDH(0): //assert(!sc->esc_tx_enabled); From owner-svn-src-all@freebsd.org Fri Oct 23 11:26:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A5C8443F85; Fri, 23 Oct 2020 11:26:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHhlG3JZzz41Rc; Fri, 23 Oct 2020 11:26:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 145192602A3; Fri, 23 Oct 2020 13:26:41 +0200 (CEST) Subject: Re: svn commit: r366936 - head/sys/net To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> <20201023094621.GW2643@kib.kiev.ua> From: Hans Petter Selasky Message-ID: <966178e3-078f-66d3-8baa-6672b998422e@selasky.org> Date: Fri, 23 Oct 2020 13:26:04 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201023094621.GW2643@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CHhlG3JZzz41Rc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.70 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.99)[-0.986]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.54)[-0.539]; NEURAL_HAM_MEDIUM(-0.87)[-0.873]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 11:26:51 -0000 On 2020-10-23 11:46, Konstantin Belousov wrote: > On Fri, Oct 23, 2020 at 10:04:12AM +0200, Hans Petter Selasky wrote: >> On 2020-10-22 19:54, Hans Petter Selasky wrote: >>> On 2020-10-22 18:48, Konstantin Belousov wrote: >>>> sys/systm.h already includes sys/param.h.  Also, sys/param.h already >>>> includes >>>> sys/types.h. >>> >>> I'll have a look tomorrow at this. Thanks for pointing out. >> >> It appears sys/systm.h needs sys/types.h included first: > Normally you do > #include > #include > and I do not see why it would not work in this case. > >> >>> In file included from /usr/img/freebsd.svn/src/sys/sys/systm.h:44: >>> ./machine/atomic.h:230:1: error: unknown type name 'u_char'; did you mean 'char'? >>> ATOMIC_CMPSET(char); >> >> --HPS Hi, The following works, but it doesn't make much difference. Do we have a script or tool, which can do this? --HPS > Index: sys/net/if_infiniband.c > =================================================================== > --- sys/net/if_infiniband.c (revision 366936) > +++ sys/net/if_infiniband.c (working copy) > @@ -30,9 +30,8 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > -#include > -#include > #include > #include > #include From owner-svn-src-all@freebsd.org Fri Oct 23 11:47:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DED024441B4; Fri, 23 Oct 2020 11:47:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHjBY6WKtz42RP; Fri, 23 Oct 2020 11:47:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09NBktWn018798 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 23 Oct 2020 14:46:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09NBktWn018798 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09NBkt7P018797; Fri, 23 Oct 2020 14:46:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Oct 2020 14:46:54 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366936 - head/sys/net Message-ID: <20201023114654.GY2643@kib.kiev.ua> References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> <20201023094621.GW2643@kib.kiev.ua> <966178e3-078f-66d3-8baa-6672b998422e@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <966178e3-078f-66d3-8baa-6672b998422e@selasky.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CHjBY6WKtz42RP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [0.18 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_SPAM_SHORT(0.05)[0.046]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.08)[0.077]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.05)[0.053]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 11:47:02 -0000 On Fri, Oct 23, 2020 at 01:26:04PM +0200, Hans Petter Selasky wrote: > On 2020-10-23 11:46, Konstantin Belousov wrote: > > On Fri, Oct 23, 2020 at 10:04:12AM +0200, Hans Petter Selasky wrote: > > > On 2020-10-22 19:54, Hans Petter Selasky wrote: > > > > On 2020-10-22 18:48, Konstantin Belousov wrote: > > > > > sys/systm.h already includes sys/param.h.  Also, sys/param.h already > > > > > includes > > > > > sys/types.h. > > > > > > > > I'll have a look tomorrow at this. Thanks for pointing out. > > > > > > It appears sys/systm.h needs sys/types.h included first: > > Normally you do > > #include > > #include > > and I do not see why it would not work in this case. > > > > > > > > > In file included from /usr/img/freebsd.svn/src/sys/sys/systm.h:44: > > > > ./machine/atomic.h:230:1: error: unknown type name 'u_char'; did you mean 'char'? > > > > ATOMIC_CMPSET(char); > > > > > > --HPS > > Hi, > > The following works, but it doesn't make much difference. It makes a difference because this is an idiomatic an intended use of the headers. > > Do we have a script or tool, which can do this? I am not aware of. > > --HPS > > > Index: sys/net/if_infiniband.c > > =================================================================== > > --- sys/net/if_infiniband.c (revision 366936) > > +++ sys/net/if_infiniband.c (working copy) > > @@ -30,9 +30,8 @@ > > __FBSDID("$FreeBSD$"); > > #include > > +#include > > #include > > -#include > > -#include > > #include > > #include > > #include From owner-svn-src-all@freebsd.org Fri Oct 23 11:57:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D74F4444D7; Fri, 23 Oct 2020 11:57:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHjR83BKgz42kH; Fri, 23 Oct 2020 11:57:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA2226F4D; Fri, 23 Oct 2020 11:57:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NBvucG032874; Fri, 23 Oct 2020 11:57:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NBvupX032873; Fri, 23 Oct 2020 11:57:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010231157.09NBvupX032873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 23 Oct 2020 11:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366966 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 366966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 11:57:56 -0000 Author: trasz Date: Fri Oct 23 11:57:55 2020 New Revision: 366966 URL: https://svnweb.freebsd.org/changeset/base/366966 Log: Add /proc/sys/kernel/ngroups_max to linprocfs(4). The id(1) command seems to use it - it works fine without it, but still. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26898 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Oct 23 10:48:14 2020 (r366965) +++ head/sys/compat/linprocfs/linprocfs.c Fri Oct 23 11:57:55 2020 (r366966) @@ -1453,6 +1453,19 @@ linprocfs_domsgmnb(PFS_FILL_ARGS) } /* + * Filler function for proc/sys/kernel/ngroups_max + * + * Note that in Linux it defaults to 65536, not 1023. + */ +static int +linprocfs_dongroups_max(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", ngroups_max); + return (0); +} + +/* * Filler function for proc/sys/kernel/pid_max */ static int @@ -1921,6 +1934,8 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_file(dir, "msgmni", &linprocfs_domsgmni, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "msgmnb", &linprocfs_domsgmnb, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "ngroups_max", &linprocfs_dongroups_max, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "pid_max", &linprocfs_dopid_max, NULL, NULL, NULL, PFS_RD); From owner-svn-src-all@freebsd.org Fri Oct 23 12:00:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2C694449F7; Fri, 23 Oct 2020 12:00:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHjV74Pm2z43K6; Fri, 23 Oct 2020 12:00:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B30627147; Fri, 23 Oct 2020 12:00:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NC0VCJ033246; Fri, 23 Oct 2020 12:00:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NC0Vkh033245; Fri, 23 Oct 2020 12:00:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010231200.09NC0Vkh033245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 23 Oct 2020 12:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366967 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 12:00:31 -0000 Author: trasz Date: Fri Oct 23 12:00:30 2020 New Revision: 366967 URL: https://svnweb.freebsd.org/changeset/base/366967 Log: Improve prctl(2) debug. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26899 Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Oct 23 11:57:55 2020 (r366966) +++ head/sys/compat/linux/linux_misc.c Fri Oct 23 12:00:30 2020 (r366967) @@ -2001,7 +2001,15 @@ linux_prctl(struct thread *td, struct linux_prctl_args error = copyout(comm, (void *)(register_t)args->arg2, strlen(comm) + 1); break; + case LINUX_PR_GET_SECCOMP: + case LINUX_PR_SET_SECCOMP: + /* + * Same as returned by Linux without CONFIG_SECCOMP enabled. + */ + error = EINVAL; + break; default: + linux_msg(td, "unsupported prctl option %d", args->option); error = EINVAL; break; } Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Fri Oct 23 11:57:55 2020 (r366966) +++ head/sys/compat/linux/linux_misc.h Fri Oct 23 12:00:30 2020 (r366967) @@ -54,6 +54,8 @@ #define LINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */ #define LINUX_PR_SET_NAME 15 /* Set process name. */ #define LINUX_PR_GET_NAME 16 /* Get process name. */ +#define LINUX_PR_GET_SECCOMP 21 +#define LINUX_PR_SET_SECCOMP 22 #define LINUX_MAX_COMM_LEN 16 /* Maximum length of the process name. */ From owner-svn-src-all@freebsd.org Fri Oct 23 12:27:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E52B445E11; Fri, 23 Oct 2020 12:27:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHk5K3p4Kz44Nw; Fri, 23 Oct 2020 12:27:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09NCRQwv028234 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 23 Oct 2020 15:27:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09NCRQwv028234 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09NCRQS5028233; Fri, 23 Oct 2020 15:27:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Oct 2020 15:27:26 +0300 From: Konstantin Belousov To: Ryan Moeller Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r366965 - stable/12/usr.sbin/bhyve Message-ID: <20201023122726.GZ2643@kib.kiev.ua> References: <202010231048.09NAmEW8090391@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010231048.09NAmEW8090391@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CHk5K3p4Kz44Nw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 12:27:34 -0000 On Fri, Oct 23, 2020 at 10:48:14AM +0000, Ryan Moeller wrote: > Author: freqlabs > Date: Fri Oct 23 10:48:14 2020 > New Revision: 366965 > URL: https://svnweb.freebsd.org/changeset/base/366965 > > Log: > MFC r366771: > > bhyve: Update TX descriptor base address and host mapping on change > > bhyve sometimes segfaults when using an e1000 NIC with a Windows guest. > > We are only updating our tdba and cached host mapping when the low address > register is written and when tx is set enabled, but not when the high address > or length registers are written. It is observed that Windows 10 is occasionally > enabling tx first then writing the registers in the order low, high, len. This > leaves us with a bogus base address and mapping, which causes a segfault later > when we try to copy from a descriptor that has unpredictable garbage in a > pointer. > > Updating the address and mapping when any of those registers change seems to fix > that particular issue. Does this description mean that if guest writes garbage into base, it can crash monitor ? From owner-svn-src-all@freebsd.org Fri Oct 23 12:33:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8D8D445E2D; Fri, 23 Oct 2020 12:33:23 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHkD34hMLz45Dj; Fri, 23 Oct 2020 12:33:23 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:a87f:8320:db8:a206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4C189222D2; Fri, 23 Oct 2020 12:33:23 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r366965 - stable/12/usr.sbin/bhyve To: Konstantin Belousov , Ryan Moeller Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202010231048.09NAmEW8090391@repo.freebsd.org> <20201023122726.GZ2643@kib.kiev.ua> From: Ryan Moeller Message-ID: <9590af32-1b4c-23b8-dede-2554ea2b256c@FreeBSD.org> Date: Fri, 23 Oct 2020 08:33:22 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201023122726.GZ2643@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 12:33:23 -0000 On 10/23/20 8:27 AM, Konstantin Belousov wrote: > Does this description mean that if guest writes garbage into base, it can > crash monitor ? The guest can crash the bhyve process by writing garbage into device registers, yes. A bad base address will be mapped to NULL and eventually gets passed as src to memcpy. -Ryan From owner-svn-src-all@freebsd.org Fri Oct 23 12:42:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89D12445CF2; Fri, 23 Oct 2020 12:42:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHkQd4RDXz45RY; Fri, 23 Oct 2020 12:42:33 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f169.google.com with SMTP id l16so1194756ilj.9; Fri, 23 Oct 2020 05:42:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PoQWkkYuAj8s112z6NfSAav/nobXkxH9AwBQhCY948U=; b=KuWzjUtTt1ziWk0UYGC8PtCZGvESoxdLAA/ues10RoWXCMP78y+3mlkc+JO2r2VH6R 8KiFXBn7x8j0HZnFDc3hyJDo/LCasrxk2U7BEvZe5xOQE/qNMW6m2VbBKG/iRnaHYYry MA9djbTUxfSdkaZc56NUcUpeNxWrqhrOmeB+3fSheRzhNa+q1eiPS83FD15+llUEXBcl ppY9o1rTECCqbhAmnBHE23aHB/Sd1hS+0UTJObXgiBNITLczw4VptPa02xyiDD2I6dNK snvi53j8UK/izRcRlLf8MqmQmVM3SYp56OVPXrDEMQakrUwxPF1sLq7vB75uIG6Nuv/X d+Iw== X-Gm-Message-State: AOAM530/8hq1bI65cKVHF3zNY4gpNoLoEh8vt3fV3wMR17Y9rRnWN2I1 usVFxHx6U3jhLsJ/K3v7v/fb0ntWxSdeIZnYcx4P8Sq/VIU= X-Google-Smtp-Source: ABdhPJyBSUwYmp1V1zkScI5Odn2XCWh3Ml/ClcopOfaV+ZRtq0DGfE1zpcpOgwTAJIsUrXX8eq8Yk6cwxPIpzbHn034= X-Received: by 2002:a92:d490:: with SMTP id p16mr1427149ilg.98.1603456952144; Fri, 23 Oct 2020 05:42:32 -0700 (PDT) MIME-Version: 1.0 References: <202010221222.09MCM8qo048407@repo.freebsd.org> <20201022164804.GQ2643@kib.kiev.ua> <69bfca24-40a9-552a-62b3-8ab7b46ff3c7@selasky.org> <20201023094621.GW2643@kib.kiev.ua> <966178e3-078f-66d3-8baa-6672b998422e@selasky.org> In-Reply-To: <966178e3-078f-66d3-8baa-6672b998422e@selasky.org> From: Ed Maste Date: Fri, 23 Oct 2020 08:42:20 -0400 Message-ID: Subject: Re: svn commit: r366936 - head/sys/net To: Hans Petter Selasky Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CHkQd4RDXz45RY X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.169 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.94)[-0.936]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.95)[-0.955]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.23)[-0.231]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.169:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.169:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 12:42:34 -0000 On Fri, 23 Oct 2020 at 07:27, Hans Petter Selasky wrote: > > Do we have a script or tool, which can do this? Clang-format can do it; have a look at the IncludeCategories in .clang-format at the top of the tree to see the current rule set for includes. From owner-svn-src-all@freebsd.org Fri Oct 23 14:15:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3543D4473FB; Fri, 23 Oct 2020 14:15:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHmVR0XFYz4BGg; Fri, 23 Oct 2020 14:15:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA4258BDA; Fri, 23 Oct 2020 14:15:58 +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 09NEFwu4018392; Fri, 23 Oct 2020 14:15:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NEFwSe018391; Fri, 23 Oct 2020 14:15:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231415.09NEFwSe018391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 14:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366968 - head/sys/dev/ntb X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ntb X-SVN-Commit-Revision: 366968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 14:15:59 -0000 Author: markj Date: Fri Oct 23 14:15:58 2020 New Revision: 366968 URL: https://svnweb.freebsd.org/changeset/base/366968 Log: ntb: Fix an assertion to permit >= 32 doorbells MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Modified: head/sys/dev/ntb/ntb_transport.c Modified: head/sys/dev/ntb/ntb_transport.c ============================================================================== --- head/sys/dev/ntb/ntb_transport.c Fri Oct 23 12:00:30 2020 (r366967) +++ head/sys/dev/ntb/ntb_transport.c Fri Oct 23 14:15:58 2020 (r366968) @@ -357,7 +357,7 @@ ntb_transport_attach(device_t dev) spad_count = ntb_spad_count(dev); db_bitmap = ntb_db_valid_mask(dev); db_count = flsll(db_bitmap); - KASSERT(db_bitmap == (1 << db_count) - 1, + KASSERT(db_bitmap == ((uint64_t)1 << db_count) - 1, ("Doorbells are not sequential (%jx).\n", db_bitmap)); if (nt->mw_count == 0) { From owner-svn-src-all@freebsd.org Fri Oct 23 14:16:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 917DD447ADB; Fri, 23 Oct 2020 14:16:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHmWT3gwXz4C8s; Fri, 23 Oct 2020 14:16:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6123B89CE; Fri, 23 Oct 2020 14:16:53 +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 09NEGrZ0018479; Fri, 23 Oct 2020 14:16:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NEGquh018476; Fri, 23 Oct 2020 14:16:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231416.09NEGquh018476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 14:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366969 - in head: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 366969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 14:16:53 -0000 Author: markj Date: Fri Oct 23 14:16:52 2020 New Revision: 366969 URL: https://svnweb.freebsd.org/changeset/base/366969 Log: ntb: Add Intel Xeon Gen3 support The NTB hardware starting with Skylake has some changes to the register map and the doorbell interface. Add a new NTB_XEON_GEN3 device type and use it to conditionalize driver logic that differs from the existing Xeon code. Reviewed by: vangyzen Discussed with: cem, Bret Ketchum MFC after: 1 month Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26683 Modified: head/share/man/man4/ntb_hw_intel.4 head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Modified: head/share/man/man4/ntb_hw_intel.4 ============================================================================== --- head/share/man/man4/ntb_hw_intel.4 Fri Oct 23 14:15:58 2020 (r366968) +++ head/share/man/man4/ntb_hw_intel.4 Fri Oct 23 14:16:52 2020 (r366969) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2017 +.Dd October 11, 2020 .Dt NTB_HW_INTEL 4 .Os .Sh NAME @@ -50,16 +50,18 @@ The driver provides support for the Non-Transparent Bridge (NTB) hardware in Intel Xeon E3/E5 and S1200 processor families, which allow one of their PCIe ports to be switched from transparent to non-transparent bridge mode. -In this mode bridge looks not as a PCI bridge, but as PCI endpoint device. +In this mode the bridge looks not like a PCI bridge, but like a PCI endpoint +device. The driver hides hardware details, exposing memory windows, scratchpads -and doorbells of the other side via hardware independent KPI to +and doorbells of the other side via a hardware independent KPI to the .Xr ntb 4 subsystem. .Pp The hardware provides 2 or 3 memory windows to the other system's memory, -16 scratchpad registers and 14 or 34 doorbells to interrupt the other system. -On Xeon processors one of memory windows is typically consumed by the driver -itself to workaround multiple hardware erratas. +16 scratchpad registers and 14, 31 or 34 doorbells to interrupt the other +system, depending on the platform. +On Xeon processors one of the memory windows is typically consumed by the driver +itself to work around multiple hardware errata. .Sh CONFIGURATION The NTB configuration should be set by BIOS. It includes enabling NTB, choosing between NTB-to-NTB (back-to-back) or @@ -67,9 +69,10 @@ NTB-to-Root Port mode, enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. .Pp -The recommended configuration is NTB-to-NTB mode, split bar is enabled and -all BAR sizes are set to 20 (1 MiB). +The recommended configuration is NTB-to-NTB mode, split bar enabled and +all BAR sizes set to 20 (1 MiB). This needs to be done on both systems. +Note, on Xeon SkyLake and newer platforms, split bar mode is not available. .Sh SEE ALSO .Xr if_ntb 4 , .Xr ntb_transport 4 , Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Oct 23 14:15:58 2020 (r366968) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Oct 23 14:16:52 2020 (r366969) @@ -68,7 +68,8 @@ __FBSDID("$FreeBSD$"); #include "ntb_hw_intel.h" #include "../ntb.h" -#define MAX_MSIX_INTERRUPTS MAX(XEON_DB_COUNT, ATOM_DB_COUNT) +#define MAX_MSIX_INTERRUPTS \ + MAX(MAX(XEON_DB_COUNT, ATOM_DB_COUNT), XEON_GEN3_DB_COUNT) #define NTB_HB_TIMEOUT 1 /* second */ #define ATOM_LINK_RECOVERY_TIME 500 /* ms */ @@ -87,7 +88,8 @@ __FBSDID("$FreeBSD$"); #define PCI_MSIX_ENTRY_DATA 8 enum ntb_device_type { - NTB_XEON, + NTB_XEON_GEN1, + NTB_XEON_GEN3, NTB_ATOM }; @@ -338,6 +340,7 @@ static int map_memory_window_bar(struct ntb_softc *ntb static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb); static int intel_ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); static int intel_ntb_init_isr(struct ntb_softc *ntb); +static int intel_ntb_xeon_gen3_init_isr(struct ntb_softc *ntb); static int intel_ntb_setup_legacy_interrupt(struct ntb_softc *ntb); static int intel_ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); static void intel_ntb_teardown_interrupts(struct ntb_softc *ntb); @@ -355,8 +358,10 @@ static void intel_ntb_exchange_msix(void *); static struct ntb_hw_info *intel_ntb_get_device_info(uint32_t device_id); static void intel_ntb_detect_max_mw(struct ntb_softc *ntb); static int intel_ntb_detect_xeon(struct ntb_softc *ntb); +static int intel_ntb_detect_xeon_gen3(struct ntb_softc *ntb); static int intel_ntb_detect_atom(struct ntb_softc *ntb); static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb); +static int intel_ntb_xeon_gen3_init_dev(struct ntb_softc *ntb); static int intel_ntb_atom_init_dev(struct ntb_softc *ntb); static void intel_ntb_teardown_xeon(struct ntb_softc *ntb); static void configure_atom_secondary_side_bars(struct ntb_softc *ntb); @@ -368,6 +373,9 @@ static void xeon_set_pbar_xlat(struct ntb_softc *, uin enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); +static int xeon_gen3_setup_b2b_mw(struct ntb_softc *); +static int intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus_addr_t addr, + size_t size); static inline bool link_is_up(struct ntb_softc *ntb); static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); @@ -479,6 +487,7 @@ SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTU #define NTB_B2BDOORBELL_BIT14 (1 << 3) /* Software/configuration owns the top 16 bits. */ #define NTB_SPLIT_BAR (1ull << 16) +#define NTB_ONE_MSIX (1ull << 17) #define NTB_FEATURES_STR \ "\20\21SPLIT_BAR4\04B2B_DOORBELL_BIT14\03SB01BASE_LOCKUP" \ @@ -490,18 +499,21 @@ static struct ntb_hw_info pci_ids[] = { NTB_ATOM, 0 }, { 0x37258086, "JSF Xeon C35xx/C55xx Non-Transparent Bridge B2B", - NTB_XEON, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, { 0x3C0D8086, "SNB Xeon E5/Core i7 Non-Transparent Bridge B2B", - NTB_XEON, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, - { 0x0E0D8086, "IVT Xeon E5 V2 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 }, + { 0x0E0D8086, "IVT Xeon E5 V2 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP | NTB_BAR_SIZE_4K }, - { 0x2F0D8086, "HSX Xeon E5 V3 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + { 0x2F0D8086, "HSX Xeon E5 V3 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP }, - { 0x6F0D8086, "BDX Xeon E5 V4 Non-Transparent Bridge B2B", NTB_XEON, - NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | + { 0x6F0D8086, "BDX Xeon E5 V4 Non-Transparent Bridge B2B", + NTB_XEON_GEN1, NTB_SDOORBELL_LOCKUP | NTB_B2BDOORBELL_BIT14 | NTB_SB01BASE_LOCKUP }, + + { 0x201C8086, "SKL Xeon E5 V5 Non-Transparent Bridge B2B", + NTB_XEON_GEN3, 0 }, }; static const struct ntb_reg atom_reg = { @@ -586,6 +598,37 @@ static struct ntb_b2b_addr xeon_b2b_dsd_addr = { .bar5_addr32 = XEON_B2B_BAR5_ADDR32, }; +static const struct ntb_reg xeon_gen3_reg = { + .ntb_ctl = XEON_GEN3_REG_IMNTB_CTRL, + .lnk_sta = XEON_GEN3_INT_LNK_STS_OFFSET, + .db_size = sizeof(uint32_t), + .mw_bar = { NTB_B2B_BAR_1, NTB_B2B_BAR_2 }, +}; + +static const struct ntb_alt_reg xeon_gen3_pri_reg = { + .db_bell = XEON_GEN3_REG_EMDOORBELL, + .db_mask = XEON_GEN3_REG_IMINT_DISABLE, + .spad = XEON_GEN3_REG_IMSPAD, +}; + +static const struct ntb_alt_reg xeon_gen3_b2b_reg = { + .db_bell = XEON_GEN3_REG_IMDOORBELL, + .db_mask = XEON_GEN3_REG_EMINT_DISABLE, + .spad = XEON_GEN3_REG_IMB2B_SSPAD, +}; + +static const struct ntb_xlat_reg xeon_gen3_sec_xlat = { + .bar0_base = XEON_GEN3_EXT_REG_BAR0BASE, + .bar2_base = XEON_GEN3_EXT_REG_BAR1BASE, + .bar4_base = XEON_GEN3_EXT_REG_BAR2BASE, + + .bar2_limit = XEON_GEN3_REG_IMBAR1XLIMIT, + .bar4_limit = XEON_GEN3_REG_IMBAR2XLIMIT, + + .bar2_xlat = XEON_GEN3_REG_IMBAR1XBASE, + .bar4_xlat = XEON_GEN3_REG_IMBAR2XBASE, +}; + SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "B2B MW segment overrides -- MUST be the same on both sides"); @@ -662,6 +705,8 @@ intel_ntb_attach(device_t device) if (ntb->type == NTB_ATOM) error = intel_ntb_detect_atom(ntb); + else if (ntb->type == NTB_XEON_GEN3) + error = intel_ntb_detect_xeon_gen3(ntb); else error = intel_ntb_detect_xeon(ntb); if (error != 0) @@ -676,6 +721,8 @@ intel_ntb_attach(device_t device) goto out; if (ntb->type == NTB_ATOM) error = intel_ntb_atom_init_dev(ntb); + else if (ntb->type == NTB_XEON_GEN3) + error = intel_ntb_xeon_gen3_init_dev(ntb); else error = intel_ntb_xeon_init_dev(ntb); if (error != 0) @@ -715,7 +762,7 @@ intel_ntb_detach(device_t device) callout_drain(&ntb->lr_timer); callout_drain(&ntb->peer_msix_work); pci_disable_busmaster(ntb->device); - if (ntb->type == NTB_XEON) + if (ntb->type == NTB_XEON_GEN1) intel_ntb_teardown_xeon(ntb); intel_ntb_teardown_interrupts(ntb); @@ -825,22 +872,39 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb) rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - bar->psz_off = XEON_PBAR23SZ_OFFSET; - bar->ssz_off = XEON_SBAR23SZ_OFFSET; - bar->pbarxlat_off = XEON_PBAR2XLAT_OFFSET; + if (ntb->type == NTB_XEON_GEN3) { + bar->psz_off = XEON_GEN3_INT_REG_IMBAR1SZ; + bar->ssz_off = XEON_GEN3_INT_REG_EMBAR1SZ; + bar->pbarxlat_off = XEON_GEN3_REG_EMBAR1XBASE; + } else { + bar->psz_off = XEON_PBAR23SZ_OFFSET; + bar->ssz_off = XEON_SBAR23SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR2XLAT_OFFSET; + } bar = &ntb->bar_info[NTB_B2B_BAR_2]; bar->pci_resource_id = PCIR_BAR(4); rc = map_memory_window_bar(ntb, bar); if (rc != 0) goto out; - bar->psz_off = XEON_PBAR4SZ_OFFSET; - bar->ssz_off = XEON_SBAR4SZ_OFFSET; - bar->pbarxlat_off = XEON_PBAR4XLAT_OFFSET; + if (ntb->type == NTB_XEON_GEN3) { + bar->psz_off = XEON_GEN3_INT_REG_IMBAR2SZ; + bar->ssz_off = XEON_GEN3_INT_REG_EMBAR2SZ; + bar->pbarxlat_off = XEON_GEN3_REG_EMBAR2XBASE; + } else { + bar->psz_off = XEON_PBAR4SZ_OFFSET; + bar->ssz_off = XEON_SBAR4SZ_OFFSET; + bar->pbarxlat_off = XEON_PBAR4XLAT_OFFSET; + } if (!HAS_FEATURE(ntb, NTB_SPLIT_BAR)) goto out; + if (ntb->type == NTB_XEON_GEN3) { + device_printf(ntb->device, "no split bar support\n"); + return (ENXIO); + } + bar = &ntb->bar_info[NTB_B2B_BAR_3]; bar->pci_resource_id = PCIR_BAR(5); rc = map_memory_window_bar(ntb, bar); @@ -1060,6 +1124,63 @@ intel_ntb_remap_msix(device_t dev, uint32_t desired, u } static int +intel_ntb_xeon_gen3_init_isr(struct ntb_softc *ntb) +{ + uint64_t i, reg; + uint32_t desired_vectors, num_vectors; + int rc; + + ntb->allocated_interrupts = 0; + ntb->last_ts = ticks; + + /* Mask all the interrupts, including hardware interrupt */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_DISABLE, ~0ULL); + + /* Clear Interrupt Status */ + reg = intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_STATUS, reg); + + num_vectors = desired_vectors = MIN(pci_msix_count(ntb->device), + XEON_GEN3_DB_MSIX_VECTOR_COUNT); + + rc = pci_alloc_msix(ntb->device, &num_vectors); + if (rc != 0) { + device_printf(ntb->device, + "Interrupt allocation failed %d\n", rc); + return (rc); + } + if (desired_vectors != num_vectors) { + device_printf(ntb->device, "Couldn't get %d vectors\n", + XEON_GEN3_DB_MSIX_VECTOR_COUNT); + return (ENXIO); + } + /* 32 db + 1 hardware */ + if (num_vectors == XEON_GEN3_DB_MSIX_VECTOR_COUNT) { + /* Program INTVECXX source register */ + for (i = 0; i < XEON_GEN3_DB_MSIX_VECTOR_COUNT; i++) { + /* interrupt source i for vector i */ + intel_ntb_reg_write(1, XEON_GEN3_REG_IMINTVEC00 + i, i); + if (i == (XEON_GEN3_DB_MSIX_VECTOR_COUNT - 1)) { + intel_ntb_reg_write(1, + XEON_GEN3_REG_IMINTVEC00 + i, + XEON_GEN3_LINK_VECTOR_INDEX); + } + } + + intel_ntb_create_msix_vec(ntb, num_vectors); + rc = intel_ntb_setup_msix(ntb, num_vectors); + + /* enable all interrupts */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_DISABLE, 0ULL); + } else { + device_printf(ntb->device, "need to remap interrupts, giving up.\n"); + return (ENXIO); + } + + return (0); +} + +static int intel_ntb_init_isr(struct ntb_softc *ntb) { uint32_t desired_vectors, num_vectors; @@ -1098,7 +1219,7 @@ intel_ntb_init_isr(struct ntb_softc *ntb) } else num_vectors = 1; - if (ntb->type == NTB_XEON && num_vectors < ntb->db_vec_count) { + if (ntb->type == NTB_XEON_GEN1 && num_vectors < ntb->db_vec_count) { if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { device_printf(ntb->device, "Errata workaround does not support MSI or INTX\n"); @@ -1177,20 +1298,17 @@ intel_ntb_teardown_interrupts(struct ntb_softc *ntb) pci_release_msi(ntb->device); } -/* - * Doorbell register and mask are 64-bit on Atom, 16-bit on Xeon. Abstract it - * out to make code clearer. - */ static inline uint64_t db_ioread(struct ntb_softc *ntb, uint64_t regoff) { - if (ntb->type == NTB_ATOM) + switch (ntb->type) { + case NTB_ATOM: + case NTB_XEON_GEN3: return (intel_ntb_reg_read(8, regoff)); - - KASSERT(ntb->type == NTB_XEON, ("bad ntb type")); - - return (intel_ntb_reg_read(2, regoff)); + case NTB_XEON_GEN1: + return (intel_ntb_reg_read(2, regoff)); + } } static inline void @@ -1211,13 +1329,15 @@ static inline void db_iowrite_raw(struct ntb_softc *ntb, uint64_t regoff, uint64_t val) { - if (ntb->type == NTB_ATOM) { + switch (ntb->type) { + case NTB_ATOM: + case NTB_XEON_GEN3: intel_ntb_reg_write(8, regoff, val); - return; + break; + case NTB_XEON_GEN1: + intel_ntb_reg_write(2, regoff, (uint16_t)val); + break; } - - KASSERT(ntb->type == NTB_XEON, ("bad ntb type")); - intel_ntb_reg_write(2, regoff, (uint16_t)val); } static void @@ -1267,8 +1387,10 @@ intel_ntb_db_read(device_t dev) if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) return (ntb->fake_db); - - return (db_ioread(ntb, ntb->self_reg->db_bell)); + if (ntb->type == NTB_XEON_GEN3) + return (intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS)); + else + return (db_ioread(ntb, ntb->self_reg->db_bell)); } static void @@ -1288,7 +1410,11 @@ intel_ntb_db_clear(device_t dev, uint64_t bits) return; } - db_iowrite(ntb, ntb->self_reg->db_bell, bits); + if (ntb->type == NTB_XEON_GEN3) + intel_ntb_reg_write(4, XEON_GEN3_REG_IMINT_STATUS, + (uint32_t)bits); + else + db_iowrite(ntb, ntb->self_reg->db_bell, bits); } static inline uint64_t @@ -1322,9 +1448,14 @@ intel_ntb_interrupt(struct ntb_softc *ntb, uint32_t ve ntb->last_ts = ticks; vec_mask = intel_ntb_vec_mask(ntb, vec); + if (ntb->type == NTB_XEON_GEN3 && vec == XEON_GEN3_LINK_VECTOR_INDEX) + vec_mask |= ntb->db_link_mask; if ((vec_mask & ntb->db_link_mask) != 0) { if (intel_ntb_poll_link(ntb)) ntb_link_event(ntb->device); + if (ntb->type == NTB_XEON_GEN3) + intel_ntb_reg_write(8, XEON_GEN3_REG_IMINT_STATUS, + intel_ntb_reg_read(8, XEON_GEN3_REG_IMINT_STATUS)); } if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && @@ -1449,15 +1580,23 @@ static void intel_ntb_detect_max_mw(struct ntb_softc *ntb) { - if (ntb->type == NTB_ATOM) { + switch (ntb->type) { + case NTB_ATOM: ntb->mw_count = ATOM_MW_COUNT; - return; + break; + case NTB_XEON_GEN1: + if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) + ntb->mw_count = XEON_HSX_SPLIT_MW_COUNT; + else + ntb->mw_count = XEON_SNB_MW_COUNT; + break; + case NTB_XEON_GEN3: + if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) + ntb->mw_count = XEON_GEN3_SPLIT_MW_COUNT; + else + ntb->mw_count = XEON_GEN3_MW_COUNT; + break; } - - if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) - ntb->mw_count = XEON_HSX_SPLIT_MW_COUNT; - else - ntb->mw_count = XEON_SNB_MW_COUNT; } static int @@ -1534,6 +1673,54 @@ intel_ntb_detect_atom(struct ntb_softc *ntb) } static int +intel_ntb_detect_xeon_gen3(struct ntb_softc *ntb) +{ + uint8_t ppd, conn_type; + + ppd = pci_read_config(ntb->device, XEON_GEN3_INT_REG_PPD, 1); + ntb->ppd = ppd; + + /* check port definition */ + conn_type = XEON_GEN3_REG_PPD_PORT_DEF_F(ppd); + switch (conn_type) { + case NTB_CONN_B2B: + ntb->conn_type = conn_type; + break; + default: + device_printf(ntb->device, "Unsupported connection type: %u\n", + conn_type); + return (ENXIO); + } + + /* check cross link configuration status */ + if (XEON_GEN3_REG_PPD_CONF_STS_F(ppd)) { + /* NTB Port is configured as DSD/USP */ + ntb->dev_type = NTB_DEV_DSD; + } else { + /* NTB Port is configured as USD/DSP */ + ntb->dev_type = NTB_DEV_USD; + } + + if (XEON_GEN3_REG_PPD_ONE_MSIX_F(ppd)) { + /* + * This bit when set, causes only a single MSI-X message to be + * generated if MSI-X is enabled. + */ + ntb->features |= NTB_ONE_MSIX; + } + + if (XEON_GEN3_REG_PPD_BAR45_SPL_F(ppd)) { + /* BARs 4 and 5 are presented as two 32b non-prefetchable BARs */ + ntb->features |= NTB_SPLIT_BAR; + } + + device_printf(ntb->device, "conn type 0x%02x, dev type 0x%02x," + "features 0x%02x\n", ntb->conn_type, ntb->dev_type, ntb->features); + + return (0); +} + +static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb) { int rc; @@ -1618,6 +1805,42 @@ intel_ntb_xeon_init_dev(struct ntb_softc *ntb) } static int +intel_ntb_xeon_gen3_init_dev(struct ntb_softc *ntb) +{ + int rc; + + ntb->spad_count = XEON_GEN3_SPAD_COUNT; + ntb->db_count = XEON_GEN3_DB_COUNT; + ntb->db_link_mask = XEON_GEN3_DB_LINK_BIT; + ntb->db_vec_count = XEON_GEN3_DB_MSIX_VECTOR_COUNT; + ntb->db_vec_shift = XEON_GEN3_DB_MSIX_VECTOR_SHIFT; + + if (ntb->conn_type != NTB_CONN_B2B) { + device_printf(ntb->device, "Connection type %d not supported\n", + ntb->conn_type); + return (ENXIO); + } + + ntb->reg = &xeon_gen3_reg; + ntb->self_reg = &xeon_gen3_pri_reg; + ntb->peer_reg = &xeon_gen3_b2b_reg; + ntb->xlat_reg = &xeon_gen3_sec_xlat; + + ntb->db_valid_mask = (1ULL << ntb->db_count) - 1; + + xeon_gen3_setup_b2b_mw(ntb); + + /* Enable Bus Master and Memory Space on the External Side */ + intel_ntb_reg_write(2, XEON_GEN3_EXT_REG_PCI_CMD, + PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); + + /* Setup Interrupt */ + rc = intel_ntb_xeon_gen3_init_isr(ntb); + + return (rc); +} + +static int intel_ntb_atom_init_dev(struct ntb_softc *ntb) { int error; @@ -1908,6 +2131,50 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct return (0); } +static int +xeon_gen3_setup_b2b_mw(struct ntb_softc *ntb) +{ + uint64_t reg; + uint32_t embarsz, imbarsz; + + /* IMBAR1SZ should be equal to EMBAR1SZ */ + embarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_EMBAR1SZ, 1); + imbarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_IMBAR1SZ, 1); + if (embarsz != imbarsz) { + device_printf(ntb->device, + "IMBAR1SZ (%u) should be equal to EMBAR1SZ (%u)\n", + imbarsz, embarsz); + return (EIO); + } + + /* IMBAR2SZ should be equal to EMBAR2SZ */ + embarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_EMBAR2SZ, 1); + imbarsz = pci_read_config(ntb->device, XEON_GEN3_INT_REG_IMBAR2SZ, 1); + if (embarsz != imbarsz) { + device_printf(ntb->device, + "IMBAR2SZ (%u) should be equal to EMBAR2SZ (%u)\n", + imbarsz, embarsz); + return (EIO); + } + + /* Client will provide the incoming IMBAR1/2XBASE, zero it for now */ + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XBASE, 0); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XBASE, 0); + + /* + * If the value in EMBAR1LIMIT is set equal to the value in EMBAR1, + * the memory window for EMBAR1 is disabled. + * Note: It is needed to avoid malacious access. + */ + reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR1BASE, 8); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR1XLIMIT, reg); + + reg = pci_read_config(ntb->device, XEON_GEN3_EXT_REG_BAR2BASE, 8); + intel_ntb_reg_write(8, XEON_GEN3_REG_IMBAR2XLIMIT, reg); + + return (0); +} + static inline bool _xeon_link_is_up(struct ntb_softc *ntb) { @@ -1921,7 +2188,7 @@ static inline bool link_is_up(struct ntb_softc *ntb) { - if (ntb->type == NTB_XEON) + if (ntb->type == NTB_XEON_GEN1 || ntb->type == NTB_XEON_GEN3) return (_xeon_link_is_up(ntb) && (ntb->peer_msix_good || !HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP))); @@ -2185,7 +2452,9 @@ intel_ntb_poll_link(struct ntb_softc *ntb) ntb->ntb_ctl = ntb_cntl; ntb->lnk_sta = intel_ntb_reg_read(4, ntb->reg->lnk_sta); } else { - db_iowrite_raw(ntb, ntb->self_reg->db_bell, ntb->db_link_mask); + if (ntb->type == NTB_XEON_GEN1) + db_iowrite_raw(ntb, ntb->self_reg->db_bell, + ntb->db_link_mask); reg_val = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); if (reg_val == ntb->lnk_sta) @@ -2960,6 +3229,8 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus if (limit_reg != 0 && size != mw_size) limit = base + size; + else + limit = base + mw_size; /* Set and verify translation address */ intel_ntb_reg_write(8, xlat_reg, addr); @@ -2977,8 +3248,22 @@ intel_ntb_mw_set_trans(device_t dev, unsigned idx, bus intel_ntb_reg_write(8, xlat_reg, 0); return (EIO); } + + if (ntb->type == NTB_XEON_GEN3) { + limit = base + size; + + /* set EMBAR1/2XLIMIT */ + if (!idx) + intel_ntb_reg_write(8, + XEON_GEN3_REG_EMBAR1XLIMIT, limit); + else + intel_ntb_reg_write(8, + XEON_GEN3_REG_EMBAR2XLIMIT, limit); + } } else { /* Configure 32-bit (split) BAR MW */ + if (ntb->type == NTB_XEON_GEN3) + return (EIO); if ((addr & UINT32_MAX) != addr) return (ERANGE); @@ -3062,10 +3347,16 @@ intel_ntb_mw_set_wc_internal(struct ntb_softc *ntb, un } static void -intel_ntb_peer_db_set(device_t dev, uint64_t bit) +intel_ntb_peer_db_set(device_t dev, uint64_t bits) { struct ntb_softc *ntb = device_get_softc(dev); + uint64_t db; + if ((bits & ~ntb->db_valid_mask) != 0) { + device_printf(ntb->device, "Invalid doorbell bits %lx\n", bits); + return; + } + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { struct ntb_pci_bar_info *lapic; unsigned i; @@ -3073,7 +3364,7 @@ intel_ntb_peer_db_set(device_t dev, uint64_t bit) lapic = ntb->peer_lapic_bar; for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if ((bit & intel_ntb_db_vector_mask(dev, i)) != 0) + if ((bits & intel_ntb_db_vector_mask(dev, i)) != 0) bus_space_write_4(lapic->pci_bus_tag, lapic->pci_bus_handle, ntb->peer_msix_data[i].nmd_ofs, @@ -3083,11 +3374,22 @@ intel_ntb_peer_db_set(device_t dev, uint64_t bit) } if (HAS_FEATURE(ntb, NTB_SDOORBELL_LOCKUP)) { - intel_ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit); + intel_ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bits); return; } - db_iowrite(ntb, ntb->peer_reg->db_bell, bit); + if (ntb->type == NTB_XEON_GEN3) { + while (bits != 0) { + db = ffsll(bits); + + intel_ntb_reg_write(1, + ntb->peer_reg->db_bell + (db - 1) * 4, 0x1); + + bits = bits & (bits - 1); + } + } else { + db_iowrite(ntb, ntb->peer_reg->db_bell, bits); + } } static int Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Fri Oct 23 14:15:58 2020 (r366968) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.h Fri Oct 23 14:16:52 2020 (r366969) @@ -30,7 +30,26 @@ #ifndef _NTB_REGS_H_ #define _NTB_REGS_H_ +#include +#include +/*--------------------------------------------------------------------------- + * Macro: M*_M : Create a mask to isolate a bit field of a data word. + * M*_F : Extract value from a bit field of a data word. + * M*_I : Insert value into a bit field of a data word. + * + * Purpose: Bit field manipulation macros for mask, insert and extract for + * 8-bit, 16-bit, 32-bit and 64-bit data words. + * + * Params: [in] P = Bit position of start of the bit field (lsb is 0). + * [in] N = Size of the bit field in bits. + * [in] X = Value to insert or remove from the bit field. + *--------------------------------------------------------------------------- + */ +#define M8_M(P, N) ((UINT8_MAX >> (8 - (N))) << (P)) +#define M8_F(X, P, N) (((uint8_t)(X) & M8_M(P, N)) >> (P)) +#define M8_I(X, P, N) (((uint8_t)(X) << (P)) & M8_M(P, N)) + #define NTB_LINK_STATUS_ACTIVE 0x2000 #define NTB_LINK_SPEED_MASK 0x000f #define NTB_LINK_WIDTH_MASK 0x03f0 @@ -164,5 +183,73 @@ /* The peer ntb secondary config space is 32KB fixed size */ #define XEON_B2B_MIN_SIZE 0x8000 +#define XEON_GEN3_MW_COUNT 2 +#define XEON_GEN3_SPLIT_MW_COUNT 3 +#define XEON_GEN3_SPAD_COUNT 16 +#define XEON_GEN3_DB_COUNT 32 +#define XEON_GEN3_DB_LINK 32 +#define XEON_GEN3_DB_LINK_BIT (1ULL << XEON_GEN3_DB_LINK) +#define XEON_GEN3_DB_MSIX_VECTOR_COUNT 33 +#define XEON_GEN3_DB_MSIX_VECTOR_SHIFT 1 + +#define XEON_GEN3_LINK_VECTOR_INDEX 31 + +/* Xeon Skylake NTB register definitions */ + +/* + * Internal EndPoint Configuration Registers + */ +#define XEON_GEN3_INT_REG_BAR0BASE 0x10 +#define XEON_GEN3_INT_REG_BAR1BASE 0x18 +#define XEON_GEN3_INT_REG_BAR2BASE 0x20 +#define XEON_GEN3_INT_REG_IMBAR1SZ 0xd0 +#define XEON_GEN3_INT_REG_IMBAR2SZ 0xd1 +#define XEON_GEN3_INT_REG_EMBAR1SZ 0xd2 +#define XEON_GEN3_INT_REG_EMBAR2SZ 0xd3 +#define XEON_GEN3_INT_REG_PPD 0xd4 +#define XEON_GEN3_INT_LNK_STS_OFFSET 0x01a2 + +/* + * External EndPoint Configuration Registers + * These are located within BAR0 of the internal endpoint. + */ +#define XEON_GEN3_EXT_REG_PCI_CMD 0x4504 +#define XEON_GEN3_EXT_REG_BAR0BASE 0x4510 +#define XEON_GEN3_EXT_REG_BAR1BASE 0x4518 +#define XEON_GEN3_EXT_REG_BAR2BASE 0x4520 + +/* + * Internal Endpoint Memory Mapped Registers + */ +#define XEON_GEN3_REG_IMNTB_CTRL 0x0000 +#define XEON_GEN3_REG_IMBAR1XBASE 0x0010 +#define XEON_GEN3_REG_IMBAR1XLIMIT 0x0018 +#define XEON_GEN3_REG_IMBAR2XBASE 0x0020 +#define XEON_GEN3_REG_IMBAR2XLIMIT 0x0028 +#define XEON_GEN3_REG_IMINT_STATUS 0x0040 +#define XEON_GEN3_REG_IMINT_DISABLE 0x0048 +#define XEON_GEN3_REG_IMSPAD 0x0080 +#define XEON_GEN3_REG_IMINTVEC00 0x00d0 +#define XEON_GEN3_REG_IMDOORBELL 0x0100 +#define XEON_GEN3_REG_IMB2B_SSPAD 0x0180 /* Pseudo SP registers */ + +/* + * External Endpoint Memory Mapped Registers + */ +#define XEON_GEN3_REG_EMBAR0XBASE 0x4008 +#define XEON_GEN3_REG_EMBAR1XBASE 0x4010 +#define XEON_GEN3_REG_EMBAR1XLIMIT 0x4018 +#define XEON_GEN3_REG_EMBAR2XBASE 0x4020 +#define XEON_GEN3_REG_EMBAR2XLIMIT 0x4028 +#define XEON_GEN3_REG_EMINT_STATUS 0x4040 +#define XEON_GEN3_REG_EMINT_DISABLE 0x4048 +#define XEON_GEN3_REG_EMSPAD 0x4080 +#define XEON_GEN3_REG_EMDOORBELL 0x4100 + +/* XEON_GEN3_INT_REG_PPD: PPD register */ +#define XEON_GEN3_REG_PPD_PORT_DEF_F(X) M8_F(X, 0, 2) +#define XEON_GEN3_REG_PPD_CONF_STS_F(X) M8_F(X, 4, 1) +#define XEON_GEN3_REG_PPD_ONE_MSIX_F(X) M8_F(X, 5, 1) +#define XEON_GEN3_REG_PPD_BAR45_SPL_F(X) M8_F(X, 6, 1) #endif /* _NTB_REGS_H_ */ From owner-svn-src-all@freebsd.org Fri Oct 23 14:25:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23B36447B4C; Fri, 23 Oct 2020 14:25:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHmjn0655z4CBG; Fri, 23 Oct 2020 14:25: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6A618AC9; Fri, 23 Oct 2020 14:25:48 +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 09NEPmkV025146; Fri, 23 Oct 2020 14:25:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NEPmoT025145; Fri, 23 Oct 2020 14:25:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231425.09NEPmoT025145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 14:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366970 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 366970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 14:25:49 -0000 Author: markj Date: Fri Oct 23 14:25:48 2020 New Revision: 366970 URL: https://svnweb.freebsd.org/changeset/base/366970 Log: Add some missing nv(9) MLINKS MFC after: 1 week Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Oct 23 14:16:52 2020 (r366969) +++ head/share/man/man9/Makefile Fri Oct 23 14:25:48 2020 (r366970) @@ -1563,6 +1563,11 @@ MLINKS+=nv.9 libnv.9 \ nv.9 nvlist_add_stringf.9 \ nv.9 nvlist_add_stringv.9 \ nv.9 nvlist_add_string_array.9 \ + nv.9 nvlist_append_bool_array.9 \ + nv.9 nvlist_append_descriptor_array.9 \ + nv.9 nvlist_append_nvlist_array.9 \ + nv.9 nvlist_append_number_array.9 \ + nv.9 nvlist_append_string_array.9 \ nv.9 nvlist_clone.9 \ nv.9 nvlist_create.9 \ nv.9 nvlist_destroy.9 \ From owner-svn-src-all@freebsd.org Fri Oct 23 14:47:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91B07447FCF; Fri, 23 Oct 2020 14:47:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHnBs3C0wz4DCF; Fri, 23 Oct 2020 14:47:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DB088FBE; Fri, 23 Oct 2020 14:47:33 +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 09NElXcD037002; Fri, 23 Oct 2020 14:47:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NElW0q037000; Fri, 23 Oct 2020 14:47:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231447.09NElW0q037000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 14:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r366971 - stable/12/lib/libc/locale X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/locale X-SVN-Commit-Revision: 366971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 14:47:33 -0000 Author: markj Date: Fri Oct 23 14:47:32 2020 New Revision: 366971 URL: https://svnweb.freebsd.org/changeset/base/366971 Log: MFC r366375: newlocale(3): Fix a memory leak. PR: 249416 Modified: stable/12/lib/libc/locale/newlocale.3 stable/12/lib/libc/locale/xlocale.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/locale/newlocale.3 ============================================================================== --- stable/12/lib/libc/locale/newlocale.3 Fri Oct 23 14:25:48 2020 (r366970) +++ stable/12/lib/libc/locale/newlocale.3 Fri Oct 23 14:47:32 2020 (r366971) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17, 2011 +.Dd October 2, 2020 .Dt NEWLOCALE 3 .Os .Sh NAME @@ -46,7 +46,20 @@ defines the components that the new locale will have s name specified in the .Fa locale parameter. -Any other components will be inherited from +Any components not specified in +.Fa mask +will be inherited from the locale referenced by +.Fa base , +if +.Fa base +is not +.Dv NULL . +If the call is successful, the state of the locale referenced by +.Fa base +is unspecified, and it must not be accessed. +The special locale +.Dv LC_GLOBAL_LOCALE +may not be specified for .Fa base . The .Fa mask Modified: stable/12/lib/libc/locale/xlocale.c ============================================================================== --- stable/12/lib/libc/locale/xlocale.c Fri Oct 23 14:25:48 2020 (r366970) +++ stable/12/lib/libc/locale/xlocale.c Fri Oct 23 14:47:32 2020 (r366971) @@ -251,6 +251,7 @@ static int dupcomponent(int type, locale_t base, local locale_t newlocale(int mask, const char *locale, locale_t base) { + locale_t orig_base; int type; const char *realLocale = locale; int useenv = 0; @@ -263,6 +264,7 @@ locale_t newlocale(int mask, const char *locale, local return (NULL); } + orig_base = base; FIX_LOCALE(base); copyflags(new, base); @@ -297,6 +299,8 @@ locale_t newlocale(int mask, const char *locale, local if (0 == success) { xlocale_release(new); new = NULL; + } else if (base == orig_base) { + xlocale_release(base); } return (new); From owner-svn-src-all@freebsd.org Fri Oct 23 14:56:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CF274482BB; Fri, 23 Oct 2020 14:56:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHnNy1W7Cz4Djm; Fri, 23 Oct 2020 14:56:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12B8D938A; Fri, 23 Oct 2020 14:56:18 +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 09NEuHYZ043347; Fri, 23 Oct 2020 14:56:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NEuHZE043346; Fri, 23 Oct 2020 14:56:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231456.09NEuHZE043346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 14:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366972 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 366972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 14:56:18 -0000 Author: markj Date: Fri Oct 23 14:56:17 2020 New Revision: 366972 URL: https://svnweb.freebsd.org/changeset/base/366972 Log: rtsold: Remove an incorrect __unused annotation MFC after: 1 week Modified: head/usr.sbin/rtsold/cap_script.c Modified: head/usr.sbin/rtsold/cap_script.c ============================================================================== --- head/usr.sbin/rtsold/cap_script.c Fri Oct 23 14:47:32 2020 (r366971) +++ head/usr.sbin/rtsold/cap_script.c Fri Oct 23 14:56:17 2020 (r366972) @@ -207,7 +207,7 @@ script_command(const char *cmd, const nvlist_t *limits } static int -script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits) { const char *name; void *cookie; From owner-svn-src-all@freebsd.org Fri Oct 23 15:12:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0587B448930; Fri, 23 Oct 2020 15:12:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHnlB6R75z4FWR; Fri, 23 Oct 2020 15:12:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C01D0979B; Fri, 23 Oct 2020 15:12:06 +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 09NFC6tR055170; Fri, 23 Oct 2020 15:12:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NFC6GT055169; Fri, 23 Oct 2020 15:12:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010231512.09NFC6GT055169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Oct 2020 15:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366973 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 366973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 15:12:07 -0000 Author: markj Date: Fri Oct 23 15:12:06 2020 New Revision: 366973 URL: https://svnweb.freebsd.org/changeset/base/366973 Log: ntb: Fix the 32-bit build after r366969 Reported by: Jenkins MFC with: r366969 Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Oct 23 14:56:17 2020 (r366972) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Oct 23 15:12:06 2020 (r366973) @@ -3353,7 +3353,8 @@ intel_ntb_peer_db_set(device_t dev, uint64_t bits) uint64_t db; if ((bits & ~ntb->db_valid_mask) != 0) { - device_printf(ntb->device, "Invalid doorbell bits %lx\n", bits); + device_printf(ntb->device, "Invalid doorbell bits %#jx\n", + (uintmax_t)bits); return; } From owner-svn-src-all@freebsd.org Fri Oct 23 15:49:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 185944491F1; Fri, 23 Oct 2020 15:49:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHpZ66lW8z4HCh; Fri, 23 Oct 2020 15:49:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC0AB9D16; Fri, 23 Oct 2020 15:49:18 +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 09NFnIDP073711; Fri, 23 Oct 2020 15:49:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NFnIg4073710; Fri, 23 Oct 2020 15:49:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010231549.09NFnIg4073710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 23 Oct 2020 15:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366974 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 15:49:19 -0000 Author: mjg Date: Fri Oct 23 15:49:18 2020 New Revision: 366974 URL: https://svnweb.freebsd.org/changeset/base/366974 Log: vfs: stop taking the interlock in vnode reclaim It no longer protects any of tested fields, keeping all the checks racy. While here make vtryrecycle drop the vnode on its own. Avoids an additional lock trip. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Oct 23 15:12:06 2020 (r366973) +++ head/sys/kern/vfs_subr.c Fri Oct 23 15:49:18 2020 (r366974) @@ -1121,24 +1121,12 @@ restart: if (vp->v_type == VBAD || vp->v_type == VNON) goto next_iter; - if (!VI_TRYLOCK(vp)) - goto next_iter; - - if (vp->v_usecount > 0 || vp->v_holdcnt == 0 || - (!reclaim_nc_src && !LIST_EMPTY(&vp->v_cache_src)) || - VN_IS_DOOMED(vp) || vp->v_type == VNON) { - VI_UNLOCK(vp); - goto next_iter; - } - object = atomic_load_ptr(&vp->v_object); if (object == NULL || object->resident_page_count > trigger) { - VI_UNLOCK(vp); goto next_iter; } - vholdl(vp); - VI_UNLOCK(vp); + vhold(vp); TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); mtx_unlock(&vnode_list_mtx); @@ -1235,21 +1223,18 @@ restart: * blocking. */ if (vp->v_holdcnt > 0 || (mnt_op != NULL && (mp = vp->v_mount) != NULL && - mp->mnt_op != mnt_op) || !VI_TRYLOCK(vp)) { + mp->mnt_op != mnt_op)) { continue; } TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); if (__predict_false(vp->v_type == VBAD || vp->v_type == VNON)) { - VI_UNLOCK(vp); continue; } - vholdl(vp); + vhold(vp); count--; mtx_unlock(&vnode_list_mtx); - VI_UNLOCK(vp); vtryrecycle(vp); - vdrop(vp); mtx_lock(&vnode_list_mtx); goto restart; } @@ -1520,6 +1505,7 @@ vtryrecycle(struct vnode *vp) CTR2(KTR_VFS, "%s: impossible to recycle, vp %p lock is already held", __func__, vp); + vdrop(vp); return (EWOULDBLOCK); } /* @@ -1530,6 +1516,7 @@ vtryrecycle(struct vnode *vp) CTR2(KTR_VFS, "%s: impossible to recycle, cannot start the write for %p", __func__, vp); + vdrop(vp); return (EBUSY); } /* @@ -1541,7 +1528,7 @@ vtryrecycle(struct vnode *vp) VI_LOCK(vp); if (vp->v_usecount) { VOP_UNLOCK(vp); - VI_UNLOCK(vp); + vdropl(vp); vn_finished_write(vnmp); CTR2(KTR_VFS, "%s: impossible to recycle, %p is already referenced", @@ -1553,7 +1540,7 @@ vtryrecycle(struct vnode *vp) vgonel(vp); } VOP_UNLOCK(vp); - VI_UNLOCK(vp); + vdropl(vp); vn_finished_write(vnmp); return (0); } From owner-svn-src-all@freebsd.org Fri Oct 23 15:50:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B5B944943A; Fri, 23 Oct 2020 15:50:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHpbt1skjz4HPC; Fri, 23 Oct 2020 15:50:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23AE09D19; Fri, 23 Oct 2020 15:50:50 +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 09NFoool073861; Fri, 23 Oct 2020 15:50:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NFonDx073858; Fri, 23 Oct 2020 15:50:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010231550.09NFonDx073858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 23 Oct 2020 15:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366975 - in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/tmpfs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/tmpfs ufs/ufs X-SVN-Commit-Revision: 366975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 15:50:50 -0000 Author: mjg Date: Fri Oct 23 15:50:49 2020 New Revision: 366975 URL: https://svnweb.freebsd.org/changeset/base/366975 Log: vfs: drop spurious cache_purge on rmdir The removed directory gets cache_purged which is sufficient to remove any entries related to the parent. Note only tmpfs, ufs and zfs are patched. Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Fri Oct 23 15:49:18 2020 (r366974) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Fri Oct 23 15:50:49 2020 (r366975) @@ -2332,8 +2332,6 @@ zfs_rmdir_(vnode_t *dvp, vnode_t *vp, const char *name return (error); } - cache_purge(dvp); - error = zfs_link_destroy(dzp, name, zp, tx, ZEXISTS, NULL); if (error == 0) { Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Oct 23 15:49:18 2020 (r366974) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Oct 23 15:50:49 2020 (r366975) @@ -1331,7 +1331,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_UNLOCK(dnode); if (tmpfs_use_nc(dvp)) { - cache_purge(dvp); cache_purge(vp); } Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Oct 23 15:49:18 2020 (r366974) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Oct 23 15:50:49 2020 (r366975) @@ -2204,7 +2204,6 @@ ufs_rmdir(ap) softdep_revert_rmdir(dp, ip); goto out; } - cache_purge(dvp); /* * The only stuff left in the directory is "." and "..". The "." * reference is inconsequential since we are quashing it. The soft From owner-svn-src-all@freebsd.org Fri Oct 23 15:56:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A98054494BB; Fri, 23 Oct 2020 15:56:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHpkG43S4z4HSZ; Fri, 23 Oct 2020 15:56:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E9059E66; Fri, 23 Oct 2020 15:56:22 +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 09NFuMrD079617; Fri, 23 Oct 2020 15:56:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NFuMFb079616; Fri, 23 Oct 2020 15:56:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010231556.09NFuMFb079616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 23 Oct 2020 15:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366976 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 15:56:22 -0000 Author: mjg Date: Fri Oct 23 15:56:22 2020 New Revision: 366976 URL: https://svnweb.freebsd.org/changeset/base/366976 Log: cache: reduce memory waste in struct namecache The previous scheme for calculating the total size was doing sizeof on the struct and then adding the wanted space for the buffer. nc_name is at offset 58 while sizeof(struct namecache) is 64. With CACHE_PATH_CUTOFF of 39 bytes and 1 byte of padding we were allocating 104 bytes for the entry and never accounting for the 6 byte padding, wasting that space. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 23 15:50:49 2020 (r366975) +++ head/sys/kern/vfs_cache.c Fri Oct 23 15:56:22 2020 (r366976) @@ -162,6 +162,7 @@ struct namecache_ts { struct timespec nc_time; /* timespec provided by fs */ struct timespec nc_dotdottime; /* dotdot timespec provided by fs */ int nc_ticks; /* ticks value when entry was added */ + int nc_pad; struct namecache nc_nc; }; @@ -172,12 +173,19 @@ struct namecache_ts { * alignment for everyone. Note this is a nop for 64-bit platforms. */ #define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) -#define CACHE_PATH_CUTOFF 39 -#define CACHE_ZONE_SMALL_SIZE (sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1) -#define CACHE_ZONE_SMALL_TS_SIZE (sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1) -#define CACHE_ZONE_LARGE_SIZE (sizeof(struct namecache) + NAME_MAX + 1) -#define CACHE_ZONE_LARGE_TS_SIZE (sizeof(struct namecache_ts) + NAME_MAX + 1) +#ifdef __LP64__ +#define CACHE_PATH_CUTOFF 45 +#define CACHE_LARGE_PAD 6 +#else +#define CACHE_PATH_CUTOFF 41 +#define CACHE_LARGE_PAD 2 +#endif + +#define CACHE_ZONE_SMALL_SIZE (offsetof(struct namecache, nc_name) + CACHE_PATH_CUTOFF + 1) +#define CACHE_ZONE_SMALL_TS_SIZE (offsetof(struct namecache_ts, nc_nc) + CACHE_ZONE_SMALL_SIZE) +#define CACHE_ZONE_LARGE_SIZE (offsetof(struct namecache, nc_name) + NAME_MAX + 1 + CACHE_LARGE_PAD) +#define CACHE_ZONE_LARGE_TS_SIZE (offsetof(struct namecache_ts, nc_nc) + CACHE_ZONE_LARGE_SIZE) _Static_assert((CACHE_ZONE_SMALL_SIZE % (CACHE_ZONE_ALIGNMENT + 1)) == 0, "bad zone size"); _Static_assert((CACHE_ZONE_SMALL_TS_SIZE % (CACHE_ZONE_ALIGNMENT + 1)) == 0, "bad zone size"); From owner-svn-src-all@freebsd.org Fri Oct 23 16:11:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDB87449DA5 for ; Fri, 23 Oct 2020 16:11:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHq475VH0z4JXv for ; Fri, 23 Oct 2020 16:11:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f45.google.com with SMTP id k18so2272875wmj.5 for ; Fri, 23 Oct 2020 09:11:51 -0700 (PDT) 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=uB9o/6Oq8nwdZI/zKgtxz9enWKa50DwsmI7p7LF1tTM=; b=az/IWvyn/pR0nsGi8LCdrwdkXYYY8NSwa2NG/E19dIn9X/5HI5EI1cEuswqPeTRRYp jllP+qqKL6DuUp86H668rUB0DZLPPgwkh5XsazbDmkR3EKZbf4bDyFHaYsWZZmRe+Ym9 K9S8d1b8Y1nGgPT19cG5aZynyYYM6RULyyTFPw8qbreiLdlOq55axs0T1VJlmxLSu1Ui gYVrN3jfUFkuNbOqExcqhQHwEZbQtEHXoJfrmdC5+/+kTZbhr+vhZXXaYZ+HCjajL4gA gxYlC65OAqv95u9jX1JgUEUON0Rn7VcUy/lKEKi9Z27PjSwyZxnFMLnKIuCj8HHjaDSM QUjg== X-Gm-Message-State: AOAM533eo+cUcpTLNcngt+ty7qpb0ZqBliIkpmIKF4ra/5u7QsPBG1f4 xYj6hCkyzHEAQ84WpGTmaO/wCw== X-Google-Smtp-Source: ABdhPJxXtP0Xq6t+sLI58e9fSNPmECW9lRrd0wWpA+Gap4njExPLQH+PM/TiqoqC5yddQNGf0yE71A== X-Received: by 2002:a1c:7c1a:: with SMTP id x26mr3105822wmc.4.1603469509992; Fri, 23 Oct 2020 09:11:49 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id r128sm4389116wma.20.2020.10.23.09.11.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2020 09:11:49 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366976 - head/sys/kern From: Jessica Clarke In-Reply-To: <202010231556.09NFuMFb079616@repo.freebsd.org> Date: Fri, 23 Oct 2020 17:11:47 +0100 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202010231556.09NFuMFb079616@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CHq475VH0z4JXv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.14 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.67)[-0.668]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.004]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.97)[-0.967]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.45:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.45:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 16:11:53 -0000 On 23 Oct 2020, at 16:56, Mateusz Guzik wrote: >=20 > Author: mjg > Date: Fri Oct 23 15:56:22 2020 > New Revision: 366976 > URL: https://svnweb.freebsd.org/changeset/base/366976 >=20 > Log: > cache: reduce memory waste in struct namecache >=20 > The previous scheme for calculating the total size was doing sizeof > on the struct and then adding the wanted space for the buffer. >=20 > nc_name is at offset 58 while sizeof(struct namecache) is 64. > With CACHE_PATH_CUTOFF of 39 bytes and 1 byte of padding we were > allocating 104 bytes for the entry and never accounting for the 6 > byte padding, wasting that space. >=20 > Modified: > head/sys/kern/vfs_cache.c >=20 > Modified: head/sys/kern/vfs_cache.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/kern/vfs_cache.c Fri Oct 23 15:50:49 2020 = (r366975) > +++ head/sys/kern/vfs_cache.c Fri Oct 23 15:56:22 2020 = (r366976) > @@ -162,6 +162,7 @@ struct namecache_ts { > struct timespec nc_time; /* timespec provided by fs */ > struct timespec nc_dotdottime; /* dotdot timespec provided by = fs */ > int nc_ticks; /* ticks value when entry was = added */ > + int nc_pad; > struct namecache nc_nc; > }; >=20 > @@ -172,12 +173,19 @@ struct namecache_ts { > * alignment for everyone. Note this is a nop for 64-bit platforms. > */ > #define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) > -#define CACHE_PATH_CUTOFF 39 >=20 > -#define CACHE_ZONE_SMALL_SIZE (sizeof(struct = namecache) + CACHE_PATH_CUTOFF + 1) > -#define CACHE_ZONE_SMALL_TS_SIZE (sizeof(struct namecache_ts) + = CACHE_PATH_CUTOFF + 1) > -#define CACHE_ZONE_LARGE_SIZE (sizeof(struct = namecache) + NAME_MAX + 1) > -#define CACHE_ZONE_LARGE_TS_SIZE (sizeof(struct namecache_ts) + = NAME_MAX + 1) > +#ifdef __LP64__ > +#define CACHE_PATH_CUTOFF 45 > +#define CACHE_LARGE_PAD 6 > +#else > +#define CACHE_PATH_CUTOFF 41 > +#define CACHE_LARGE_PAD 2 > +#endif Is there any explanation of where these magic constants come from? There should at least be a comment IMO, of better yet have a C expression to evaluate them without needing #ifdef-based hard-coding (which then annoys things like CHERI that has 128-bit pointers in its pure capability kernel that causes us to have to go and reverse-engineer where these numbers came from so we can figure out what the right value should be for us). Jess From owner-svn-src-all@freebsd.org Fri Oct 23 16:35:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5CE344A8CC; Fri, 23 Oct 2020 16:35:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHqbK5CpTz4Ld3; Fri, 23 Oct 2020 16:35:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79041A4C6; Fri, 23 Oct 2020 16:35:25 +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 09NGZP24004818; Fri, 23 Oct 2020 16:35:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NGZNCN004809; Fri, 23 Oct 2020 16:35:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010231635.09NGZNCN004809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Oct 2020 16:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366977 - in head: contrib/elftoolchain/libelf lib/libelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/elftoolchain/libelf lib/libelf X-SVN-Commit-Revision: 366977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 16:35:25 -0000 Author: emaste Date: Fri Oct 23 16:35:23 2020 New Revision: 366977 URL: https://svnweb.freebsd.org/changeset/base/366977 Log: libelf: add compression header support GNU and Oracle libelf implementations added support for section compression, intended to reduce the size of DWARF debug info (which might be an order of magnitude larger than the code). There are two compressed ELF section formats: 1. Old GNU - sections are renmaed to start with 'z'. Section contains a magic number, uncompressed size, and compressed data. 2. Oracle and New GNU - compressed sections use the SHF_COMPRESSED flag. The compression header contains the compression type, uncompressed size, and uncompressed alignment. The second style is preferred and this change implements only that one. Submitted by: Tiger Gao Reviewed by: markj MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24566 Added: head/contrib/elftoolchain/libelf/gelf_chdr.c (contents, props changed) head/contrib/elftoolchain/libelf/gelf_getchdr.3 (contents, props changed) head/contrib/elftoolchain/libelf/libelf_chdr.c (contents, props changed) Modified: head/contrib/elftoolchain/libelf/Version.map head/contrib/elftoolchain/libelf/_libelf.h head/contrib/elftoolchain/libelf/gelf.3 head/contrib/elftoolchain/libelf/gelf.h head/contrib/elftoolchain/libelf/libelf.h head/lib/libelf/Makefile Modified: head/contrib/elftoolchain/libelf/Version.map ============================================================================== --- head/contrib/elftoolchain/libelf/Version.map Fri Oct 23 15:56:22 2020 (r366976) +++ head/contrib/elftoolchain/libelf/Version.map Fri Oct 23 16:35:23 2020 (r366977) @@ -91,6 +91,13 @@ global: gelf_update_symshndx; gelf_xlatetof; gelf_xlatetom; +}; + +R1.1 { +global: + elf32_getchdr; + elf64_getchdr; + gelf_getchdr; local: *; -}; +} R1.0; Modified: head/contrib/elftoolchain/libelf/_libelf.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf.h Fri Oct 23 15:56:22 2020 (r366976) +++ head/contrib/elftoolchain/libelf/_libelf.h Fri Oct 23 16:35:23 2020 (r366977) @@ -220,6 +220,7 @@ size_t _libelf_fsize(Elf_Type _t, int _elfclass, unsig size_t count); _libelf_translator_function *_libelf_get_translator(Elf_Type _t, int _direction, int _elfclass, int _elfmachine); +void *_libelf_getchdr(Elf_Scn *_e, int _elfclass); void *_libelf_getphdr(Elf *_e, int _elfclass); void *_libelf_getshdr(Elf_Scn *_scn, int _elfclass); void _libelf_init_elf(Elf *_e, Elf_Kind _kind); Modified: head/contrib/elftoolchain/libelf/gelf.3 ============================================================================== --- head/contrib/elftoolchain/libelf/gelf.3 Fri Oct 23 15:56:22 2020 (r366976) +++ head/contrib/elftoolchain/libelf/gelf.3 Fri Oct 23 16:35:23 2020 (r366977) @@ -23,7 +23,7 @@ .\" .\" $Id: gelf.3 3743 2019-06-12 19:36:30Z jkoshy $ .\" -.Dd June 12, 2019 +.Dd October 23, 2020 .Dt GELF 3 .Os .Sh NAME @@ -45,6 +45,8 @@ The GElf API defines the following class-independent d .Bl -tag -width GElf_Sxword .It Vt GElf_Addr A representation of ELF addresses. +.It Vt GElf_Chdr +A class-independent representation of an ELF Compression Header. .It Vt GElf_Dyn A class-independent representation of ELF .Sy .dynamic @@ -144,6 +146,8 @@ native representation. .El .It "Retrieving ELF Data" .Bl -tag -compact -width indent +.It Fn gelf_getchdr +Retrieve an ELF Compression Header from the underlying ELF descriptor. .It Fn gelf_getdyn Retrieve an ELF .Sy .dynamic Modified: head/contrib/elftoolchain/libelf/gelf.h ============================================================================== --- head/contrib/elftoolchain/libelf/gelf.h Fri Oct 23 15:56:22 2020 (r366976) +++ head/contrib/elftoolchain/libelf/gelf.h Fri Oct 23 16:35:23 2020 (r366977) @@ -39,6 +39,7 @@ typedef Elf64_Sxword GElf_Sxword; /* Signed long words typedef Elf64_Word GElf_Word; /* Unsigned words (32 bit) */ typedef Elf64_Xword GElf_Xword; /* Unsigned long words (64 bit) */ +typedef Elf64_Chdr GElf_Chdr; /* Compressed section header */ typedef Elf64_Dyn GElf_Dyn; /* ".dynamic" section entries */ typedef Elf64_Ehdr GElf_Ehdr; /* ELF header */ typedef Elf64_Phdr GElf_Phdr; /* Program header */ @@ -73,6 +74,7 @@ extern "C" { long gelf_checksum(Elf *_elf); size_t gelf_fsize(Elf *_elf, Elf_Type _type, size_t _count, unsigned int _version); +GElf_Chdr *gelf_getchdr(Elf_Scn *_scn, GElf_Chdr *_dst); int gelf_getclass(Elf *_elf); GElf_Dyn *gelf_getdyn(Elf_Data *_data, int _index, GElf_Dyn *_dst); GElf_Ehdr *gelf_getehdr(Elf *_elf, GElf_Ehdr *_dst); Added: head/contrib/elftoolchain/libelf/gelf_chdr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelf/gelf_chdr.c Fri Oct 23 16:35:23 2020 (r366977) @@ -0,0 +1,82 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Tiger Gao under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 +#include +#include +#include +#include + +#include "_libelf.h" + +Elf32_Chdr * +elf32_getchdr(Elf_Scn *s) +{ + return (_libelf_getchdr(s, ELFCLASS32)); +} + +Elf64_Chdr * +elf64_getchdr(Elf_Scn *s) +{ + return (_libelf_getchdr(s, ELFCLASS64)); +} + +GElf_Chdr * +gelf_getchdr(Elf_Scn *s, GElf_Chdr *d) +{ + int ec; + void *ch; + Elf32_Chdr *ch32; + Elf64_Chdr *ch64; + + if (d == NULL) { + LIBELF_SET_ERROR(ARGUMENT, 0); + return (NULL); + } + + if ((ch = _libelf_getchdr(s, ELFCLASSNONE)) == NULL) + return (NULL); + + ec = s->s_elf->e_class; + assert(ec == ELFCLASS32 || ec == ELFCLASS64); + + if (ec == ELFCLASS32) { + ch32 = (Elf32_Chdr *)ch; + + d->ch_type = (Elf64_Word)ch32->ch_type; + d->ch_size = (Elf64_Xword)ch32->ch_size; + d->ch_addralign = (Elf64_Xword)ch32->ch_addralign; + } else { + ch64 = (Elf64_Chdr *)ch; + *d = *ch64; + } + + return (d); +} Added: head/contrib/elftoolchain/libelf/gelf_getchdr.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelf/gelf_getchdr.3 Fri Oct 23 16:35:23 2020 (r366977) @@ -0,0 +1,117 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2020 The FreeBSD Foundation +.\" +.\" This document was written by Tiger Gao under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are +.\" met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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. +.\" +.\" $Id: gelf_getchdr.3 3639 2020-10-20 16:07:02Z tig $ +.\" +.Dd October 23, 2020 +.Dt GELF_GETCHDR 3 +.Os +.Sh NAME +.Nm elf32_getchdr , +.Nm elf64_getchdr , +.Nm gelf_getchdr +.Nd retrieve the compression header of a section +.Sh LIBRARY +.Lb libelf +.Sh SYNOPSIS +.In libelf.h +.Ft "Elf32_Chdr *" +.Fn elf32_getchdr "Elf_Scn *s" +.Ft "Elf64_Chdr *" +.Fn elf64_getchdr "Elf_Scn *s" +.In gelf.h +.Ft "GElf_Chdr *" +.Fn gelf_getchdr "Elf_Scn *scn" "GElf_Chdr *chdr" +.Sh DESCRIPTION +These functions return a pointer to the ELF Compression Header data +structure associated with section descriptor +.Ar scn . +.Pp +Function +.Fn elf32_getchdr +retrieves a pointer to an +.Vt Elf32_Chdr +structure. +Section descriptor +.Ar scn +must be associated with an ELF descriptor of class +.Dv ELFCLASS32 . +.Pp +Function +.Fn elf64_getchdr +retrieves a pointer to an +.Vt Elf64_Chdr +structure. +Section descriptor +.Ar scn +must be associated with an ELF descriptor of class +.Dv ELFCLASS64 . +.Pp +Function +.Fn gelf_getchdr +copies the values in the compression header associated with argument +.Ar scn +to the structure pointed to be argument +.Ar dst . +The +.Vt GElf_Chdr +data structure is described in +.Xr gelf 3 . +.Sh RETURN VALUES +Functions +.Fn elf32_getchdr +and +.Fn elf64_getchdr +return a valid pointer to the appropriate compression header on success +or NULL if an error was encountered. +.Pp +Function +.Fn gelf_getchdr +returns argument +.Ar dst +if successful, or NULL if an error was encountered. +.Sh ERRORS +These functions may fail with the following errors: +.Bl -tag -width "[ELF_E_RESOURCE]" +.It Bq Er ELF_E_INVALID_SECTION_FLAGS +Arguments +.Ar scn +has invalid flags. +.It Bq Er ELF_E_INVALID_SECTION_TYPE +Argument +.Ar scn +has invalid type. +.It Bq Er ELF_E_NOT_COMPRESSED +Argument +.Ar scn +is not compressed. +.El +.Sh SEE ALSO +.Xr elf 3 , +.Xr elf_getscn 3 , +.Xr gelf 3 , Modified: head/contrib/elftoolchain/libelf/libelf.h ============================================================================== --- head/contrib/elftoolchain/libelf/libelf.h Fri Oct 23 15:56:22 2020 (r366976) +++ head/contrib/elftoolchain/libelf/libelf.h Fri Oct 23 16:35:23 2020 (r366977) @@ -162,6 +162,9 @@ enum Elf_Error { ELF_E_SEQUENCE, /* API calls out of sequence */ ELF_E_UNIMPL, /* Feature is unimplemented */ ELF_E_VERSION, /* Unknown API version */ + ELF_E_INVALID_SECTION_FLAGS, /* Invalid ELF section header flags */ + ELF_E_INVALID_SECTION_TYPE, /* Invalid ELF section header type */ + ELF_E_NOT_COMPRESSED, /* Section is not compressed */ ELF_E_NUM /* Max error number */ }; @@ -227,6 +230,7 @@ unsigned int elf_version(unsigned int _version); long elf32_checksum(Elf *_elf); size_t elf32_fsize(Elf_Type _type, size_t _count, unsigned int _version); +Elf32_Chdr *elf32_getchdr(Elf_Scn *_scn); Elf32_Ehdr *elf32_getehdr(Elf *_elf); Elf32_Phdr *elf32_getphdr(Elf *_elf); Elf32_Shdr *elf32_getshdr(Elf_Scn *_scn); @@ -240,6 +244,7 @@ Elf_Data *elf32_xlatetom(Elf_Data *_dst, const Elf_Dat long elf64_checksum(Elf *_elf); size_t elf64_fsize(Elf_Type _type, size_t _count, unsigned int _version); +Elf64_Chdr *elf64_getchdr(Elf_Scn *_scn); Elf64_Ehdr *elf64_getehdr(Elf *_elf); Elf64_Phdr *elf64_getphdr(Elf *_elf); Elf64_Shdr *elf64_getshdr(Elf_Scn *_scn); Added: head/contrib/elftoolchain/libelf/libelf_chdr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/libelf/libelf_chdr.c Fri Oct 23 16:35:23 2020 (r366977) @@ -0,0 +1,104 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Tiger Gao under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 +#include + +#include "_libelf.h" + +void * +_libelf_getchdr(Elf_Scn *s, int ec) +{ + Elf *e; + void *sh; + Elf32_Shdr *sh32; + Elf64_Shdr *sh64; + + sh32 = NULL; + sh64 = NULL; + + if (s == NULL || (e = s->s_elf) == NULL || e->e_kind != ELF_K_ELF) { + LIBELF_SET_ERROR(ARGUMENT, 0); + return (NULL); + } + + if (ec == ELFCLASSNONE) { + ec = e->e_class; + } else if (ec != e->e_class) { + LIBELF_SET_ERROR(CLASS, 0); + return (NULL); + } + + if ((sh = _libelf_getshdr(s, ec)) == NULL) { + LIBELF_SET_ERROR(HEADER, 0); + return (NULL); + } + + if (ec == ELFCLASS32) { + sh32 = (Elf32_Shdr *)sh; + if ((sh32->sh_flags & SHF_ALLOC) != 0) { + LIBELF_SET_ERROR(INVALID_SECTION_FLAGS, 0); + return (NULL); + } + + if (sh32->sh_type == SHT_NULL || sh32->sh_type == SHT_NOBITS) { + LIBELF_SET_ERROR(INVALID_SECTION_TYPE, 0); + return (NULL); + } + + if ((sh32->sh_flags & SHF_COMPRESSED) == 0) { + LIBELF_SET_ERROR(NOT_COMPRESSED, 0); + return (NULL); + } + } else { + sh64 = (Elf64_Shdr *)sh; + if ((sh64->sh_flags & SHF_ALLOC) != 0) { + LIBELF_SET_ERROR(INVALID_SECTION_FLAGS, 0); + return (NULL); + } + + if (sh64->sh_type == SHT_NULL || sh64->sh_type == SHT_NOBITS) { + LIBELF_SET_ERROR(INVALID_SECTION_TYPE, 0); + return (NULL); + } + + if ((sh64->sh_flags & SHF_COMPRESSED) == 0) { + LIBELF_SET_ERROR(NOT_COMPRESSED, 0); + return (NULL); + } + } + + Elf_Data *d = elf_getdata(s, NULL); + + if (!d) + return (NULL); + + return ((void *)d->d_buf); +} Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Fri Oct 23 15:56:22 2020 (r366976) +++ head/lib/libelf/Makefile Fri Oct 23 16:35:23 2020 (r366977) @@ -38,6 +38,7 @@ SRCS= elf.c \ elf_update.c \ elf_version.c \ gelf_cap.c \ + gelf_chdr.c \ gelf_checksum.c \ gelf_dyn.c \ gelf_ehdr.c \ @@ -57,6 +58,7 @@ SRCS= elf.c \ libelf_allocate.c \ libelf_ar.c \ libelf_ar_util.c \ + libelf_chdr.c \ libelf_checksum.c \ libelf_data.c \ libelf_ehdr.c \ From owner-svn-src-all@freebsd.org Fri Oct 23 18:18:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA81044C961; Fri, 23 Oct 2020 18:18:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHstY50spz4S5V; Fri, 23 Oct 2020 18:18: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 753F3B8A5; Fri, 23 Oct 2020 18:18: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 09NIIjc5067669; Fri, 23 Oct 2020 18:18:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NIIj5x067668; Fri, 23 Oct 2020 18:18:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010231818.09NIIj5x067668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Oct 2020 18:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366978 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 366978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 18:18:45 -0000 Author: kib Date: Fri Oct 23 18:18:45 2020 New Revision: 366978 URL: https://svnweb.freebsd.org/changeset/base/366978 Log: xhci: Handle the case when MSI-X BAR is the same as IO BAR. PCIe allows for MSI-X BAR to be either dedicated, or MSI-X Table may be co-located in some functional BAR. In the later case xhci(4) is unable to allocate active resource for the table because BAR is already activated. Handle it by checking for this special case, and not try to alloc resource if MSI-X BAR is IO. Reported and tested by: emaste Reviewed by: emaste, hselasky Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D26913 Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Fri Oct 23 16:35:23 2020 (r366977) +++ head/sys/dev/usb/controller/xhci_pci.c Fri Oct 23 18:18:45 2020 (r366978) @@ -277,21 +277,29 @@ xhci_pci_attach(device_t self) rid = 0; if (xhci_use_msix && (msix_table = pci_msix_table_bar(self)) >= 0) { - sc->sc_msix_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, - &msix_table, RF_ACTIVE); - if (sc->sc_msix_res == NULL) { - /* May not be enabled */ - device_printf(self, - "Unable to map MSI-X table \n"); + if (msix_table == PCI_XHCI_CBMEM) { + sc->sc_msix_res = sc->sc_io_res; } else { + sc->sc_msix_res = bus_alloc_resource_any(self, + SYS_RES_MEMORY, &msix_table, RF_ACTIVE); + if (sc->sc_msix_res == NULL) { + /* May not be enabled */ + device_printf(self, + "Unable to map MSI-X table\n"); + } + } + if (sc->sc_msix_res != NULL) { count = 1; if (pci_alloc_msix(self, &count) == 0) { if (bootverbose) device_printf(self, "MSI-X enabled\n"); rid = 1; } else { - bus_release_resource(self, SYS_RES_MEMORY, - msix_table, sc->sc_msix_res); + if (sc->sc_msix_res != sc->sc_io_res) { + bus_release_resource(self, + SYS_RES_MEMORY, + msix_table, sc->sc_msix_res); + } sc->sc_msix_res = NULL; } } @@ -387,15 +395,15 @@ xhci_pci_detach(device_t self) sc->sc_irq_res = NULL; pci_release_msi(self); } + if (sc->sc_msix_res != NULL && sc->sc_msix_res != sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, + rman_get_rid(sc->sc_msix_res), sc->sc_msix_res); + sc->sc_msix_res = NULL; + } if (sc->sc_io_res) { bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); sc->sc_io_res = NULL; - } - if (sc->sc_msix_res) { - bus_release_resource(self, SYS_RES_MEMORY, - rman_get_rid(sc->sc_msix_res), sc->sc_msix_res); - sc->sc_msix_res = NULL; } xhci_uninit(sc); From owner-svn-src-all@freebsd.org Fri Oct 23 21:27:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1D6044F363; Fri, 23 Oct 2020 21:27:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHy4j50v0z4cbn; Fri, 23 Oct 2020 21:27:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB3FDE06; Fri, 23 Oct 2020 21:27:49 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NLRnT1095430; Fri, 23 Oct 2020 21:27:49 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NLRmFu095427; Fri, 23 Oct 2020 21:27:48 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010232127.09NLRmFu095427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 23 Oct 2020 21:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366980 - in head/sys: dev/ahci kern x86/x86 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/ahci kern x86/x86 X-SVN-Commit-Revision: 366980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 21:27:49 -0000 Author: br Date: Fri Oct 23 21:27:48 2020 New Revision: 366980 URL: https://svnweb.freebsd.org/changeset/base/366980 Log: Move the iommu stubs to a generic place, so they are available on all the platforms. This allows to not depend on the IOMMU macro in AHCI driver. Requested by: kib Suggested by: andrew Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26887 Modified: head/sys/dev/ahci/ahci_pci.c head/sys/kern/subr_bus_dma.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Fri Oct 23 18:29:36 2020 (r366979) +++ head/sys/dev/ahci/ahci_pci.c Fri Oct 23 21:27:48 2020 (r366980) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_iommu.h" - #include #include #include @@ -501,7 +499,6 @@ ahci_pci_attach(device_t dev) i++; ctlr->quirks = ahci_ids[i].quirks; -#ifdef IOMMU if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { /* * The controller issues DMA requests from PCI function 1, @@ -510,7 +507,6 @@ ahci_pci_attach(device_t dev) */ bus_dma_iommu_set_buswide(dev); } -#endif /* Limit speed for my onboard JMicron external port. * It is not eSATA really, limit to SATA 1 */ Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Fri Oct 23 18:29:36 2020 (r366979) +++ head/sys/kern/subr_bus_dma.c Fri Oct 23 21:27:48 2020 (r366980) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bus.h" +#include "opt_iommu.h" #include #include @@ -785,3 +786,21 @@ bus_dma_template_fill(bus_dma_template_t *t, bus_dma_p return; } +#ifndef IOMMU +bool bus_dma_iommu_set_buswide(device_t dev); +int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags); + +bool +bus_dma_iommu_set_buswide(device_t dev) +{ + return (false); +} + +int +bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags) +{ + return (0); +} +#endif Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Fri Oct 23 18:29:36 2020 (r366979) +++ head/sys/x86/x86/busdma_machdep.c Fri Oct 23 21:27:48 2020 (r366980) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" -#include "opt_iommu.h" #include #include @@ -268,22 +267,3 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) tc = (struct bus_dma_tag_common *)dmat; return (tc->impl->tag_destroy(dmat)); } - -#ifndef IOMMU -bool bus_dma_iommu_set_buswide(device_t dev); -int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_paddr_t start, vm_size_t length, int flags); - -bool -bus_dma_iommu_set_buswide(device_t dev) -{ - return (false); -} - -int -bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_paddr_t start, vm_size_t length, int flags) -{ - return (0); -} -#endif From owner-svn-src-all@freebsd.org Fri Oct 23 22:27:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64F2C4285BA; Fri, 23 Oct 2020 22:27:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHzPt1yG5z4fvf; Fri, 23 Oct 2020 22:27:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27BE8E980; Fri, 23 Oct 2020 22:27:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NMRkMf032298; Fri, 23 Oct 2020 22:27:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NMRkEO032297; Fri, 23 Oct 2020 22:27:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010232227.09NMRkEO032297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 23 Oct 2020 22:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366981 - head/lib/libc/tests/ssp X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/tests/ssp X-SVN-Commit-Revision: 366981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 22:27:46 -0000 Author: brooks Date: Fri Oct 23 22:27:45 2020 New Revision: 366981 URL: https://svnweb.freebsd.org/changeset/base/366981 Log: Only use ASAN when using the in-tree compiler When building FreeBSD 11 on a FreeBSD 12 system with CROSS_TOOLCHAIN=llvm10 we end up trying to link against the packaged version of the sanitizer library. This resulted in a requirement for getentropy(3) which is not present in FreeBSD 11. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26903 Modified: head/lib/libc/tests/ssp/Makefile Modified: head/lib/libc/tests/ssp/Makefile ============================================================================== --- head/lib/libc/tests/ssp/Makefile Fri Oct 23 21:27:48 2020 (r366980) +++ head/lib/libc/tests/ssp/Makefile Fri Oct 23 22:27:45 2020 (r366981) @@ -6,7 +6,9 @@ NO_WERROR= WARNS?= 2 CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector -.if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" +# Only use -fsanitize=bounds when using the in-tree compiler. Otherwise +# we may link to a sanitizer library targeted at a newer kernel/libc. CFLAGS.h_raw+= -fsanitize=bounds .elif ${COMPILER_TYPE} == "gcc" CFLAGS.h_raw+= --param ssp-buffer-size=1 From owner-svn-src-all@freebsd.org Fri Oct 23 23:56:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7972C42987D; Fri, 23 Oct 2020 23:56:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ1Mj2HQ2z3VBC; Fri, 23 Oct 2020 23:56:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31A08F88C; Fri, 23 Oct 2020 23:56:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09NNu0NU087336; Fri, 23 Oct 2020 23:56:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09NNu0Iw087335; Fri, 23 Oct 2020 23:56:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010232356.09NNu0Iw087335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 23 Oct 2020 23:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366982 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 366982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 23:56:01 -0000 Author: imp Date: Fri Oct 23 23:56:00 2020 New Revision: 366982 URL: https://svnweb.freebsd.org/changeset/base/366982 Log: warnx: Save errno across calls that might change it. When warn() family of functions is being used after err_set_file() has been set to, for example, /dev/null, errno is being clobbered, rendering it unreliable after, for example, procstat_getpathname() when it is supposed to emit a warning. Then the errno is changed to Inappropriate ioctl for device, destroying the original value (via calls to fprintf()functions). Submitted by: Juraj Lutter Differential Revision: https://reviews.freebsd.org/D26871 Modified: head/lib/libc/gen/err.c Modified: head/lib/libc/gen/err.c ============================================================================== --- head/lib/libc/gen/err.c Fri Oct 23 22:27:45 2020 (r366981) +++ head/lib/libc/gen/err.c Fri Oct 23 23:56:00 2020 (r366982) @@ -161,6 +161,9 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) { + static int saved_errno; + + saved_errno = errno; if (err_file == NULL) err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); @@ -169,6 +172,7 @@ vwarnc(int code, const char *fmt, va_list ap) fprintf(err_file, ": "); } fprintf(err_file, "%s\n", strerror(code)); + errno = saved_errno; } void @@ -183,10 +187,14 @@ warnx(const char *fmt, ...) void vwarnx(const char *fmt, va_list ap) { + static int saved_errno; + + saved_errno = errno; if (err_file == NULL) err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); fprintf(err_file, "\n"); + errno = saved_errno; } From owner-svn-src-all@freebsd.org Sat Oct 24 00:03:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC5A9429AA4; Sat, 24 Oct 2020 00:03:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ1Wz4Xysz3Vfb; Sat, 24 Oct 2020 00:03:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F60CF554; Sat, 24 Oct 2020 00:03:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09O03BTt093196; Sat, 24 Oct 2020 00:03:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O03BK9093195; Sat, 24 Oct 2020 00:03:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010240003.09O03BK9093195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 00:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366983 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 366983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 00:03:11 -0000 Author: imp Date: Sat Oct 24 00:03:11 2020 New Revision: 366983 URL: https://svnweb.freebsd.org/changeset/base/366983 Log: warnx: fix needless static I noticed after the review that these shouldn't be static. Remove the 'static' from them, otherwise concurrent calls to warn* might see a similar but to the original. Modified: head/lib/libc/gen/err.c Modified: head/lib/libc/gen/err.c ============================================================================== --- head/lib/libc/gen/err.c Fri Oct 23 23:56:00 2020 (r366982) +++ head/lib/libc/gen/err.c Sat Oct 24 00:03:11 2020 (r366983) @@ -161,7 +161,7 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) { - static int saved_errno; + int saved_errno; saved_errno = errno; if (err_file == NULL) @@ -187,7 +187,7 @@ warnx(const char *fmt, ...) void vwarnx(const char *fmt, va_list ap) { - static int saved_errno; + int saved_errno; saved_errno = errno; if (err_file == NULL) From owner-svn-src-all@freebsd.org Sat Oct 24 00:13:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88F9642A469 for ; Sat, 24 Oct 2020 00:13:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ1ls3JGbz3VwS for ; Sat, 24 Oct 2020 00:13:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x734.google.com with SMTP id 188so3160077qkk.12 for ; Fri, 23 Oct 2020 17:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lM6tUyN3Mx+kHaxoJGq8B0DEQO+0VTE8xXxvh3gTATA=; b=Nhcgke35u1/TzP2zj9ReU36OwqyTBE67Sv9eadVwJ7kpIsO175LAyZzM2ec4gKzXhH A75ZQF2SufiYE8OMZgnOYX4SJXZPN6NpSkVijpQoECkMujBCIpnBaZa4UBuRVaRD+7R3 XzgSYU6QsEP/KyxJ+XVMTs7+X+MR/r0hcMjl6ckyE2at/lyULug5UqTMDMbRLnCgn7W7 BMH5Z89ZoRzIuJcfF0vPcI822UvKmXbyqjzQxyKF0UDD/ZGOuAAiC6wzLmjCBgbz8DsF qtVia4rudvCOe0OyqOq00oB7duBmNh/EZW1ufN8BG5UND6CaIkjplhwDrtZjRG0FepQp S3jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lM6tUyN3Mx+kHaxoJGq8B0DEQO+0VTE8xXxvh3gTATA=; b=dKf4PmDc7sV5nrV+9010BpEDCBdoMapuOrAWLx3s4Z7zYxPkuosjHP9ZUW+L0VAmn4 94/T+GFI3I0EMG+SHsH/ZVuItqZB6x7ImJf88+HZIos2KRqP4fL/+QAZXyIYH2RLZnM6 j4C2ndRUGkFXt5+D/CenzOxsT0X9dG9u5zUwPNL95vcVL2Lg00Qsu2i+3ybrTCcoJ4zs zU8PX519lRe8upJKUYCUjIJR2EwcuVoHTOCixxTVGn3wUwchUAsUn/RiLbo5AOkNA3se 1SqnVukNIf+aej/nZ8ASkLiV5G2GruDA+SDnGAAulmCQ0Oq1jn/IgjZViOZpgaPYgogy zCQg== X-Gm-Message-State: AOAM532SxkI/aTTSSGDNjzk7vd7jfc9sz+68RmGEeBxflRJSNNCfABIs T2K0BpCBqf5WqkcSnYkbNL1giRzrNCGXdf9xoZ9FJQ== X-Google-Smtp-Source: ABdhPJxetQP4RukmlrkxbDokpi28VbIbRn35ylpb5nP1GkLJORzm3BMgbWOYtfDFXF/yoEyuJvS8r3tOm2SPKOomA3k= X-Received: by 2002:a37:5ca:: with SMTP id 193mr5039696qkf.44.1603498408391; Fri, 23 Oct 2020 17:13:28 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: From: Warner Losh Date: Fri, 23 Oct 2020 18:13:17 -0600 Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Kyle Evans Cc: Niclas Zeising , "Alexander V. Chernikov" , Hans Petter Selasky , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CJ1ls3JGbz3VwS X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Nhcgke35; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::734) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.98 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.990]; NEURAL_HAM_LONG(-0.96)[-0.964]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.02)[-1.024]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::734:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 00:13:30 -0000 I was going to suggest and try this change, but life has been complicated... Has it been committed? Warner On Thu, Oct 22, 2020, 1:43 PM Kyle Evans wrote: > On Thu, Oct 22, 2020 at 2:35 PM Niclas Zeising > wrote: > > > > On 2020-10-22 15:22, Kyle Evans wrote: > > > On Sat, Oct 17, 2020 at 11:40 AM Warner Losh wrote: > > >> > > >> > > >> > > >> On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov < > melifaro@ipfw.ru> wrote: > > >>> > > >>> 17.10.2020, 14:07, "Hans Petter Selasky" : > > >>> > > >>> On 2020-10-17 14:34, Alexander V. Chernikov wrote: > > >>> > > >>> 17.10.2020, 12:32, "Hans Petter Selasky" : > > >>> > > >>> On 2020-10-17 13:27, Alexander V. Chernikov wrote: > > >>> > > >>> 02.10.2020, 19:26, "Emmanuel Vadot" > >>> >: > > >>> > > >>> Author: manu > > >>> Date: Fri Oct 2 18:26:41 2020 > > >>> New Revision: 366372 > > >>> URL: > https://svnweb.freebsd.org/changeset/base/366372 > > >>> > > >>> Log: > > >>> linuxkpi: Add backlight support > > >>> > > >>> Add backlight function to linuxkpi. > > >>> Graphics drivers expose the backlight of the > panel directly so > > >>> allow them > > >>> to use the backlight subsystem so > > >>> user can use backlight(8) to configure them. > > >>> > > >>> Reviewed by: hselasky > > >>> Relnotes: yes > > >>> Differential Revision: The FreeBSD Foundation > > >>> > > >>> Added: > > >>> > head/sys/compat/linuxkpi/common/include/linux/backlight.h > > >>> (contents, > > >>> props changed) > > >>> Modified: > > >>> > head/sys/compat/linuxkpi/common/include/linux/device.h > > >>> head/sys/compat/linuxkpi/common/src/linux_kmod.c > > >>> head/sys/compat/linuxkpi/common/src/linux_pci.c > > >>> head/sys/conf/kmod.mk > > >>> > > >>> It breaks the build for me with > > >>> > /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: > > >>> fatal error: 'backlight_if.h' file not found > > >>> > > >>> > > >>> How do you build? Doesn't break over here. > > >>> > > >>> GENERIC + COMPAT_LINUXKPI. > > >>> > > >>> > > >>> > > >>> Try adding: > > >>> > > >>> options backlight > > >>> > > >>> To the kernel config. > > >>> > > >>> Yep, thank you! > > >>> Maybe it's worth considering adding static assert with the message > describing this dependency? > > >> > > >> > > >> Yes. It likely is worth doing something to highlight this issue. > > >> > > >> Warner > > >> > > > > > > I think we just need to slap the two core backlight files with an ` | > > > compat_linux` so that they simply get pulled in if you specify > > > COMPAT_LINUX. config(8) handles this terribly, configng must have a > > > better provides/requires/implies/whatever functionality so we can > > > specify that compat_linux implies backlight and not do crud like this > > > where it becomes more complicated to see what any given option really > > > entails. > > > > > > Thanks, > > > > COMPAT_LINUX can't be right. Isn't that the linuxolator? > > Regards > > -- > > Niclas Zeising > > Whoops, s/LINUX/LINUXKPI/ > > :-) > From owner-svn-src-all@freebsd.org Sat Oct 24 01:13:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1E1742B4A5; Sat, 24 Oct 2020 01:13:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ34Z5dY1z3Yc5; Sat, 24 Oct 2020 01:13:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D18106F2; Sat, 24 Oct 2020 01:13:02 +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 09O1D2ik036308; Sat, 24 Oct 2020 01:13:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1D2Xm036307; Sat, 24 Oct 2020 01:13:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010240113.09O1D2Xm036307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 01:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366984 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:13:02 -0000 Author: mjg Date: Sat Oct 24 01:13:02 2020 New Revision: 366984 URL: https://svnweb.freebsd.org/changeset/base/366984 Log: cache: drop write-only vars Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 00:03:11 2020 (r366983) +++ head/sys/kern/vfs_cache.c Sat Oct 24 01:13:02 2020 (r366984) @@ -1163,7 +1163,6 @@ cache_neg_evict(void) { struct namecache *ncp, *ncp2; struct neglist *nl; - struct negstate *ns; struct vnode *dvp; struct mtx *dvlp; struct mtx *blp; @@ -1188,7 +1187,6 @@ cache_neg_evict(void) mtx_unlock(&nl->nl_evict_lock); return (false); } - ns = NCP2NEGSTATE(ncp); nlen = ncp->nc_nlen; dvp = ncp->nc_dvp; hash = cache_get_hash(ncp->nc_name, nlen, dvp); @@ -4322,11 +4320,9 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) static int __noinline cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) { - struct componentname *cnp; struct vnode *dvp; seqc_t dvp_seqc; - cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; From owner-svn-src-all@freebsd.org Sat Oct 24 01:13:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE2E42B4BF; Sat, 24 Oct 2020 01:13:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ34r5SVNz3YjG; Sat, 24 Oct 2020 01:13:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A013D1036A; Sat, 24 Oct 2020 01:13:16 +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 09O1DGjx036361; Sat, 24 Oct 2020 01:13:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1DG9w036360; Sat, 24 Oct 2020 01:13:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010240113.09O1DG9w036360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 01:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366985 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:13:16 -0000 Author: mjg Date: Sat Oct 24 01:13:16 2020 New Revision: 366985 URL: https://svnweb.freebsd.org/changeset/base/366985 Log: cache: fix some typos Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 01:13:02 2020 (r366984) +++ head/sys/kern/vfs_cache.c Sat Oct 24 01:13:16 2020 (r366985) @@ -305,7 +305,7 @@ SYSCTL_ULONG(_vfs_cache_param, OID_AUTO, negfactor, CT "Ratio of negative namecache entries"); /* - * Negative entry % of namecahe capacity above which automatic eviction is allowed. + * Negative entry % of namecache capacity above which automatic eviction is allowed. * * Check cache_neg_evict_cond for details. */ @@ -750,7 +750,7 @@ sysctl_negminpct(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vfs_cache_param, OID_AUTO, negminpct, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_negminpct, - "I", "Negative entry \% of namecahe capacity above which automatic eviction is allowed"); + "I", "Negative entry \% of namecache capacity above which automatic eviction is allowed"); #ifdef DIAGNOSTIC /* From owner-svn-src-all@freebsd.org Sat Oct 24 01:13:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D29742B357; Sat, 24 Oct 2020 01:13:48 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ35S0JRCz3YVS; Sat, 24 Oct 2020 01:13:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC42010535; Sat, 24 Oct 2020 01:13:47 +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 09O1Dl4P036428; Sat, 24 Oct 2020 01:13:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1DluD036427; Sat, 24 Oct 2020 01:13:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010240113.09O1DluD036427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 01:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366986 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:13:48 -0000 Author: mjg Date: Sat Oct 24 01:13:47 2020 New Revision: 366986 URL: https://svnweb.freebsd.org/changeset/base/366986 Log: cache: fold branch prediction into cache_ncp_canuse Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 01:13:16 2020 (r366985) +++ head/sys/kern/vfs_cache.c Sat Oct 24 01:13:47 2020 (r366986) @@ -233,14 +233,15 @@ cache_ncp_invalidate(struct namecache *ncp) * All places which elide locks are supposed to call this after they are * done with reading from an entry. */ -static bool -cache_ncp_canuse(struct namecache *ncp) -{ +#define cache_ncp_canuse(ncp) ({ \ + struct namecache *_ncp = (ncp); \ + u_char _nc_flag; \ + \ + atomic_thread_fence_acq(); \ + _nc_flag = atomic_load_char(&_ncp->nc_flag); \ + __predict_true((_nc_flag & (NCF_INVALID | NCF_WIP)) == 0); \ +}) - atomic_thread_fence_acq(); - return ((atomic_load_char(&ncp->nc_flag) & (NCF_INVALID | NCF_WIP)) == 0); -} - /* * Name caching works as follows: * @@ -1056,7 +1057,7 @@ cache_neg_promote_cond(struct vnode *dvp, struct compo goto out_abort; } - if (__predict_false(!cache_ncp_canuse(ncp))) { + if (!cache_ncp_canuse(ncp)) { goto out_abort; } @@ -1834,7 +1835,7 @@ negative_success: cache_out_ts(ncp, tsp, ticksp); whiteout = (ncp->nc_flag & NCF_WHITE); neg_promote = cache_neg_hit_prep(ncp); - if (__predict_false(!cache_ncp_canuse(ncp))) { + if (!cache_ncp_canuse(ncp)) { cache_neg_hit_abort(ncp); vfs_smr_exit(); goto out_fallback; @@ -4008,7 +4009,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) fpl->tvp = ncp->nc_dvp; } - if (__predict_false(!cache_ncp_canuse(ncp))) { + if (!cache_ncp_canuse(ncp)) { return (cache_fpl_aborted(fpl)); } @@ -4041,7 +4042,7 @@ cache_fplookup_neg(struct cache_fpl *fpl, struct namec return (cache_fpl_partial(fpl)); } neg_promote = cache_neg_hit_prep(ncp); - if (__predict_false(!cache_ncp_canuse(ncp))) { + if (!cache_ncp_canuse(ncp)) { cache_neg_hit_abort(ncp); return (cache_fpl_partial(fpl)); } @@ -4096,7 +4097,7 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fplookup_neg(fpl, ncp, hash)); } - if (__predict_false(!cache_ncp_canuse(ncp))) { + if (!cache_ncp_canuse(ncp)) { return (cache_fpl_partial(fpl)); } From owner-svn-src-all@freebsd.org Sat Oct 24 01:14:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC9CA42B75F; Sat, 24 Oct 2020 01:14:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ3615l0Dz3Z1b; Sat, 24 Oct 2020 01:14:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8410106F4; Sat, 24 Oct 2020 01:14:17 +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 09O1EHaF036498; Sat, 24 Oct 2020 01:14:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1EHAH036497; Sat, 24 Oct 2020 01:14:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010240114.09O1EHAH036497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 01:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366987 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:14:18 -0000 Author: mjg Date: Sat Oct 24 01:14:17 2020 New Revision: 366987 URL: https://svnweb.freebsd.org/changeset/base/366987 Log: cache: refactor alloc/free This in particular centralizes manipulation of numcache. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 01:13:47 2020 (r366986) +++ head/sys/kern/vfs_cache.c Sat Oct 24 01:14:17 2020 (r366987) @@ -174,6 +174,19 @@ struct namecache_ts { */ #define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) +/* + * TODO: the initial value of CACHE_PATH_CUTOFF was inherited from the + * 4.4 BSD codebase. Later on struct namecache was tweaked to become + * smaller and the value was bumped to retain the total size, but it + * was never re-evaluated for suitability. A simple test counting + * lengths during package building shows that the value of 45 covers + * about 86% of all added entries, reaching 99% at 65. + * + * Regardless of the above, use of dedicated zones instead of malloc may be + * inducing additional waste. This may be hard to address as said zones are + * tied to VFS SMR. Even if retaining them, the current split should be + * reevaluated. + */ #ifdef __LP64__ #define CACHE_PATH_CUTOFF 45 #define CACHE_LARGE_PAD 6 @@ -212,6 +225,8 @@ _Static_assert((CACHE_ZONE_LARGE_TS_SIZE % (CACHE_ZONE */ #define NEG_HOT 0x01 +static bool cache_neg_evict_cond(u_long lnumcache); + /* * Mark an entry as invalid. * @@ -380,62 +395,7 @@ VP2VNODELOCK(struct vnode *vp) return (&vnodelocks[(((uintptr_t)(vp) >> 8) & ncvnodehash)]); } -/* - * UMA zones for the VFS cache. - * - * The small cache is used for entries with short names, which are the - * most common. The large cache is used for entries which are too big to - * fit in the small cache. - */ -static uma_zone_t __read_mostly cache_zone_small; -static uma_zone_t __read_mostly cache_zone_small_ts; -static uma_zone_t __read_mostly cache_zone_large; -static uma_zone_t __read_mostly cache_zone_large_ts; - -static struct namecache * -cache_alloc(int len, int ts) -{ - struct namecache_ts *ncp_ts; - struct namecache *ncp; - - if (__predict_false(ts)) { - if (len <= CACHE_PATH_CUTOFF) - ncp_ts = uma_zalloc_smr(cache_zone_small_ts, M_WAITOK); - else - ncp_ts = uma_zalloc_smr(cache_zone_large_ts, M_WAITOK); - ncp = &ncp_ts->nc_nc; - } else { - if (len <= CACHE_PATH_CUTOFF) - ncp = uma_zalloc_smr(cache_zone_small, M_WAITOK); - else - ncp = uma_zalloc_smr(cache_zone_large, M_WAITOK); - } - return (ncp); -} - static void -cache_free(struct namecache *ncp) -{ - struct namecache_ts *ncp_ts; - - MPASS(ncp != NULL); - if ((ncp->nc_flag & NCF_DVDROP) != 0) - vdrop(ncp->nc_dvp); - if (__predict_false(ncp->nc_flag & NCF_TS)) { - ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); - if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) - uma_zfree_smr(cache_zone_small_ts, ncp_ts); - else - uma_zfree_smr(cache_zone_large_ts, ncp_ts); - } else { - if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) - uma_zfree_smr(cache_zone_small, ncp); - else - uma_zfree_smr(cache_zone_large, ncp); - } -} - -static void cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp) { struct namecache_ts *ncp_ts; @@ -547,6 +507,126 @@ cache_assert_vnode_locked(struct vnode *vp) } /* + * Directory vnodes with entries are held for two reasons: + * 1. make them less of a target for reclamation in vnlru + * 2. suffer smaller performance penalty in locked lookup as requeieing is avoided + * + * Note this preferably would not be done and it's a hold over from. It will be + * feasible to eliminate altogether if all filesystems start supporting + * lockless lookup. + */ +static void +cache_hold_vnode(struct vnode *vp) +{ + + cache_assert_vnode_locked(vp); + VNPASS(LIST_EMPTY(&vp->v_cache_src), vp); + vhold(vp); + counter_u64_add(numcachehv, 1); +} + +static void +cache_drop_vnode(struct vnode *vp) +{ + + /* + * Called after all locks are dropped, meaning we can't assert + * on the state of v_cache_src. + */ + vdrop(vp); + counter_u64_add(numcachehv, -1); +} + +/* + * UMA zones. + */ +static uma_zone_t __read_mostly cache_zone_small; +static uma_zone_t __read_mostly cache_zone_small_ts; +static uma_zone_t __read_mostly cache_zone_large; +static uma_zone_t __read_mostly cache_zone_large_ts; + +static struct namecache * +cache_alloc_uma(int len, bool ts) +{ + struct namecache_ts *ncp_ts; + struct namecache *ncp; + + if (__predict_false(ts)) { + if (len <= CACHE_PATH_CUTOFF) + ncp_ts = uma_zalloc_smr(cache_zone_small_ts, M_WAITOK); + else + ncp_ts = uma_zalloc_smr(cache_zone_large_ts, M_WAITOK); + ncp = &ncp_ts->nc_nc; + } else { + if (len <= CACHE_PATH_CUTOFF) + ncp = uma_zalloc_smr(cache_zone_small, M_WAITOK); + else + ncp = uma_zalloc_smr(cache_zone_large, M_WAITOK); + } + return (ncp); +} + +static void +cache_free_uma(struct namecache *ncp) +{ + struct namecache_ts *ncp_ts; + + if (__predict_false(ncp->nc_flag & NCF_TS)) { + ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); + if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) + uma_zfree_smr(cache_zone_small_ts, ncp_ts); + else + uma_zfree_smr(cache_zone_large_ts, ncp_ts); + } else { + if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) + uma_zfree_smr(cache_zone_small, ncp); + else + uma_zfree_smr(cache_zone_large, ncp); + } +} + +static struct namecache * +cache_alloc(int len, bool ts) +{ + u_long lnumcache; + + /* + * Avoid blowout in namecache entries. + * + * Bugs: + * 1. filesystems may end up tryng to add an already existing entry + * (for example this can happen after a cache miss during concurrent + * lookup), in which case we will call cache_neg_evict despite not + * adding anything. + * 2. the routine may fail to free anything and no provisions are made + * to make it try harder (see the inside for failure modes) + * 3. it only ever looks at negative entries. + */ + lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (cache_neg_evict_cond(lnumcache)) { + lnumcache = atomic_load_long(&numcache); + } + if (__predict_false(lnumcache >= ncsize)) { + atomic_subtract_long(&numcache, 1); + counter_u64_add(numdrops, 1); + return (NULL); + } + return (cache_alloc_uma(len, ts)); +} + +static void +cache_free(struct namecache *ncp) +{ + + MPASS(ncp != NULL); + if ((ncp->nc_flag & NCF_DVDROP) != 0) { + cache_drop_vnode(ncp->nc_dvp); + } + cache_free_uma(ncp); + atomic_subtract_long(&numcache, 1); +} + +/* * TODO: With the value stored we can do better than computing the hash based * on the address. The choice of FNV should also be revisited. */ @@ -1298,10 +1378,8 @@ cache_zap_locked(struct namecache *ncp) LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; - counter_u64_add(numcachehv, -1); } } - atomic_subtract_long(&numcache, 1); } static void @@ -2110,7 +2188,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, uint32_t hash; int flag; int len; - u_long lnumcache; VNPASS(dvp != vp, dvp); VNPASS(!VN_IS_DOOMED(dvp), dvp); @@ -2135,27 +2212,9 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } } - /* - * Avoid blowout in namecache entries. - * - * Bugs: - * 1. filesystems may end up tryng to add an already existing entry - * (for example this can happen after a cache miss during concurrent - * lookup), in which case we will call cache_neg_evict despite not - * adding anything. - * 2. the routine may fail to free anything and no provisions are made - * to make it try harder (see the inside for failure modes) - * 3. it only ever looks at negative entries. - */ - lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; - if (cache_neg_evict_cond(lnumcache)) { - lnumcache = atomic_load_long(&numcache); - } - if (__predict_false(lnumcache >= ncsize)) { - atomic_subtract_long(&numcache, 1); - counter_u64_add(numdrops, 1); + ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); + if (ncp == NULL) return; - } cache_celockstate_init(&cel); ndd = NULL; @@ -2165,7 +2224,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. */ - ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); ncp->nc_flag = flag | NCF_WIP; ncp->nc_vp = vp; if (vp == NULL) @@ -2276,8 +2334,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (flag != NCF_ISDOTDOT) { if (LIST_EMPTY(&dvp->v_cache_src)) { - vhold(dvp); - counter_u64_add(numcachehv, 1); + cache_hold_vnode(dvp); } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } @@ -2318,7 +2375,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, return; out_unlock_free: cache_enter_unlock(&cel); - atomic_subtract_long(&numcache, 1); cache_free(ncp); return; } From owner-svn-src-all@freebsd.org Sat Oct 24 01:14:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3C0B42BA26; Sat, 24 Oct 2020 01:14:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ36j3l4jz3Z0F; Sat, 24 Oct 2020 01:14:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63C351036C; Sat, 24 Oct 2020 01:14:53 +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 09O1ErMJ036568; Sat, 24 Oct 2020 01:14:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1ErBm036567; Sat, 24 Oct 2020 01:14:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010240114.09O1ErBm036567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 01:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366988 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:14:53 -0000 Author: mjg Date: Sat Oct 24 01:14:52 2020 New Revision: 366988 URL: https://svnweb.freebsd.org/changeset/base/366988 Log: cache: batch updates to numcache in case of mass removal Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 01:14:17 2020 (r366987) +++ head/sys/kern/vfs_cache.c Sat Oct 24 01:14:52 2020 (r366988) @@ -110,6 +110,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "str SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *", "struct componentname *"); SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int"); SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", @@ -166,6 +167,8 @@ struct namecache_ts { struct namecache nc_nc; }; +TAILQ_HEAD(cache_freebatch, namecache); + /* * At least mips n32 performs 64-bit accesses to timespec as found * in namecache_ts and requires them to be aligned. Since others @@ -626,6 +629,27 @@ cache_free(struct namecache *ncp) atomic_subtract_long(&numcache, 1); } +static void +cache_free_batch(struct cache_freebatch *batch) +{ + struct namecache *ncp, *nnp; + int i; + + i = 0; + if (TAILQ_EMPTY(batch)) + goto out; + TAILQ_FOREACH_SAFE(ncp, batch, nc_dst, nnp) { + if ((ncp->nc_flag & NCF_DVDROP) != 0) { + cache_drop_vnode(ncp->nc_dvp); + } + cache_free_uma(ncp); + i++; + } + atomic_subtract_long(&numcache, i); +out: + SDT_PROBE1(vfs, namecache, purge, batch, i); +} + /* * TODO: With the value stored we can do better than computing the hash based * on the address. The choice of FNV should also be revisited. @@ -2524,11 +2548,11 @@ cache_changesize(u_long newmaxvnodes) static void cache_purge_impl(struct vnode *vp) { - TAILQ_HEAD(, namecache) ncps; - struct namecache *ncp, *nnp; + struct cache_freebatch batch; + struct namecache *ncp; struct mtx *vlp, *vlp2; - TAILQ_INIT(&ncps); + TAILQ_INIT(&batch); vlp = VP2VNODELOCK(vp); vlp2 = NULL; mtx_lock(vlp); @@ -2537,13 +2561,13 @@ retry: ncp = LIST_FIRST(&vp->v_cache_src); if (!cache_zap_locked_vnode_kl2(ncp, vp, &vlp2)) goto retry; - TAILQ_INSERT_TAIL(&ncps, ncp, nc_dst); + TAILQ_INSERT_TAIL(&batch, ncp, nc_dst); } while (!TAILQ_EMPTY(&vp->v_cache_dst)) { ncp = TAILQ_FIRST(&vp->v_cache_dst); if (!cache_zap_locked_vnode_kl2(ncp, vp, &vlp2)) goto retry; - TAILQ_INSERT_TAIL(&ncps, ncp, nc_dst); + TAILQ_INSERT_TAIL(&batch, ncp, nc_dst); } ncp = vp->v_cache_dd; if (ncp != NULL) { @@ -2551,15 +2575,13 @@ retry: ("lost dotdot link")); if (!cache_zap_locked_vnode_kl2(ncp, vp, &vlp2)) goto retry; - TAILQ_INSERT_TAIL(&ncps, ncp, nc_dst); + TAILQ_INSERT_TAIL(&batch, ncp, nc_dst); } KASSERT(vp->v_cache_dd == NULL, ("incomplete purge")); mtx_unlock(vlp); if (vlp2 != NULL) mtx_unlock(vlp2); - TAILQ_FOREACH_SAFE(ncp, &ncps, nc_dst, nnp) { - cache_free(ncp); - } + cache_free_batch(&batch); } /* @@ -2617,26 +2639,24 @@ cache_purge_vgone(struct vnode *vp) void cache_purge_negative(struct vnode *vp) { - TAILQ_HEAD(, namecache) ncps; + struct cache_freebatch batch; struct namecache *ncp, *nnp; struct mtx *vlp; SDT_PROBE1(vfs, namecache, purge_negative, done, vp); if (LIST_EMPTY(&vp->v_cache_src)) return; - TAILQ_INIT(&ncps); + TAILQ_INIT(&batch); vlp = VP2VNODELOCK(vp); mtx_lock(vlp); LIST_FOREACH_SAFE(ncp, &vp->v_cache_src, nc_src, nnp) { if (!(ncp->nc_flag & NCF_NEGATIVE)) continue; cache_zap_negative_locked_vnode_kl(ncp, vp); - TAILQ_INSERT_TAIL(&ncps, ncp, nc_dst); + TAILQ_INSERT_TAIL(&batch, ncp, nc_dst); } mtx_unlock(vlp); - TAILQ_FOREACH_SAFE(ncp, &ncps, nc_dst, nnp) { - cache_free(ncp); - } + cache_free_batch(&batch); } void From owner-svn-src-all@freebsd.org Sat Oct 24 01:59:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D93A742C9FF; Sat, 24 Oct 2020 01:59:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ45d59K6z3bML; Sat, 24 Oct 2020 01:59:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94F1910F26; Sat, 24 Oct 2020 01:59:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09O1x1AR061130; Sat, 24 Oct 2020 01:59:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O1x1j9061129; Sat, 24 Oct 2020 01:59:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010240159.09O1x1j9061129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 01:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366989 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 366989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 01:59:01 -0000 Author: imp Date: Sat Oct 24 01:59:01 2020 New Revision: 366989 URL: https://svnweb.freebsd.org/changeset/base/366989 Log: nvme: Remove compat code for older kernels Remove code that supported pre-2011 kernels. CTLTYPE_S64 was defined in rev 217616. All supported branches have it, so remove its compat definition as OBE. Modified: head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Sat Oct 24 01:14:52 2020 (r366988) +++ head/sys/dev/nvme/nvme_sysctl.c Sat Oct 24 01:59:01 2020 (r366989) @@ -52,16 +52,6 @@ SYSCTL_BOOL(_hw_nvme, OID_AUTO, verbose_cmd_dump, CTLF &nvme_verbose_cmd_dump, 0, "enable verbose command printting when a command fails"); -/* - * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these - * explicitly here for older kernels that don't include the r217616 - * changeset. - */ -#ifndef CTLTYPE_S64 -#define CTLTYPE_S64 CTLTYPE_QUAD -#define sysctl_handle_64 sysctl_handle_quad -#endif - static void nvme_dump_queue(struct nvme_qpair *qpair) { From owner-svn-src-all@freebsd.org Sat Oct 24 05:26:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C257C43BBC9; Sat, 24 Oct 2020 05:26:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ8hT50f5z447b; Sat, 24 Oct 2020 05:26:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E9CA13927; Sat, 24 Oct 2020 05:26:01 +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 09O5Q1rK090679; Sat, 24 Oct 2020 05:26:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O5PsTA090640; Sat, 24 Oct 2020 05:25:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010240525.09O5PsTA090640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 24 Oct 2020 05:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366990 - vendor/less/dist X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/less/dist X-SVN-Commit-Revision: 366990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 05:26:01 -0000 Author: delphij Date: Sat Oct 24 05:25:54 2020 New Revision: 366990 URL: https://svnweb.freebsd.org/changeset/base/366990 Log: Vendor import of less v563. Modified: vendor/less/dist/Makefile.aut vendor/less/dist/Makefile.wnm vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/compose.uni vendor/less/dist/configure vendor/less/dist/configure.ac vendor/less/dist/cvt.c vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/fmt.uni vendor/less/dist/forwback.c vendor/less/dist/funcs.h vendor/less/dist/help.c vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkutable vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/ubin.uni vendor/less/dist/version.c vendor/less/dist/wide.uni Modified: vendor/less/dist/Makefile.aut ============================================================================== --- vendor/less/dist/Makefile.aut Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/Makefile.aut Sat Oct 24 05:25:54 2020 (r366990) @@ -4,7 +4,7 @@ EMAIL = bug-less@gnu.org HOMEPAGE = http://www.greenwoodsoftware.com/less SHELL = /bin/sh GIT = git -NROFF = nroff -man +NROFF = nroff -t -man srcdir = . @@ -52,8 +52,7 @@ help.c: less.hlp ${srcdir}/mkhelp.pl < less.hlp > help.c if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi -${srcdir}/configure: ${srcdir}/configure.ac \ - ${srcdir}/Makefile.in +${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac ${srcdir}/Makefile.in cd ${srcdir}; autoheader; autoconf funcs.h: ${SRC:%=${srcdir}/%} @@ -66,6 +65,7 @@ lint: clean: rm -f Makefile config.status config.log config.cache defines.h stamp-h \ + configure defines.h.in funcs.h help.c \ README NEWS \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man @@ -93,8 +93,6 @@ ${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${src ${REPLACE_VERSION} ${srcdir}/lesskey.nro.VER ${srcdir}/lessecho.nro: ${srcdir}/lessecho.nro.VER ${srcdir}/version.c ${REPLACE_VERSION} ${srcdir}/lessecho.nro.VER -${srcdir}/less.hlp: ${srcdir}/less.hlp.VER ${srcdir}/version.c - ${REPLACE_VERSION} ${srcdir}/less.hlp.VER ${srcdir}/less.man: ${srcdir}/less.nro ${NROFF} ${srcdir}/less.nro >${srcdir}/less.man @@ -114,10 +112,10 @@ wide.uni: unicode/EastAsianWidth.txt unicode/UnicodeData.txt: mkdir -p unicode - curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt + curl -s -u 'anonymous:${EMAIL}' -o $@ ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt unicode/EastAsianWidth.txt: mkdir -p unicode - curl -s -o $@ ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt + curl -s -u 'anonymous:${EMAIL}' -o $@ ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt distfiles: ${DISTFILES} Modified: vendor/less/dist/Makefile.wnm ============================================================================== --- vendor/less/dist/Makefile.wnm Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/Makefile.wnm Sat Oct 24 05:25:54 2020 (r366990) @@ -7,11 +7,11 @@ CC = cl # Normal flags CFLAGS = /nologo /MD /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 +LDFLAGS = /nologo /subsystem:console /incremental:no # Debugging flags #CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386 +#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug LD = link LIBS = user32.lib Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/NEWS Sat Oct 24 05:25:54 2020 (r366990) @@ -11,6 +11,31 @@ ====================================================================== + Major changes between "less" versions 551 and 563 + +* Update Unicode tables. + +* Treat Hangul Jamo medial vowels and final consonants as zero width. + +* Display error message immediately when -o is toggled and + input is not a pipe. + +* Fix regression: make screen repaint when "squished" and + a no-movement command is given. + +* Fix erroneous EOF calculation when F command is interrupted. + +* Make WIN32C version include this fix from 551: + Don't count lines in initial screen if using -X with -F. + +* Fix display bug in WIN32C version. + +* Fix memory corruption when built with libtermcap. + +* Support libtinfow. + +====================================================================== + Major changes between "less" versions 530 and 551 * Add --mouse option. Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/README Sat Oct 24 05:25:54 2020 (r366990) @@ -1,7 +1,7 @@ - Less, version 551 + Less, version 563 - This is the distribution of less, version 551, released 11 Jun 2019. + This is the distribution of less, version 563, released 13 Jun 2020. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -24,6 +24,14 @@ This is the distribution of "less", a paginator simila The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. + +======================================================================= +PRE-INSTALLATION (when using git) + +If you are building from a clone of a git repository, +type "make -f Makefile.aut". +If you are building from a numbered release package (a tar or zip file +with a name like less-999.tar.gz or less-999.zip), you should skip this step. ======================================================================= INSTALLATION (Unix systems only): Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/brac.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/ch.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -408,6 +408,7 @@ end_logfile(VOID_PARAM) } close(logfile); logfile = -1; + free(namelogfile); namelogfile = NULL; } @@ -842,7 +843,8 @@ seekable(f) public void ch_set_eof(VOID_PARAM) { - ch_fsize = ch_fpos; + if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos) + ch_fsize = ch_fpos; } Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/charset.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -509,7 +509,7 @@ prutfchar(ch) */ public int utf_len(ch) - unsigned char ch; + int ch; { if ((ch & 0x80) == 0) return 1; Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/charset.h Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/cmd.h Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/cmdbuf.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -34,7 +34,7 @@ static int literal; /* Next input char should not be static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME -static int cmd_complete(); +static int cmd_complete LESSPARAMS((int action)); /* * These variables are statics used by cmd_complete. */ @@ -960,10 +960,7 @@ cmd_istr(str) step_char(&s, +1, endline); action = cmd_ichar(os, s - os); if (action != CC_OK) - { - bell(); return (action); - } } return (CC_OK); } Modified: vendor/less/dist/command.c ============================================================================== --- vendor/less/dist/command.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/command.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -88,7 +88,7 @@ struct ungot { }; static struct ungot* ungot = NULL; -static void multi_search(); +static void multi_search LESSPARAMS((char *pattern, int n, int silent)); /* * Move the cursor to start of prompt line before executing a command. @@ -1800,6 +1800,12 @@ commands(VOID_PARAM) optgetname = FALSE; mca_opt_toggle(); c = getcc(); + cbuf = opt_toggle_disallowed(c); + if (cbuf != NULL) + { + error(cbuf, NULL_PARG); + break; + } goto again; case A_DISP_OPTION: Modified: vendor/less/dist/compose.uni ============================================================================== --- vendor/less/dist/compose.uni Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/compose.uni Sat Oct 24 05:25:54 2020 (r366990) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x0300, 0x036f }, /* Mn */ { 0x0483, 0x0487 }, /* Mn */ { 0x0488, 0x0489 }, /* Me */ @@ -58,7 +58,7 @@ { 0x0b3f, 0x0b3f }, /* Mn */ { 0x0b41, 0x0b44 }, /* Mn */ { 0x0b4d, 0x0b4d }, /* Mn */ - { 0x0b56, 0x0b56 }, /* Mn */ + { 0x0b55, 0x0b56 }, /* Mn */ { 0x0b62, 0x0b63 }, /* Mn */ { 0x0b82, 0x0b82 }, /* Mn */ { 0x0bc0, 0x0bc0 }, /* Mn */ @@ -81,6 +81,7 @@ { 0x0d41, 0x0d44 }, /* Mn */ { 0x0d4d, 0x0d4d }, /* Mn */ { 0x0d62, 0x0d63 }, /* Mn */ + { 0x0d81, 0x0d81 }, /* Mn */ { 0x0dca, 0x0dca }, /* Mn */ { 0x0dd2, 0x0dd4 }, /* Mn */ { 0x0dd6, 0x0dd6 }, /* Mn */ @@ -88,8 +89,7 @@ { 0x0e34, 0x0e3a }, /* Mn */ { 0x0e47, 0x0e4e }, /* Mn */ { 0x0eb1, 0x0eb1 }, /* Mn */ - { 0x0eb4, 0x0eb9 }, /* Mn */ - { 0x0ebb, 0x0ebc }, /* Mn */ + { 0x0eb4, 0x0ebc }, /* Mn */ { 0x0ec8, 0x0ecd }, /* Mn */ { 0x0f18, 0x0f19 }, /* Mn */ { 0x0f35, 0x0f35 }, /* Mn */ @@ -112,6 +112,7 @@ { 0x1085, 0x1086 }, /* Mn */ { 0x108d, 0x108d }, /* Mn */ { 0x109d, 0x109d }, /* Mn */ + { 0x1160, 0x11ff }, /* Mn */ { 0x135d, 0x135f }, /* Mn */ { 0x1712, 0x1714 }, /* Mn */ { 0x1732, 0x1734 }, /* Mn */ @@ -140,6 +141,7 @@ { 0x1a7f, 0x1a7f }, /* Mn */ { 0x1ab0, 0x1abd }, /* Mn */ { 0x1abe, 0x1abe }, /* Me */ + { 0x1abf, 0x1ac0 }, /* Mn */ { 0x1b00, 0x1b03 }, /* Mn */ { 0x1b34, 0x1b34 }, /* Mn */ { 0x1b36, 0x1b3a }, /* Mn */ @@ -183,6 +185,7 @@ { 0xa806, 0xa806 }, /* Mn */ { 0xa80b, 0xa80b }, /* Mn */ { 0xa825, 0xa826 }, /* Mn */ + { 0xa82c, 0xa82c }, /* Mn */ { 0xa8c4, 0xa8c5 }, /* Mn */ { 0xa8e0, 0xa8f1 }, /* Mn */ { 0xa8ff, 0xa8ff }, /* Mn */ @@ -191,7 +194,7 @@ { 0xa980, 0xa982 }, /* Mn */ { 0xa9b3, 0xa9b3 }, /* Mn */ { 0xa9b6, 0xa9b9 }, /* Mn */ - { 0xa9bc, 0xa9bc }, /* Mn */ + { 0xa9bc, 0xa9bd }, /* Mn */ { 0xa9e5, 0xa9e5 }, /* Mn */ { 0xaa29, 0xaa2e }, /* Mn */ { 0xaa31, 0xaa32 }, /* Mn */ @@ -209,6 +212,8 @@ { 0xabe5, 0xabe5 }, /* Mn */ { 0xabe8, 0xabe8 }, /* Mn */ { 0xabed, 0xabed }, /* Mn */ + { 0xd7b0, 0xd7c6 }, /* Mn */ + { 0xd7cb, 0xd7fb }, /* Mn */ { 0xfb1e, 0xfb1e }, /* Mn */ { 0xfe00, 0xfe0f }, /* Mn */ { 0xfe20, 0xfe2f }, /* Mn */ @@ -222,6 +227,7 @@ { 0x10a3f, 0x10a3f }, /* Mn */ { 0x10ae5, 0x10ae6 }, /* Mn */ { 0x10d24, 0x10d27 }, /* Mn */ + { 0x10eab, 0x10eac }, /* Mn */ { 0x10f46, 0x10f50 }, /* Mn */ { 0x11001, 0x11001 }, /* Mn */ { 0x11038, 0x11046 }, /* Mn */ @@ -235,6 +241,7 @@ { 0x11180, 0x11181 }, /* Mn */ { 0x111b6, 0x111be }, /* Mn */ { 0x111c9, 0x111cc }, /* Mn */ + { 0x111cf, 0x111cf }, /* Mn */ { 0x1122f, 0x11231 }, /* Mn */ { 0x11234, 0x11234 }, /* Mn */ { 0x11236, 0x11237 }, /* Mn */ @@ -270,6 +277,12 @@ { 0x11727, 0x1172b }, /* Mn */ { 0x1182f, 0x11837 }, /* Mn */ { 0x11839, 0x1183a }, /* Mn */ + { 0x1193b, 0x1193c }, /* Mn */ + { 0x1193e, 0x1193e }, /* Mn */ + { 0x11943, 0x11943 }, /* Mn */ + { 0x119d4, 0x119d7 }, /* Mn */ + { 0x119da, 0x119db }, /* Mn */ + { 0x119e0, 0x119e0 }, /* Mn */ { 0x11a01, 0x11a0a }, /* Mn */ { 0x11a33, 0x11a38 }, /* Mn */ { 0x11a3b, 0x11a3e }, /* Mn */ @@ -296,7 +309,9 @@ { 0x11ef3, 0x11ef4 }, /* Mn */ { 0x16af0, 0x16af4 }, /* Mn */ { 0x16b30, 0x16b36 }, /* Mn */ + { 0x16f4f, 0x16f4f }, /* Mn */ { 0x16f8f, 0x16f92 }, /* Mn */ + { 0x16fe4, 0x16fe4 }, /* Mn */ { 0x1bc9d, 0x1bc9e }, /* Mn */ { 0x1d167, 0x1d169 }, /* Mn */ { 0x1d17b, 0x1d182 }, /* Mn */ @@ -314,6 +329,9 @@ { 0x1e01b, 0x1e021 }, /* Mn */ { 0x1e023, 0x1e024 }, /* Mn */ { 0x1e026, 0x1e02a }, /* Mn */ + { 0x1e130, 0x1e136 }, /* Mn */ + { 0x1e2ae, 0x1e2ae }, /* Mn */ + { 0x1e2ec, 0x1e2ef }, /* Mn */ { 0x1e8d0, 0x1e8d6 }, /* Mn */ { 0x1e944, 0x1e94a }, /* Mn */ { 0xe0100, 0xe01ef }, /* Mn */ Modified: vendor/less/dist/configure ============================================================================== --- vendor/less/dist/configure Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/configure Sat Oct 24 05:25:54 2020 (r366990) @@ -654,6 +654,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -729,6 +730,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -981,6 +983,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1118,7 +1129,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1271,6 +1282,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -3682,6 +3694,48 @@ else have_tinfo=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgoto in -ltinfow" >&5 +$as_echo_n "checking for tgoto in -ltinfow... " >&6; } +if ${ac_cv_lib_tinfow_tgoto+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfow $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgoto (); +int +main () +{ +return tgoto (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tinfow_tgoto=yes +else + ac_cv_lib_tinfow_tgoto=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfow_tgoto" >&5 +$as_echo "$ac_cv_lib_tinfow_tgoto" >&6; } +if test "x$ac_cv_lib_tinfow_tgoto" = xyes; then : + have_tinfow=yes +else + have_tinfow=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lxcurses" >&5 $as_echo_n "checking for initscr in -lxcurses... " >&6; } if ${ac_cv_lib_xcurses_initscr+:} false; then : @@ -4015,6 +4069,35 @@ if test $curses_broken = 0; then if test "x$TERMLIBS" = x; then if test $have_tinfo = yes; then TERMLIBS="-ltinfo" + SAVE_LIBS=$LIBS + LIBS="$LIBS $TERMLIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + termok=yes +else + termok=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$SAVE_LIBS + if test $termok = no; then TERMLIBS=""; fi + fi +fi + +# -- Try tinfow. +if test "x$TERMLIBS" = x; then + if test $have_tinfow = yes; then + TERMLIBS="-ltinfow" SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext Modified: vendor/less/dist/configure.ac ============================================================================== --- vendor/less/dist/configure.ac Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/configure.ac Sat Oct 24 05:25:54 2020 (r366990) @@ -24,6 +24,7 @@ AC_SYS_LARGEFILE # Checks for general libraries. AC_CHECK_LIB(tinfo, tgoto, [have_tinfo=yes], [have_tinfo=no]) +AC_CHECK_LIB(tinfow, tgoto, [have_tinfow=yes], [have_tinfow=no]) AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no]) AC_CHECK_LIB(ncursesw, initscr, [have_ncursesw=yes], [have_ncursesw=no]) AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) @@ -55,6 +56,19 @@ if test $curses_broken = 0; then if test "x$TERMLIBS" = x; then if test $have_tinfo = yes; then TERMLIBS="-ltinfo" + SAVE_LIBS=$LIBS + LIBS="$LIBS $TERMLIBS" + AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);], + [termok=yes], [termok=no]) + LIBS=$SAVE_LIBS + if test $termok = no; then TERMLIBS=""; fi + fi +fi + +# -- Try tinfow. +if test "x$TERMLIBS" = x; then + if test $have_tinfow = yes; then + TERMLIBS="-ltinfow" SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);], Modified: vendor/less/dist/cvt.c ============================================================================== --- vendor/less/dist/cvt.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/cvt.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/decode.c ============================================================================== --- vendor/less/dist/decode.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/decode.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.ds ============================================================================== --- vendor/less/dist/defines.ds Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/defines.ds Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.o2 ============================================================================== --- vendor/less/dist/defines.o2 Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/defines.o2 Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.o9 ============================================================================== --- vendor/less/dist/defines.o9 Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/defines.o9 Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.wn ============================================================================== --- vendor/less/dist/defines.wn Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/defines.wn Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/edit.c ============================================================================== --- vendor/less/dist/edit.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/edit.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -854,7 +854,6 @@ loop: /* * Don't do anything. */ - free(filename); return; case 'q': quit(QUIT_OK); Modified: vendor/less/dist/filename.c ============================================================================== --- vendor/less/dist/filename.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/filename.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -795,7 +795,7 @@ lglob(filename) } /* - * @@@ + * Return canonical pathname. */ public char * lrealpath(path) Modified: vendor/less/dist/fmt.uni ============================================================================== --- vendor/less/dist/fmt.uni Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/fmt.uni Sat Oct 24 05:25:54 2020 (r366990) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x00ad, 0x00ad }, /* Cf */ { 0x0600, 0x0605 }, /* Cf */ { 0x061c, 0x061c }, /* Cf */ @@ -14,6 +14,7 @@ { 0xfff9, 0xfffb }, /* Cf */ { 0x110bd, 0x110bd }, /* Cf */ { 0x110cd, 0x110cd }, /* Cf */ + { 0x13430, 0x13438 }, /* Cf */ { 0x1bca0, 0x1bca3 }, /* Cf */ { 0x1d173, 0x1d17a }, /* Cf */ { 0xe0001, 0xe0001 }, /* Cf */ Modified: vendor/less/dist/forwback.c ============================================================================== --- vendor/less/dist/forwback.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/forwback.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -20,7 +20,6 @@ public int screen_trashed; public int squished; public int no_back_scroll = 0; public int forw_prompt; -public int same_pos_bell = 1; extern int sigs; extern int top_scroll; @@ -285,7 +284,7 @@ forw(n, pos, force, only_last, nblank) forw_prompt = 1; } - if (nlines == 0 && !ignore_eoi && same_pos_bell) + if (nlines == 0 && !ignore_eoi) eof_bell(); else if (do_repaint) repaint(); @@ -345,7 +344,7 @@ back(n, pos, force, only_last) } } - if (nlines == 0 && same_pos_bell) + if (nlines == 0) eof_bell(); else if (do_repaint) repaint(); Modified: vendor/less/dist/funcs.h ============================================================================== --- vendor/less/dist/funcs.h Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/funcs.h Sat Oct 24 05:25:54 2020 (r366990) @@ -61,7 +61,7 @@ public int binary_char LESSPARAMS ((LWCHAR c)); public int control_char LESSPARAMS ((LWCHAR c)); public char * prchar LESSPARAMS ((LWCHAR c)); public char * prutfchar LESSPARAMS ((LWCHAR ch)); -public int utf_len LESSPARAMS ((unsigned char ch)); +public int utf_len LESSPARAMS ((int ch)); public int is_utf8_well_formed LESSPARAMS ((char *ss, int slen)); public void utf_skip_to_lead LESSPARAMS ((char **pp, char *limit)); public LWCHAR get_wchar LESSPARAMS ((constant char *p)); @@ -187,10 +187,10 @@ public void pshift_all LESSPARAMS ((VOID_PARAM)); public int is_ansi_end LESSPARAMS ((LWCHAR ch)); public int is_ansi_middle LESSPARAMS ((LWCHAR ch)); public void skip_ansi LESSPARAMS ((char **pp, constant char *limit)); -public int pappend LESSPARAMS ((unsigned char c, POSITION pos)); +public int pappend LESSPARAMS ((int c, POSITION pos)); public int pflushmbc LESSPARAMS ((VOID_PARAM)); public void pdone LESSPARAMS ((int endline, int chopped, int forw)); -public void set_status_col LESSPARAMS ((char c)); +public void set_status_col LESSPARAMS ((int c)); public int gline LESSPARAMS ((int i, int *ap)); public void null_line LESSPARAMS ((VOID_PARAM)); public POSITION forw_raw_line LESSPARAMS ((POSITION curr_pos, char **linep, int *line_lenp)); @@ -243,6 +243,7 @@ public void scan_option LESSPARAMS ((char *s)); public void toggle_option LESSPARAMS ((struct loption *o, int lower, char *s, int how_toggle)); public int opt_has_param LESSPARAMS ((struct loption *o)); public char * opt_prompt LESSPARAMS ((struct loption *o)); +public char * opt_toggle_disallowed LESSPARAMS ((int c)); public int isoptpending LESSPARAMS ((VOID_PARAM)); public void nopendopt LESSPARAMS ((VOID_PARAM)); public int getnum LESSPARAMS ((char **sp, char *printopt, int *errp)); Modified: vendor/less/dist/help.c ============================================================================== --- vendor/less/dist/help.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/help.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 18:12 on 2019/6/11 */ +/* This file was generated by mkhelp.pl from less.hlp at 3:34 on 2020/6/14 */ #include "less.h" constant char helpdata[] = { '\n', Modified: vendor/less/dist/ifile.c ============================================================================== --- vendor/less/dist/ifile.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/ifile.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/input.c ============================================================================== --- vendor/less/dist/input.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/input.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/jump.c ============================================================================== --- vendor/less/dist/jump.c Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/jump.c Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -219,7 +219,7 @@ jump_loc(pos, sline) nline -= sindex; if (nline > 0) forw(nline, position(BOTTOM_PLUS_ONE), 1, 0, 0); - else if (nline < 0) + else back(-nline, position(TOP), 1, 0); #if HILITE_SEARCH if (show_attn) Modified: vendor/less/dist/less.h ============================================================================== --- vendor/less/dist/less.h Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/less.h Sat Oct 24 05:25:54 2020 (r366990) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/less.man ============================================================================== --- vendor/less/dist/less.man Sat Oct 24 01:59:01 2020 (r366989) +++ vendor/less/dist/less.man Sat Oct 24 05:25:54 2020 (r366990) @@ -18,12 +18,11 @@ LESS(1) General Commands Manual (See the OPTIONS section for alternate option syntax with long option names.) - DESCRIPTION - Less is a program similar to more (1), but which allows backward move- + Less is a program similar to more(1), but which allows backward move- ment in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input - files it starts up faster than text editors like vi (1). Less uses + files it starts up faster than text editors like vi(1). Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the @@ -33,20 +32,19 @@ LESS(1) General Commands Manual decimal number, called N in the descriptions below. The number is used by some commands, as indicated. - COMMANDS In the following descriptions, ^X means control-X. ESC stands for the - ESCAPE key; for example ESC-v means the two character sequence - "ESCAPE", then "v". + ESCAPE key; for example ESC-v means the two character sequence "ES- + CAPE", then "v". h or H Help: display a summary of these commands. If you forget all the other commands, remember this one. SPACE or ^V or f or ^F - Scroll forward N lines, default one window (see option -z - below). If N is more than the screen size, only the final - screenful is displayed. Warning: some systems use ^V as a spe- - cial literalization character. + Scroll forward N lines, default one window (see option -z be- + low). If N is more than the screen size, only the final screen- + ful is displayed. Warning: some systems use ^V as a special + literalization character. z Like SPACE, but if N is specified, it becomes the new window size. @@ -65,9 +63,9 @@ LESS(1) General Commands Manual u commands. b or ^B or ESC-v - Scroll backward N lines, default one window (see option -z - below). If N is more than the screen size, only the final - screenful is displayed. + Scroll backward N lines, default one window (see option -z be- + low). If N is more than the screen size, only the final screen- + ful is displayed. w Like ESC-v, but if N is specified, it becomes the new window size. @@ -89,19 +87,18 @@ LESS(1) General Commands Manual ESC-) or RIGHTARROW Scroll horizontally right N characters, default half the screen - width (see the -# option). If a number N is specified, it - becomes the default for future RIGHTARROW and LEFTARROW com- - mands. While the text is scrolled, it acts as though the -S - option (chop lines) were in effect. + width (see the -# option). If a number N is specified, it be- + comes the default for future RIGHTARROW and LEFTARROW commands. + While the text is scrolled, it acts as though the -S option + (chop lines) were in effect. ESC-( or LEFTARROW Scroll horizontally left N characters, default half the screen - width (see the -# option). If a number N is specified, it - becomes the default for future RIGHTARROW and LEFTARROW com- - mands. + width (see the -# option). If a number N is specified, it be- + comes the default for future RIGHTARROW and LEFTARROW commands. ESC-} or ^RIGHTARROW - Scroll horizontally right to show the end of the longest dis- + Scroll horizontally right to show the end of the longest dis- played line. ESC-{ or ^LEFTARROW @@ -110,17 +107,17 @@ LESS(1) General Commands Manual r or ^R or ^L Repaint the screen. - R Repaint the screen, discarding any buffered input. Useful if + R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed. - F Scroll forward, and keep trying to read when the end of file is - reached. Normally this command would be used when already at - the end of the file. It is a way to monitor the tail of a file - which is growing while it is being viewed. (The behavior is + F Scroll forward, and keep trying to read when the end of file is + reached. Normally this command would be used when already at + the end of the file. It is a way to monitor the tail of a file + which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.) - ESC-F Like F, but as soon as a line is found which matches the last - search pattern, the terminal bell is rung and forward scrolling + ESC-F Like F, but as soon as a line is found which matches the last + search pattern, the terminal bell is rung and forward scrolling stops. g or < or ESC-< @@ -128,12 +125,12 @@ LESS(1) General Commands Manual ing: this may be slow if N is large.) G or > or ESC-> - Go to line N in the file, default the end of the file. (Warn- - ing: this may be slow if N is large, or if N is not specified + Go to line N in the file, default the end of the file. (Warn- + ing: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.) - ESC-G Same as G, except if no number N is specified and the input is - standard input, goes to the last line which is currently + ESC-G Same as G, except if no number N is specified and the input is + standard input, goes to the last line which is currently buffered. p or % Go to a position N percent into the file. N should be between 0 @@ -142,96 +139,96 @@ LESS(1) General Commands Manual P Go to the line containing byte offset N in the file. { If a left curly bracket appears in the top line displayed on the - screen, the { command will go to the matching right curly - bracket. The matching right curly bracket is positioned on the + screen, the { command will go to the matching right curly + bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly - bracket on the top line, a number N may be used to specify the + bracket on the top line, a number N may be used to specify the N-th bracket on the line. } If a right curly bracket appears in the bottom line displayed on - the screen, the } command will go to the matching left curly - bracket. The matching left curly bracket is positioned on the - top line of the screen. If there is more than one right curly - bracket on the top line, a number N may be used to specify the + the screen, the } command will go to the matching left curly + bracket. The matching left curly bracket is positioned on the + top line of the screen. If there is more than one right curly + bracket on the top line, a number N may be used to specify the N-th bracket on the line. ( Like {, but applies to parentheses rather than curly brackets. ) Like }, but applies to parentheses rather than curly brackets. - [ Like {, but applies to square brackets rather than curly brack- + [ Like {, but applies to square brackets rather than curly brack- ets. - ] Like }, but applies to square brackets rather than curly brack- + ] Like }, but applies to square brackets rather than curly brack- ets. - ESC-^F Followed by two characters, acts like {, but uses the two char- - acters as open and close brackets, respectively. For example, - "ESC ^F < >" could be used to go forward to the > which matches + ESC-^F Followed by two characters, acts like {, but uses the two char- + acters as open and close brackets, respectively. For example, + "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line. - ESC-^B Followed by two characters, acts like }, but uses the two char- - acters as open and close brackets, respectively. For example, + ESC-^B Followed by two characters, acts like }, but uses the two char- + acters as open and close brackets, respectively. For example, "ESC ^B < >" could be used to go backward to the < which matches the > in the bottom displayed line. - m Followed by any lowercase or uppercase letter, marks the first - displayed line with that letter. If the status column is - enabled via the -J option, the status column shows the marked + m Followed by any lowercase or uppercase letter, marks the first + displayed line with that letter. If the status column is en- + abled via the -J option, the status column shows the marked line. - M Acts like m, except the last displayed line is marked rather + M Acts like m, except the last displayed line is marked rather than the first displayed line. - ' (Single quote.) Followed by any lowercase or uppercase letter, - returns to the position which was previously marked with that - letter. Followed by another single quote, returns to the posi- - tion at which the last "large" movement command was executed. - Followed by a ^ or $, jumps to the beginning or end of the file - respectively. Marks are preserved when a new file is examined, + ' (Single quote.) Followed by any lowercase or uppercase letter, + returns to the position which was previously marked with that + letter. Followed by another single quote, returns to the posi- + tion at which the last "large" movement command was executed. + Followed by a ^ or $, jumps to the beginning or end of the file + respectively. Marks are preserved when a new file is examined, so the ' command can be used to switch between input files. ^X^X Same as single quote. - ESC-m Followed by any lowercase or uppercase letter, clears the mark + ESC-m Followed by any lowercase or uppercase letter, clears the mark identified by that letter. /pattern Search forward in the file for the N-th line containing the pat- tern. N defaults to 1. The pattern is a regular expression, as - recognized by the regular expression library supplied by your - system. The search starts at the first line displayed (but see + recognized by the regular expression library supplied by your + system. The search starts at the first line displayed (but see the -a and -j options, which change this). - Certain characters are special if entered at the beginning of - the pattern; they modify the type of search rather than become + Certain characters are special if entered at the beginning of + the pattern; they modify the type of search rather than become part of the pattern: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Oct 24 05:26:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3BA743BA52; Sat, 24 Oct 2020 05:26:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ8jb4Gnyz4430; Sat, 24 Oct 2020 05:26:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C719132F1; Sat, 24 Oct 2020 05:26:59 +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 09O5Qxqf090760; Sat, 24 Oct 2020 05:26:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O5Qxla090759; Sat, 24 Oct 2020 05:26:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010240526.09O5Qxla090759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 24 Oct 2020 05:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r366991 - vendor/less/v563 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/less/v563 X-SVN-Commit-Revision: 366991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 05:26:59 -0000 Author: delphij Date: Sat Oct 24 05:26:58 2020 New Revision: 366991 URL: https://svnweb.freebsd.org/changeset/base/366991 Log: Tag less v563. Added: vendor/less/v563/ - copied from r366990, vendor/less/dist/ From owner-svn-src-all@freebsd.org Sat Oct 24 05:52:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5FEC43C988; Sat, 24 Oct 2020 05:52:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJ9H23yqhz454K; Sat, 24 Oct 2020 05:52:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 698DE13DAB; Sat, 24 Oct 2020 05:52:30 +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 09O5qU72009227; Sat, 24 Oct 2020 05:52:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09O5qUZi009226; Sat, 24 Oct 2020 05:52:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202010240552.09O5qUZi009226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 24 Oct 2020 05:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366992 - head/usr.bin/nfsstat X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/nfsstat X-SVN-Commit-Revision: 366992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 05:52:30 -0000 Author: asomers Date: Sat Oct 24 05:52:29 2020 New Revision: 366992 URL: https://svnweb.freebsd.org/changeset/base/366992 Log: nfsstat: delete unused fields Ever since r192762 nfsstat has included a few fields whose values were always 0. They were copied from OpenBSD, but have never been used on FreeBSD. Don't display them. Reviewed by: rmacklem Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26920 Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sat Oct 24 05:26:58 2020 (r366991) +++ head/usr.bin/nfsstat/nfsstat.c Sat Oct 24 05:52:29 2020 (r366992) @@ -450,12 +450,7 @@ intpr(int clientOnly, int serverOnly) xo_close_container("operations"); xo_open_container("server"); - xo_emit("{T:Server Re-Failed}\n"); - xo_emit("{:retfailed/%16ju}\n", (uintmax_t)ext_nfsstats.srvrpc_errs); - xo_emit("{T:Server Faults}\n"); - xo_emit("{:faults/%13ju}\n", (uintmax_t)ext_nfsstats.srv_errs); - xo_emit("{T:Server Write Gathering:/%13.13s}\n"); xo_emit("{T:WriteOps/%13.13s}{T:WriteRPC/%13.13s}" @@ -473,12 +468,10 @@ intpr(int clientOnly, int serverOnly) xo_open_container("cache"); xo_emit("{T:Server Cache Stats:/%13.13s}\n"); - xo_emit("{T:Inprog/%13.13s}{T:Idem/%13.13s}" + xo_emit("{T:Inprog/%13.13s}" "{T:Non-Idem/%13.13s}{T:Misses/%13.13s}\n"); - xo_emit("{:inprog/%13ju}{:idem/%13ju}" - "{:nonidem/%13ju}{:misses/%13ju}\n", + xo_emit("{:inprog/%13ju}{:nonidem/%13ju}{:misses/%13ju}\n", (uintmax_t)ext_nfsstats.srvcache_inproghits, - (uintmax_t)ext_nfsstats.srvcache_idemdonehits, (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits, (uintmax_t)ext_nfsstats.srvcache_misses); xo_close_container("cache"); @@ -1057,17 +1050,12 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) if (printtitle) xo_emit("{T:Server:}\n"); xo_open_container("server"); - xo_emit("{T:Retfailed/%13.13s}{T:Faults/%13.13s}" - "{T:Clients/%13.13s}\n"); - xo_emit("{:retfailed/%13ju}{:faults/%13ju}{:clients/%13ju}\n", - (uintmax_t)ext_nfsstats.srv_errs, - (uintmax_t)ext_nfsstats.srvrpc_errs, - (uintmax_t)ext_nfsstats.srvclients); - xo_emit("{T:OpenOwner/%13.13s}{T:Opens/%13.13s}" - "{T:LockOwner/%13.13s}{T:Locks/%13.13s}" + xo_emit("{T:Clients/%13.13s}{T:OpenOwner/%13.13s}" + "{T:Opens/%13.13s}{T:LockOwner/%13.13s}{T:Locks/%13.13s}" "{T:Delegs/%13.13s}\n"); - xo_emit("{:openowner/%13ju}{:opens/%13ju}{:lockowner/%13ju}" - "{:locks/%13ju}{:delegs/%13ju}\n", + xo_emit("{:clients/%13ju}{:openowner/%13ju}{:opens/%13ju}" + "{:lockowner/%13ju}{:locks/%13ju}{:delegs/%13ju}\n", + (uintmax_t)ext_nfsstats.srvclients, (uintmax_t)ext_nfsstats.srvopenowners, (uintmax_t)ext_nfsstats.srvopens, (uintmax_t)ext_nfsstats.srvlockowners, @@ -1078,13 +1066,12 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) if (printtitle) xo_emit("{T:Server Cache Stats:}\n"); xo_open_container("cache"); - xo_emit("{T:Inprog/%13.13s}{T:Idem/%13.13s}" + xo_emit("{T:Inprog/%13.13s}" "{T:Non-idem/%13.13s}{T:Misses/%13.13s}" "{T:CacheSize/%13.13s}{T:TCPPeak/%13.13s}\n"); - xo_emit("{:inprog/%13ju}{:idem/%13ju}{:nonidem/%13ju}" + xo_emit("{:inprog/%13ju}{:nonidem/%13ju}" "{:misses/%13ju}{:cachesize/%13ju}{:tcppeak/%13ju}\n", (uintmax_t)ext_nfsstats.srvcache_inproghits, - (uintmax_t)ext_nfsstats.srvcache_idemdonehits, (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits, (uintmax_t)ext_nfsstats.srvcache_misses, (uintmax_t)ext_nfsstats.srvcache_size, From owner-svn-src-all@freebsd.org Sat Oct 24 07:48:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD49643FCED; Sat, 24 Oct 2020 07:48:49 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from ravenloft.kiev.ua (ravenloft.kiev.ua [94.244.131.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJCsF2gzBz4CVd; Sat, 24 Oct 2020 07:48:49 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Date: Sat, 24 Oct 2020 09:48:40 +0200 From: Alex Kozlov To: Stefan =?iso-8859-1?Q?E=DFer?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366962 - in head: include usr.bin/calendar Message-ID: <20201024074840.GA26119@ravenloft.kiev.ua> References: <202010230922.09N9MNZu040921@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202010230922.09N9MNZu040921@repo.freebsd.org> X-Rspamd-Queue-Id: 4CJCsF2gzBz4CVd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34743, ipnet:94.244.128.0/18, country:UA] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 07:48:49 -0000 On Fri, Oct 23, 2020 at 09:22:23AM +0000, Stefan Eßer wrote: > Author: se > Date: Fri Oct 23 09:22:23 2020 > New Revision: 366962 > URL: https://svnweb.freebsd.org/changeset/base/366962 > > Log: > Add search of LOCALBASE/share/calendar for calendars supplied by a port. > > Calendar files in LOCALBASE override similarily named ones in the base > system. This could easily be changed if the base system calendars should > have precedence, but it could lead to a violation of POLA since then the > port's files were ignored unless those in base have been deleted. > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease > a consistent modification of this prefix. You are hardcoding assumption that LOCALBASE = /usr/local. Please make it overridable with LOCALBASE environment variable. > Reviewed by: imp, pfg > Differential Revision: https://reviews.freebsd.org/D26882 > > Modified: > head/include/paths.h > head/usr.bin/calendar/io.c > head/usr.bin/calendar/pathnames.h > > Modified: head/include/paths.h > ============================================================================== > --- head/include/paths.h Fri Oct 23 08:44:53 2020 (r366961) > +++ head/include/paths.h Fri Oct 23 09:22:23 2020 (r366962) > @@ -37,8 +37,11 @@ > > #include > > +#define _PATH_LOCALBASE "/usr/local" > + > /* Default search path. */ > -#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" -- Alex From owner-svn-src-all@freebsd.org Sat Oct 24 09:52:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1825443711; Sat, 24 Oct 2020 09:52:33 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJGc06Ygzz4Ktc; Sat, 24 Oct 2020 09:52:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6EB71260203; Sat, 24 Oct 2020 11:52:29 +0200 (CEST) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Warner Losh , Kyle Evans Cc: Niclas Zeising , "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> From: Hans Petter Selasky Message-ID: Date: Sat, 24 Oct 2020 11:51:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CJGc06Ygzz4Ktc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.78 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.951]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.48)[-0.478]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.05)[-1.053]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 09:52:33 -0000 On 2020-10-24 02:13, Warner Losh wrote: > I was going to suggest and try this change, but life has been complicated... > > Has it been committed? > No, not yet. --HPS From owner-svn-src-all@freebsd.org Sat Oct 24 10:23:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F8224441CA; Sat, 24 Oct 2020 10:23:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJHHZ3JhHz4MYV; Sat, 24 Oct 2020 10:23:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5633816AFF; Sat, 24 Oct 2020 10:23:22 +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 09OANMIP075641; Sat, 24 Oct 2020 10:23:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OANMcL075640; Sat, 24 Oct 2020 10:23:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010241023.09OANMcL075640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 24 Oct 2020 10:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366993 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 10:23:22 -0000 Author: hselasky Date: Sat Oct 24 10:23:21 2020 New Revision: 366993 URL: https://svnweb.freebsd.org/changeset/base/366993 Log: Run code through "clang-format -style=file" with some additional fixes. No functional change. Suggested by: kib@ and emaste@ Differential Revision: https://reviews.freebsd.org/D26254 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c ============================================================================== --- head/sys/net/if_infiniband.c Sat Oct 24 05:52:29 2020 (r366992) +++ head/sys/net/if_infiniband.c Sat Oct 24 10:23:21 2020 (r366993) @@ -30,44 +30,42 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include +#include #include +#include +#include +#include #include #include -#include -#include +#include -#include -#include -#include +#include #include #include -#include -#include -#include +#include +#include #include -#include #include #include - -#include +#include +#include +#include +#include #include +#include #include - #include #include #include /* if_lagg(4) support */ -struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); +struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); #ifdef INET static inline void -infiniband_ipv4_multicast_map(uint32_t addr, - const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv4_multicast_map( + uint32_t addr, const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, #ifdef INET6 static inline void -infiniband_ipv6_multicast_map(const struct in6_addr *addr, - const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv6_multicast_map( + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -128,7 +126,7 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb { struct infiniband_header *ibh; struct ether_header eh; - + if (mb->m_len < sizeof(*ibh)) return; @@ -198,7 +196,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c if (error) { if (error == EWOULDBLOCK) error = 0; - m = NULL; /* mbuf is consumed by resolver */ + m = NULL; /* mbuf is consumed by resolver */ goto bad; } } @@ -265,7 +263,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c if (error) { if (error == EWOULDBLOCK) error = 0; - m = NULL; /* mbuf is consumed by resolver */ + m = NULL; /* mbuf is consumed by resolver */ goto bad; } } @@ -410,8 +408,8 @@ done: } static int -infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, - struct sockaddr *sa) +infiniband_resolvemulti( + struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) { struct sockaddr_dl *sdl; #ifdef INET @@ -442,8 +440,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); sdl->sdl_alen = INFINIBAND_ADDR_LEN; e_addr = LLADDR(sdl); - infiniband_ipv4_multicast_map(sin->sin_addr.s_addr, ifp->if_broadcastaddr, - e_addr); + infiniband_ipv4_multicast_map( + sin->sin_addr.s_addr, ifp->if_broadcastaddr, e_addr); *llsa = (struct sockaddr *)sdl; return (0); #endif @@ -462,7 +460,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); sdl->sdl_alen = INFINIBAND_ADDR_LEN; e_addr = LLADDR(sdl); - infiniband_ipv6_multicast_map(&sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); + infiniband_ipv6_multicast_map( + &sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); *llsa = (struct sockaddr *)sdl; return (0); #endif @@ -487,7 +486,7 @@ infiniband_ifattach(struct ifnet *ifp, const uint8_t * ifp->if_resolvemulti = infiniband_resolvemulti; if (ifp->if_baudrate == 0) - ifp->if_baudrate = IF_Gbps(10); /* default value */ + ifp->if_baudrate = IF_Gbps(10); /* default value */ if (llb != NULL) ifp->if_broadcastaddr = llb; From owner-svn-src-all@freebsd.org Sat Oct 24 10:46:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F407D444D0E; Sat, 24 Oct 2020 10:46:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJHpX3QCVz4NhB; Sat, 24 Oct 2020 10:46:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09OAkSVP048836 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 24 Oct 2020 13:46:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09OAkSVP048836 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09OAkSGs048835; Sat, 24 Oct 2020 13:46:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 24 Oct 2020 13:46:28 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366993 - head/sys/net Message-ID: <20201024104628.GB2643@kib.kiev.ua> References: <202010241023.09OANMcL075640@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010241023.09OANMcL075640@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CJHpX3QCVz4NhB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 10:46:45 -0000 On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Oct 24 10:23:21 2020 > New Revision: 366993 > URL: https://svnweb.freebsd.org/changeset/base/366993 > > Log: > Run code through "clang-format -style=file" with some additional fixes. > No functional change. > > Suggested by: kib@ and emaste@ > Differential Revision: https://reviews.freebsd.org/D26254 > MFC after: 1 week > Sponsored by: Mellanox Technologies // NVIDIA Networking > > Modified: > head/sys/net/if_infiniband.c > > Modified: head/sys/net/if_infiniband.c > ============================================================================== > --- head/sys/net/if_infiniband.c Sat Oct 24 05:52:29 2020 (r366992) > +++ head/sys/net/if_infiniband.c Sat Oct 24 10:23:21 2020 (r366993) > @@ -30,44 +30,42 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include > -#include > -#include sys/systm.h should come right after sys/param.h. These two headers are exceptions to the normal alphabetical rule. > +#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 > > /* if_lagg(4) support */ > -struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); > +struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); > > #ifdef INET > static inline void > -infiniband_ipv4_multicast_map(uint32_t addr, > - const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv4_multicast_map( > + uint32_t addr, const uint8_t *broadcast, uint8_t *buf) And this is arguably regression, we fill line up to columns 72-80 before splitting to the continuation line. > { > uint8_t scope; > > @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > > #ifdef INET6 > static inline void > -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > - const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv6_multicast_map( > + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > { > uint8_t scope; > > @@ -128,7 +126,7 @@ infiniband_bpf_mtap(struct ifnet *ifp, struct mbuf *mb > { > struct infiniband_header *ibh; > struct ether_header eh; > - > + > if (mb->m_len < sizeof(*ibh)) > return; > > @@ -198,7 +196,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c > if (error) { > if (error == EWOULDBLOCK) > error = 0; > - m = NULL; /* mbuf is consumed by resolver */ > + m = NULL; /* mbuf is consumed by resolver */ This is a regression as well, in-line comment is typically preceeded by tab. > goto bad; > } > } > @@ -265,7 +263,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, c > if (error) { > if (error == EWOULDBLOCK) > error = 0; > - m = NULL; /* mbuf is consumed by resolver */ > + m = NULL; /* mbuf is consumed by resolver */ > goto bad; > } > } > @@ -410,8 +408,8 @@ done: > } > > static int > -infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, > - struct sockaddr *sa) > +infiniband_resolvemulti( > + struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) > { > struct sockaddr_dl *sdl; > #ifdef INET > @@ -442,8 +440,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock > sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); > sdl->sdl_alen = INFINIBAND_ADDR_LEN; > e_addr = LLADDR(sdl); > - infiniband_ipv4_multicast_map(sin->sin_addr.s_addr, ifp->if_broadcastaddr, > - e_addr); > + infiniband_ipv4_multicast_map( > + sin->sin_addr.s_addr, ifp->if_broadcastaddr, e_addr); > *llsa = (struct sockaddr *)sdl; > return (0); > #endif > @@ -462,7 +460,8 @@ infiniband_resolvemulti(struct ifnet *ifp, struct sock > sdl = link_init_sdl(ifp, *llsa, IFT_INFINIBAND); > sdl->sdl_alen = INFINIBAND_ADDR_LEN; > e_addr = LLADDR(sdl); > - infiniband_ipv6_multicast_map(&sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); > + infiniband_ipv6_multicast_map( > + &sin6->sin6_addr, ifp->if_broadcastaddr, e_addr); > *llsa = (struct sockaddr *)sdl; > return (0); > #endif > @@ -487,7 +486,7 @@ infiniband_ifattach(struct ifnet *ifp, const uint8_t * > ifp->if_resolvemulti = infiniband_resolvemulti; > > if (ifp->if_baudrate == 0) > - ifp->if_baudrate = IF_Gbps(10); /* default value */ > + ifp->if_baudrate = IF_Gbps(10); /* default value */ > if (llb != NULL) > ifp->if_broadcastaddr = llb; > From owner-svn-src-all@freebsd.org Sat Oct 24 10:52:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6126E444EBD; Sat, 24 Oct 2020 10:52:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJHwp2253z4P22; Sat, 24 Oct 2020 10:52:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A0DE17888; Sat, 24 Oct 2020 10:52:10 +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 09OAqAaW091797; Sat, 24 Oct 2020 10:52:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OAqAUZ091796; Sat, 24 Oct 2020 10:52:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010241052.09OAqAUZ091796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 24 Oct 2020 10:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366994 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 10:52:10 -0000 Author: hselasky Date: Sat Oct 24 10:52:09 2020 New Revision: 366994 URL: https://svnweb.freebsd.org/changeset/base/366994 Log: Fix order of header files: sys/systm.h should come right after sys/param.h Suggested by: kib@ Differential Revision: https://reviews.freebsd.org/D26254 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c ============================================================================== --- head/sys/net/if_infiniband.c Sat Oct 24 10:23:21 2020 (r366993) +++ head/sys/net/if_infiniband.c Sat Oct 24 10:52:09 2020 (r366994) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -37,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Sat Oct 24 10:52:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FB02445245; Sat, 24 Oct 2020 10:52:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJHx60JzVz4PFb; Sat, 24 Oct 2020 10:52:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7D5222601CA; Sat, 24 Oct 2020 12:52:24 +0200 (CEST) Subject: Re: svn commit: r366993 - head/sys/net To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010241023.09OANMcL075640@repo.freebsd.org> <20201024104628.GB2643@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Sat, 24 Oct 2020 12:51:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201024104628.GB2643@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CJHx60JzVz4PFb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.85 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.94)[-0.939]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.59)[-0.587]; NEURAL_HAM_MEDIUM(-1.02)[-1.021]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 10:52:26 -0000 On 2020-10-24 12:46, Konstantin Belousov wrote: > sys/systm.h should come right after sys/param.h OK, fixed. --HPS From owner-svn-src-all@freebsd.org Sat Oct 24 12:52:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 903A54484D5; Sat, 24 Oct 2020 12:52:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJLbB3H7Tz4VyQ; Sat, 24 Oct 2020 12:52:06 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1603543926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DY17dSN5SGIFTfgtjE5floW7xxQaVGnldaldKOflv8M=; b=X2YifaXgMHfzE6JoOINl/5PDvp5l9KKw91JfXXDYDFdZMBOjJzLyrkSh3Me2n6wAWYiyJU +PPVyzAe/gmcjrBPx+tjbsjJcmm41mwAiVA71lWbmoQJQbzR3ueWwL1VPBjyFtNxNWlscx /835pCkY+ogwkWxrLuzr8StteZzAJPvDi6QFSuMszLJu9nw3q3Kio7SLyRtvAjR1hWIN4f WvoPq15AufZC8jbi5QPvPMTuWR55Mu5QgjR/PHCLp8nterGnUH3r3d27TalR3ut0l5RJ5r Xgfjerh9G7XZ6E+wH4N9Omz1Dtz3Wk4aj6UMwd4qrQM7KZec6cPXji/4KoeYzg== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 633B96CC1; Sat, 24 Oct 2020 12:52:06 +0000 (UTC) Date: Sat, 24 Oct 2020 12:52:06 +0000 From: Alexey Dokuchaev To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366993 - head/sys/net Message-ID: <20201024125206.GB38000@FreeBSD.org> References: <202010241023.09OANMcL075640@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010241023.09OANMcL075640@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1603543926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DY17dSN5SGIFTfgtjE5floW7xxQaVGnldaldKOflv8M=; b=qB6Tr4Ku8lSo/TI975MQi9Vkowl5p8slcEdB0dn7VYB9dsTHeDDVCQ28b/sMaKHJf/dOOJ gQbS6WhudHU3gy9plLbBKFsnCUFvtG5iXGWhzUdk2ZDucjSI9JnzbllaoZdkxDPFgXFiN6 E8tVeBJaX0Lc4WQF0ZaeaCOEjElkv+s2/+SOFog236depv6WH0JyilkfUdy6SNwrA7Y53z /+IxMvDEjB0W2Cu/UsYOCnoPBOUyV9GxsDkZwSPmcBrf/WVsn8g6jfg/cRZ5YPgVVDCUDG cANsoxFKqSG+SKXyEveLcbDQdw49T+y4kTn6Dah1eym53V4AEmu7jBKdMeHMpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1603543926; a=rsa-sha256; cv=none; b=Z/4+8qwdrc0gI8WBVb4MrFfgQT5RPiDtw4Wy1DxUrkxm9ZinKiyDt0na/hbMu/4By38i3n 82JGlc4bcn9jzWiMig06zyZQSXUhAhINswz+K5P42PV/k325xb6WYeE3B49S9XJdEeaYn/ 60ub3Oiq/b2yfu1xfSBy4u57SOvFHxnsm5zM8Hc/LlQkC5uAG4c+J+SMAQ8649MWppgJqm fVJuBfGa/LN3ylcdv7d1BI/90S9tsoGKl2tXY5DNAkZy0SfAgg9RA8Bm7+FaIckSicK975 xWUR4Sp8BM4wBfcrOaH3X9sth05onh2phoj7Ynqu8NggzaJZR75Xbgo+Uabm6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 12:52:06 -0000 On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: > New Revision: 366993 > URL: https://svnweb.freebsd.org/changeset/base/366993 > > Log: > Run code through "clang-format -style=file" with some additional fixes. > No functional change. > > ... > @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > > #ifdef INET6 > static inline void > -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > - const uint8_t *broadcast, uint8_t *buf) > +infiniband_ipv6_multicast_map( > + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > { This is not how we format these in FreeBSD, please revert. It was correct before and no "fix" is need here. ./danfe From owner-svn-src-all@freebsd.org Sat Oct 24 13:07:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD31C448D9D; Sat, 24 Oct 2020 13:07:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJLxL4fNgz4WWY; Sat, 24 Oct 2020 13:07:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82C591908B; Sat, 24 Oct 2020 13:07:50 +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 09OD7oBM075906; Sat, 24 Oct 2020 13:07:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OD7opi075905; Sat, 24 Oct 2020 13:07:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010241307.09OD7opi075905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 24 Oct 2020 13:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366995 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:07:50 -0000 Author: hselasky Date: Sat Oct 24 13:07:50 2020 New Revision: 366995 URL: https://svnweb.freebsd.org/changeset/base/366995 Log: More style fixes (partial revert of r366994). Suggested by: danfe@ Differential Revision: https://reviews.freebsd.org/D26254 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/net/if_infiniband.c Modified: head/sys/net/if_infiniband.c ============================================================================== --- head/sys/net/if_infiniband.c Sat Oct 24 10:52:09 2020 (r366994) +++ head/sys/net/if_infiniband.c Sat Oct 24 13:07:50 2020 (r366995) @@ -64,8 +64,8 @@ struct mbuf *(*lagg_input_infiniband_p)(struct ifnet * #ifdef INET static inline void -infiniband_ipv4_multicast_map( - uint32_t addr, const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv4_multicast_map(uint32_t addr, + const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -97,8 +97,8 @@ infiniband_ipv4_multicast_map( #ifdef INET6 static inline void -infiniband_ipv6_multicast_map( - const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) +infiniband_ipv6_multicast_map(const struct in6_addr *addr, + const uint8_t *broadcast, uint8_t *buf) { uint8_t scope; @@ -408,8 +408,8 @@ done: } static int -infiniband_resolvemulti( - struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) +infiniband_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, + struct sockaddr *sa) { struct sockaddr_dl *sdl; #ifdef INET From owner-svn-src-all@freebsd.org Sat Oct 24 13:08:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 445AA448F07; Sat, 24 Oct 2020 13:08:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJLxw0z21z4WrK; Sat, 24 Oct 2020 13:08:19 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4E69F260393; Sat, 24 Oct 2020 15:08:12 +0200 (CEST) Subject: Re: svn commit: r366993 - head/sys/net To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010241023.09OANMcL075640@repo.freebsd.org> <20201024125206.GB38000@FreeBSD.org> From: Hans Petter Selasky Message-ID: <999a005e-1ef8-3c45-fb07-94a3b6ebce1b@selasky.org> Date: Sat, 24 Oct 2020 15:07:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201024125206.GB38000@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CJLxw0z21z4WrK X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-0.95)[-0.953]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.975]; NEURAL_HAM_SHORT(-0.52)[-0.516]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:08:21 -0000 On 2020-10-24 14:52, Alexey Dokuchaev wrote: > On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: >> New Revision: 366993 >> URL: https://svnweb.freebsd.org/changeset/base/366993 >> >> Log: >> Run code through "clang-format -style=file" with some additional fixes. >> No functional change. >> >> ... >> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, >> >> #ifdef INET6 >> static inline void >> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, >> - const uint8_t *broadcast, uint8_t *buf) >> +infiniband_ipv6_multicast_map( >> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) >> { > > This is not how we format these in FreeBSD, please revert. It was correct > before and no "fix" is need here. Done. --HPS From owner-svn-src-all@freebsd.org Sat Oct 24 13:16:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BD0A4490F6; Sat, 24 Oct 2020 13:16:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJM6y6Sxmz4XkR; Sat, 24 Oct 2020 13:16:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2DE0192AE; Sat, 24 Oct 2020 13:16:10 +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 09ODGA6w082337; Sat, 24 Oct 2020 13:16:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ODGAfN082336; Sat, 24 Oct 2020 13:16:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010241316.09ODGAfN082336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 24 Oct 2020 13:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366996 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 366996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:16:11 -0000 Author: hselasky Date: Sat Oct 24 13:16:10 2020 New Revision: 366996 URL: https://svnweb.freebsd.org/changeset/base/366996 Log: Implement xa_init() in the LinuxKPI as a wrapper for xa_init_flags(). MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/xarray.h Modified: head/sys/compat/linuxkpi/common/include/linux/xarray.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/xarray.h Sat Oct 24 13:07:50 2020 (r366995) +++ head/sys/compat/linuxkpi/common/include/linux/xarray.h Sat Oct 24 13:16:10 2020 (r366996) @@ -91,4 +91,10 @@ xa_err(void *ptr) return (PTR_ERR_OR_ZERO(ptr)); } +static inline void +xa_init(struct xarray *xa) +{ + xa_init_flags(xa, 0); +} + #endif /* _LINUX_XARRAY_H_ */ From owner-svn-src-all@freebsd.org Sat Oct 24 13:30:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCEF3449AA8; Sat, 24 Oct 2020 13:30:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJMRd56K8z4YL4; Sat, 24 Oct 2020 13:30:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 934001942E; Sat, 24 Oct 2020 13:30: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 09ODUbjh089522; Sat, 24 Oct 2020 13:30:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ODUb6x089521; Sat, 24 Oct 2020 13:30:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010241330.09ODUb6x089521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 13:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366997 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:30:37 -0000 Author: mjg Date: Sat Oct 24 13:30:37 2020 New Revision: 366997 URL: https://svnweb.freebsd.org/changeset/base/366997 Log: vfs: fix a race where reclaim vholds freed vnodes Reported by: pho Tested by: pho (previous version) Fixes: r366974 ("vfs: stop taking the interlock in vnode reclaim") Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Oct 24 13:16:10 2020 (r366996) +++ head/sys/kern/vfs_subr.c Sat Oct 24 13:30:37 2020 (r366997) @@ -109,6 +109,7 @@ static void syncer_shutdown(void *arg, int howto); static int vtryrecycle(struct vnode *vp); static void v_init_counters(struct vnode *); static void vgonel(struct vnode *); +static bool vhold_recycle(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); static void vfs_knl_assert_locked(void *arg); @@ -1126,7 +1127,8 @@ restart: goto next_iter; } - vhold(vp); + if (!vhold_recycle(vp)) + goto next_iter; TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); mtx_unlock(&vnode_list_mtx); @@ -1231,7 +1233,8 @@ restart: if (__predict_false(vp->v_type == VBAD || vp->v_type == VNON)) { continue; } - vhold(vp); + if (!vhold_recycle(vp)) + continue; count--; mtx_unlock(&vnode_list_mtx); vtryrecycle(vp); @@ -3248,13 +3251,11 @@ vholdnz(struct vnode *vp) * However, while this is more performant, it hinders debugging by eliminating * the previously mentioned invariant. */ -bool -vhold_smr(struct vnode *vp) +static bool __always_inline +_vhold_cond(struct vnode *vp) { int count; - VFS_SMR_ASSERT_ENTERED(); - count = atomic_load_int(&vp->v_holdcnt); for (;;) { if (count & VHOLD_NO_SMR) { @@ -3270,6 +3271,28 @@ vhold_smr(struct vnode *vp) return (true); } } +} + +bool +vhold_smr(struct vnode *vp) +{ + + VFS_SMR_ASSERT_ENTERED(); + return (_vhold_cond(vp)); +} + +/* + * Special case for vnode recycling. + * + * Vnodes are present on the global list until UMA takes them out. + * Attempts to recycle only need the relevant lock and have no use for SMR. + */ +static bool +vhold_recycle(struct vnode *vp) +{ + + mtx_assert(&vnode_list_mtx, MA_OWNED); + return (_vhold_cond(vp)); } static void __noinline From owner-svn-src-all@freebsd.org Sat Oct 24 13:31:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06723449B20; Sat, 24 Oct 2020 13:31:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJMSY4fN9z4YlY; Sat, 24 Oct 2020 13:31:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8390018F78; Sat, 24 Oct 2020 13:31:25 +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 09ODVPGQ094209; Sat, 24 Oct 2020 13:31:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ODVPmB094208; Sat, 24 Oct 2020 13:31:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010241331.09ODVPmB094208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 13:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366998 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:31:26 -0000 Author: mjg Date: Sat Oct 24 13:31:25 2020 New Revision: 366998 URL: https://svnweb.freebsd.org/changeset/base/366998 Log: cache: add the missing NC_NOMAKEENTRY and NC_KEEPPOSENTRY to lockless lookup They are de facto ignored. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 13:30:37 2020 (r366997) +++ head/sys/kern/vfs_cache.c Sat Oct 24 13:31:25 2020 (r366998) @@ -3700,8 +3700,9 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ - (LOCKLEAF | LOCKPARENT | WANTPARENT | NOCACHE | FOLLOW | LOCKSHARED | SAVENAME | \ - SAVESTART | WILLBEDIR | ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) + (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ + FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | ISOPEN | \ + NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) From owner-svn-src-all@freebsd.org Sat Oct 24 13:31:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAA304499DC; Sat, 24 Oct 2020 13:31:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJMSs3tJ5z4Ypg; Sat, 24 Oct 2020 13:31:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65F5518F7C; Sat, 24 Oct 2020 13:31:41 +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 09ODVfNd094264; Sat, 24 Oct 2020 13:31:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ODVfXC094262; Sat, 24 Oct 2020 13:31:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010241331.09ODVfXC094262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 24 Oct 2020 13:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366999 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:31:41 -0000 Author: mjg Date: Sat Oct 24 13:31:40 2020 New Revision: 366999 URL: https://svnweb.freebsd.org/changeset/base/366999 Log: cache: assorted typo fixes Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 24 13:31:25 2020 (r366998) +++ head/sys/kern/vfs_cache.c Sat Oct 24 13:31:40 2020 (r366999) @@ -188,7 +188,7 @@ TAILQ_HEAD(cache_freebatch, namecache); * Regardless of the above, use of dedicated zones instead of malloc may be * inducing additional waste. This may be hard to address as said zones are * tied to VFS SMR. Even if retaining them, the current split should be - * reevaluated. + * re-evaluated. */ #ifdef __LP64__ #define CACHE_PATH_CUTOFF 45 @@ -597,7 +597,7 @@ cache_alloc(int len, bool ts) * Avoid blowout in namecache entries. * * Bugs: - * 1. filesystems may end up tryng to add an already existing entry + * 1. filesystems may end up trying to add an already existing entry * (for example this can happen after a cache miss during concurrent * lookup), in which case we will call cache_neg_evict despite not * adding anything. @@ -3285,12 +3285,12 @@ vn_fullpath_any(struct vnode *vp, struct vnode *rdir, /* * Resolve an arbitrary vnode to a pathname (taking care of hardlinks). * - * Since the namecache does not track handlings, the caller is expected to first + * Since the namecache does not track hardlinks, the caller is expected to first * look up the target vnode with SAVENAME | WANTPARENT flags passed to namei. * * Then we have 2 cases: * - if the found vnode is a directory, the path can be constructed just by - * fullowing names up the chain + * following names up the chain * - otherwise we populate the buffer with the saved name and start resolving * from the parent */ @@ -3327,7 +3327,7 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret * populate part of the buffer and descend to vn_fullpath_dir with * vp == vp_crossmp. Prevent the problem by checking for VBAD. * - * This should be atomic_load(&vp->v_type) but it is ilegal to take + * This should be atomic_load(&vp->v_type) but it is illegal to take * an address of a bit field, even if said field is sized to char. * Work around the problem by reading the value into a full-sized enum * and then re-reading it with atomic_load which will still prevent From owner-svn-src-all@freebsd.org Sat Oct 24 13:38:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46535449DC6; Sat, 24 Oct 2020 13:38:21 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJMcW5QdWz4ZNZ; Sat, 24 Oct 2020 13:38:19 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward501j.mail.yandex.net (Yandex) with ESMTP id 8FB94338016C; Sat, 24 Oct 2020 16:38:14 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback8g.mail.yandex.net (mxback/Yandex) with ESMTP id Jw6UX2hoTg-cDpeMpZx; Sat, 24 Oct 2020 16:38:13 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1603546693; bh=3QA//zdEhZE5MD4I1wkxXVEw32ck/3SNpF+wV96sM5A=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=R4rPs8b3TCoEtNehsnSxgfh9ref857kzIXCBpLLEAKgl3R2OVs3+KlqrdkAqRTtNx apEXRxtxPvSzsoVjN6uf3EzDRj/jw1G3hGxc9YCeccNcI2ZJCQBtGOt+v7mfbUYrnj zX90+oc16GQIO6CtWG+4f+1KxRA6ipzg9cXXpwMA= Received: by sas1-ffdbcd5f1d77.qloud-c.yandex.net with HTTP; Sat, 24 Oct 2020 16:38:12 +0300 From: Alexander V. Chernikov To: Hans Petter Selasky , Alexey Dokuchaev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <999a005e-1ef8-3c45-fb07-94a3b6ebce1b@selasky.org> References: <202010241023.09OANMcL075640@repo.freebsd.org> <20201024125206.GB38000@FreeBSD.org> <999a005e-1ef8-3c45-fb07-94a3b6ebce1b@selasky.org> Subject: Re: svn commit: r366993 - head/sys/net MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 24 Oct 2020 14:38:12 +0100 Message-Id: <317231603546378@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4CJMcW5QdWz4ZNZ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=R4rPs8b3; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:801:2::111 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.90 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0::/52]; NEURAL_HAM_LONG(-0.96)[-0.956]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_MEDIUM(-1.09)[-1.089]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; NEURAL_HAM_SHORT(-1.26)[-1.258]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:801:2::111:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 13:38:21 -0000 24.10.2020, 14:08, "Hans Petter Selasky" : > On 2020-10-24 14:52, Alexey Dokuchaev wrote: >>  On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: >>>  New Revision: 366993 >>>  URL: https://svnweb.freebsd.org/changeset/base/366993 >>> >>>  Log: >>>     Run code through "clang-format -style=file" with some additional fixes. >>>     No functional change. >>> >>>  ... >>>  @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, >>> >>>    #ifdef INET6 >>>    static inline void >>>  -infiniband_ipv6_multicast_map(const struct in6_addr *addr, >>>  - const uint8_t *broadcast, uint8_t *buf) >>>  +infiniband_ipv6_multicast_map( >>>  + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) >>>    { >> >>  This is not how we format these in FreeBSD, please revert. It was correct >>  before and no "fix" is need here. Given we already have nice .clang-format, that does most of the job, maybe it's worth considering looking into tweaking it further to fix this part? It would be nice if we could finally offload all formatting issues to the tool and focus on the actual code :-) > Done. > > --HPS From owner-svn-src-all@freebsd.org Sat Oct 24 14:09:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0F7144A5BD; Sat, 24 Oct 2020 14:09:47 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJNJq5b8vz4b6k; Sat, 24 Oct 2020 14:09:47 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1603548587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A+mBUfjq3YEnBn2jJ4GHiidqc5JAvqh9tEDcnvz7gNU=; b=aRU9Ix9CWTlEJQNIzp9/EomaHTh9gHuD40rbnWjk06V2ZX4I4oKalcJPd3Rua9WJfRuxFY VycdoL4CMgjkduLlEQbyDvRgj7haFndCc+KXzcATaNFciAEXPPt4Lbntb2JRMz6BE74Iw7 iOkKs5mpWDYEExv9RUOWUcY6+eG0CMor7+BKxNI2Fg6/hFCdXjLzjJ4RLEdeZkvmjnyxxP BcHXMhNT9NHFc0Uhwz52v5MKlGVHlICJCYlC8+7nZlZqoT0iGGr3Nn01fJYkijiLb84FUj nk/r8Ghb6VahYO3V5REpr1Ihr3mcbRHGyR6rSEKEzb2tYx51jqPCs64b4da/4w== Received: by freefall.freebsd.org (Postfix, from userid 1033) id B23F07EE4; Sat, 24 Oct 2020 14:09:47 +0000 (UTC) Date: Sat, 24 Oct 2020 14:09:47 +0000 From: Alexey Dokuchaev To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366995 - head/sys/net Message-ID: <20201024140947.GA41396@FreeBSD.org> References: <202010241307.09OD7opi075905@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010241307.09OD7opi075905@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1603548587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A+mBUfjq3YEnBn2jJ4GHiidqc5JAvqh9tEDcnvz7gNU=; b=iMySvuBeHC9qUJtXKOvr2Spt5zRIMPbtaPpsNFsZDnCSjT2HPkpdeQIDH7iitqcEIrFJGX fxOc1jWiOsyZGk/D70Q9dgIg32JRtowScQto2h+ksqVkBgYgfNwRMQ6t+3note2VVmOLxi 400WGARy6Zrv2YxeDyTme+02ljvEckUcH9pKtRbgxKxuUJIsAgTU4T/2fYe77n4XcfEotQ dvX9GNUvyav6pPHoEobAr+bE5IbDq8wCm1/fJ89tGXZHQw3pOnZLuWGiFbuZhIIywFL4GI Hd0P+JlPjQJH/3iGDFEK/Ff0mfRgYKjV8vvQ7aTMtJM6+KNNyivLmYA/L+qAOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1603548587; a=rsa-sha256; cv=none; b=bJdb1/oLskG9mJOFdnT/d5dxXQnUid3v15w1wLaWcdg3san6vu1Z7HiwHpwK6ZTZCTgEa8 ZSqR8dZHpNAod+bpZ0rH+f4FSpzjE+HCRVOZwWa9GstiHoZH8e5Ou3pZnV908RvQeK090c 45OGesa3fRN5b2FqkxW9uXf7puEVy2aSGkIZyPEmJ+LVcTZSjCEh9tHiZp8JR6D9n6bbzq 1ZrClbiyDGlXIJYEnNF2cLwXmK+2dAgEn9JI15KZefQUAAV6a1zG+hRxvAenWWCQCWwzfi KrFdb/0m/iyRNVkI52UqDGH7HEzSxAlgvl2irMwLqvH0myIBP7q6NMEde42fkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:09:48 -0000 On Sat, Oct 24, 2020 at 01:07:50PM +0000, Hans Petter Selasky wrote: > New Revision: 366995 > URL: https://svnweb.freebsd.org/changeset/base/366995 > > Log: > More style fixes (partial revert of r366994). Thank you Hans Petter, I appreciate it. ./danfe From owner-svn-src-all@freebsd.org Sat Oct 24 14:23:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B010E44AD81; Sat, 24 Oct 2020 14:23:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJNcx49sgz4c1H; Sat, 24 Oct 2020 14:23:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7312519E17; Sat, 24 Oct 2020 14:23:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OENjWY025832; Sat, 24 Oct 2020 14:23:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OENj4b025830; Sat, 24 Oct 2020 14:23:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010241423.09OENj4b025830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 24 Oct 2020 14:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367000 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 367000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:23:45 -0000 Author: trasz Date: Sat Oct 24 14:23:44 2020 New Revision: 367000 URL: https://svnweb.freebsd.org/changeset/base/367000 Log: Further improve prctl(2) debug. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26916 Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sat Oct 24 13:31:40 2020 (r366999) +++ head/sys/compat/linux/linux_misc.c Sat Oct 24 14:23:44 2020 (r367000) @@ -1949,6 +1949,10 @@ linux_prctl(struct thread *td, struct linux_prctl_args (void *)(register_t)args->arg2, sizeof(pdeath_signal))); break; + case LINUX_PR_SET_DUMPABLE: + linux_msg(td, "unsupported prctl PR_SET_DUMPABLE"); + error = EINVAL; + break; case LINUX_PR_GET_KEEPCAPS: /* * Indicate that we always clear the effective and @@ -2006,6 +2010,14 @@ linux_prctl(struct thread *td, struct linux_prctl_args /* * Same as returned by Linux without CONFIG_SECCOMP enabled. */ + error = EINVAL; + break; + case LINUX_PR_SET_NO_NEW_PRIVS: + linux_msg(td, "unsupported prctl PR_SET_NO_NEW_PRIVS"); + error = EINVAL; + break; + case LINUX_PR_SET_PTRACER: + linux_msg(td, "unsupported prctl PR_SET_PTRACER"); error = EINVAL; break; default: Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Sat Oct 24 13:31:40 2020 (r366999) +++ head/sys/compat/linux/linux_misc.h Sat Oct 24 14:23:44 2020 (r367000) @@ -50,12 +50,15 @@ * Second arg is a ptr to return the * signal. */ +#define LINUX_PR_SET_DUMPABLE 4 #define LINUX_PR_GET_KEEPCAPS 7 /* Get drop capabilities on setuid */ #define LINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */ #define LINUX_PR_SET_NAME 15 /* Set process name. */ #define LINUX_PR_GET_NAME 16 /* Get process name. */ #define LINUX_PR_GET_SECCOMP 21 #define LINUX_PR_SET_SECCOMP 22 +#define LINUX_PR_SET_NO_NEW_PRIVS 38 +#define LINUX_PR_SET_PTRACER 1499557217 #define LINUX_MAX_COMM_LEN 16 /* Maximum length of the process name. */ From owner-svn-src-all@freebsd.org Sat Oct 24 14:25:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93A1144AC2D; Sat, 24 Oct 2020 14:25:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJNg72hPnz4bwq; Sat, 24 Oct 2020 14:25:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F58E19C23; Sat, 24 Oct 2020 14:25:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OEPdmo025973; Sat, 24 Oct 2020 14:25:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OEPcaR025971; Sat, 24 Oct 2020 14:25:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010241425.09OEPcaR025971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 24 Oct 2020 14:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367001 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 367001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:25:39 -0000 Author: trasz Date: Sat Oct 24 14:25:38 2020 New Revision: 367001 URL: https://svnweb.freebsd.org/changeset/base/367001 Log: Tweak linux(4) socket(2) debug messages. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26900 Modified: head/sys/compat/linux/linux.h head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Sat Oct 24 14:23:44 2020 (r367000) +++ head/sys/compat/linux/linux.h Sat Oct 24 14:25:38 2020 (r367001) @@ -58,6 +58,10 @@ struct l_sockaddr { #define LINUX_AF_IPX 4 #define LINUX_AF_APPLETALK 5 #define LINUX_AF_INET6 10 +#define LINUX_AF_NETLINK 16 + +#define LINUX_NETLINK_ROUTE 0 +#define LINUX_NETLINK_UEVENT 15 /* * net device flags Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Oct 24 14:23:44 2020 (r367000) +++ head/sys/compat/linux/linux_socket.c Sat Oct 24 14:25:38 2020 (r367001) @@ -514,6 +514,20 @@ linux_socket(struct thread *td, struct linux_socket_ar return (retval_socket); domain = linux_to_bsd_domain(args->domain); if (domain == -1) { + if (args->domain == LINUX_AF_NETLINK && + args->protocol == LINUX_NETLINK_ROUTE) { + linux_msg(curthread, + "unsupported socket(AF_NETLINK, %d, NETLINK_ROUTE)", type); + return (EAFNOSUPPORT); + } + + if (args->domain == LINUX_AF_NETLINK && + args->protocol == LINUX_NETLINK_UEVENT) { + linux_msg(curthread, + "unsupported socket(AF_NETLINK, %d, NETLINK_UEVENT)", type); + return (EAFNOSUPPORT); + } + linux_msg(curthread, "unsupported socket domain %d, type %d, protocol %d", args->domain, args->type & LINUX_SOCK_TYPE_MASK, args->protocol); return (EAFNOSUPPORT); From owner-svn-src-all@freebsd.org Sat Oct 24 14:37:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D697344B04D; Sat, 24 Oct 2020 14:37:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJNxB5GWnz4clv; Sat, 24 Oct 2020 14:37:50 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0bbc004c47393913af402f.dip0.t-ipconnect.de [IPv6:2003:cd:5f0b:bc00:4c47:3939:13af:402f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 533D72E4C8; Sat, 24 Oct 2020 14:37:49 +0000 (UTC) (envelope-from se@freebsd.org) To: Alex Kozlov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010230922.09N9MNZu040921@repo.freebsd.org> <20201024074840.GA26119@ravenloft.kiev.ua> From: Stefan Esser Subject: Re: svn commit: r366962 - in head: include usr.bin/calendar Message-ID: <38d15142-1cb1-eb1f-215e-cee165743d99@freebsd.org> Date: Sat, 24 Oct 2020 16:37:45 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201024074840.GA26119@ravenloft.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fHaH3cJ3zPPd9xr0lIAiIUSwpkdFLo50F" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:37:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fHaH3cJ3zPPd9xr0lIAiIUSwpkdFLo50F Content-Type: multipart/mixed; boundary="Rw4sLqNGgi2W0fdUSBodEXdolg8Ht94dq"; protected-headers="v1" From: Stefan Esser To: Alex Kozlov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <38d15142-1cb1-eb1f-215e-cee165743d99@freebsd.org> Subject: Re: svn commit: r366962 - in head: include usr.bin/calendar References: <202010230922.09N9MNZu040921@repo.freebsd.org> <20201024074840.GA26119@ravenloft.kiev.ua> In-Reply-To: <20201024074840.GA26119@ravenloft.kiev.ua> --Rw4sLqNGgi2W0fdUSBodEXdolg8Ht94dq Content-Type: multipart/mixed; boundary="------------CE8C52AFC9DE309FF5D54B66" Content-Language: en-US This is a multi-part message in MIME format. --------------CE8C52AFC9DE309FF5D54B66 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Am 24.10.20 um 09:48 schrieb Alex Kozlov: > On Fri, Oct 23, 2020 at 09:22:23AM +0000, Stefan E=DFer wrote: >> Author: se >> Date: Fri Oct 23 09:22:23 2020 >> New Revision: 366962 >> URL: https://svnweb.freebsd.org/changeset/base/366962 >> >> Log: >> Add search of LOCALBASE/share/calendar for calendars supplied by a = port. >> =20 >> Calendar files in LOCALBASE override similarily named ones in the b= ase >> system. This could easily be changed if the base system calendars s= hould >> have precedence, but it could lead to a violation of POLA since the= n the >> port's files were ignored unless those in base have been deleted. >> =20 >> There was no definition of _PATH_LOCALBASE in paths.h, but verbatim= uses >> of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here t= o ease >> a consistent modification of this prefix. > You are hardcoding assumption that LOCALBASE =3D /usr/local. Please mak= e it > overridable with LOCALBASE environment variable. This was a trivial change to get us going with calendars provided by a port (which has not been committed, yet - therefore there are no port-provided calendars, neither under /usr/local nor under any other PREFIX, as of now). I understand what you are asking for, but in such a case I'd rather think you want to rebuild FreeBSD with _PATH_LOCALBASE modified in paths.h. And I have made this a single instance that needs to be changed. Before my change there were 2 instances of /usr/local hard-coded in _PATH_DEFPATH - now you have to only change the definition of _PATH_LOCALBASE to adjust all 3 locations that use it. If you can show me precedence of a LOCALBASE environment variable being used in the way you suggest, I'd be willing to make calendar use it. But then I think a CALENDAR_HOME variable would be even more useful, since it would allow to search an additional user selected directory (and not just share/calendar within what you provide as LOCALBASE). Regards, STefan PS: If you are a source committer, you might even commit such a change yourself. But I'd think it should be reviewed, and it might be a good idea to wait until other changes (e.g. the switch-over to port-supplied calendar files) have been worked out. --------------CE8C52AFC9DE309FF5D54B66-- --Rw4sLqNGgi2W0fdUSBodEXdolg8Ht94dq-- --fHaH3cJ3zPPd9xr0lIAiIUSwpkdFLo50F Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAl+UPDkFAwAAAAAACgkQR+u171r99UTM HAf+L4sJ1K0QWrPF6AJpgiO+bstSsffBLUwc+fVP9G/kvlLakKlb9nh+nk6Fd4U+gEZS4r6rksdy 5/hHDstiGZSlIwZLLOfAu1rzvZI/KFkovtcB8njxdgokA5xoZjInurb6x/DtudHOcRUCrisiNDvc ndkRwGoISB58lEtSJBdIQVV72TLuph9tnSK9dTQeh+vSwUwEYd4+mPsM6XxQU40jhXUolJsf2lM6 419kd6E21upbo7QwwS0jnAtHn1RplgRrHk0e0dIgmvbExMS3M8raFe0ywJ0qo/3VhlOx3QfYc0W0 1ApaZbWx/TJMCna4ZP2P7dVtRqn6a8V5m3wmURm2sQ== =jEFn -----END PGP SIGNATURE----- --fHaH3cJ3zPPd9xr0lIAiIUSwpkdFLo50F-- From owner-svn-src-all@freebsd.org Sat Oct 24 14:39:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5048A44B305; Sat, 24 Oct 2020 14:39:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJNyt1SFBz4crg; Sat, 24 Oct 2020 14:39:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1551519E3B; Sat, 24 Oct 2020 14:39:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OEdH0L032479; Sat, 24 Oct 2020 14:39:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OEdH6t032475; Sat, 24 Oct 2020 14:39:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010241439.09OEdH6t032475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 24 Oct 2020 14:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367002 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 367002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:39:18 -0000 Author: kevans Date: Sat Oct 24 14:39:17 2020 New Revision: 367002 URL: https://svnweb.freebsd.org/changeset/base/367002 Log: audit: correct reporting of *execve(2) success r326145 corrected do_execve() to return EJUSTRETURN upon success so that important registers are not clobbered. This had the side effect of tapping out 'failures' for all *execve(2) audit records, which is less than useful for auditing purposes. Audit exec returns earlier, where we can know for sure that EJUSTRETURN translates to success. Note that this unsets TDP_AUDITREC as we commit the audit record, so the usual audit in the syscall return path will do nothing. PR: 249179 Reported by: Eirik Oeverby Reviewed by: csjp, kib MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26922 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c head/sys/kern/subr_syscall.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Oct 24 14:25:38 2020 (r367001) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Oct 24 14:39:17 2020 (r367002) @@ -442,6 +442,7 @@ freebsd32_execve(struct thread *td, struct freebsd32_e if (error == 0) error = kern_execve(td, &eargs, NULL, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -462,6 +463,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_ error = kern_execve(td, &eargs, NULL, oldvmspace); } post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Oct 24 14:25:38 2020 (r367001) +++ head/sys/kern/kern_exec.c Sat Oct 24 14:39:17 2020 (r367002) @@ -225,6 +225,7 @@ sys_execve(struct thread *td, struct execve_args *uap) if (error == 0) error = kern_execve(td, &args, NULL, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -252,6 +253,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *ua error = kern_execve(td, &args, NULL, oldvmspace); } post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); } @@ -280,6 +282,7 @@ sys___mac_execve(struct thread *td, struct __mac_execv if (error == 0) error = kern_execve(td, &args, uap->mac_p, oldvmspace); post_execve(td, error, oldvmspace); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); return (error); #else return (ENOSYS); Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sat Oct 24 14:25:38 2020 (r367001) +++ head/sys/kern/subr_syscall.c Sat Oct 24 14:39:17 2020 (r367002) @@ -154,7 +154,18 @@ syscallenter(struct thread *td) td->td_pflags &= ~TDP_NERRNO; else td->td_errno = error; + + /* + * Note that some syscall implementations (e.g., sys_execve) + * will commit the audit record just before their final return. + * These were done under the assumption that nothing of interest + * would happen between their return and here, where we would + * normally commit the audit record. These assumptions will + * need to be revisited should any substantial logic be added + * above. + */ AUDIT_SYSCALL_EXIT(error, td); + #ifdef KDTRACE_HOOKS /* Give the syscall:::return DTrace probe a chance to fire. */ if (__predict_false(sa->callp->sy_return != 0)) From owner-svn-src-all@freebsd.org Sat Oct 24 14:46:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 679CE44B73F; Sat, 24 Oct 2020 14:46:39 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJP7M258Qz4dVt; Sat, 24 Oct 2020 14:46:39 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B0D419E6A; Sat, 24 Oct 2020 14:46:39 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OEkdeY038322; Sat, 24 Oct 2020 14:46:39 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OEkdsF038321; Sat, 24 Oct 2020 14:46:39 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010241446.09OEkdsF038321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 14:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367003 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 367003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 14:46:39 -0000 Author: freqlabs Date: Sat Oct 24 14:46:38 2020 New Revision: 367003 URL: https://svnweb.freebsd.org/changeset/base/367003 Log: kern_sysctl: Misc code cleanup Remove unused oidpp parameter from sysctl_sysctl_next_ls and add high level comments to describe how it works. No functional change. Reviewed by: imp MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26854 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Oct 24 14:39:17 2020 (r367002) +++ head/sys/kern/kern_sysctl.c Sat Oct 24 14:46:38 2020 (r367003) @@ -1100,9 +1100,13 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NAME, name, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_name, ""); +/* + * Walk the sysctl subtree at lsp until we find the given name, + * and return the next name in order by oid_number. + */ static int sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen, - int *next, int *len, int level, struct sysctl_oid **oidpp, bool honor_skip) + int *next, int *len, int level, bool honor_skip) { struct sysctl_oid *oidp; @@ -1110,7 +1114,6 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *len = level; SLIST_FOREACH(oidp, lsp, oid_link) { *next = oidp->oid_number; - *oidpp = oidp; if ((oidp->oid_kind & CTLFLAG_DORMANT) != 0) continue; @@ -1118,46 +1121,77 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int if (honor_skip && (oidp->oid_kind & CTLFLAG_SKIP) != 0) continue; - if (!namelen) { + if (namelen == 0) { + /* + * We have reached a node with a full name match and are + * looking for the next oid in its children. + * + * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it + * has a handler) and move on to the children. + */ if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) - /* We really should call the handler here...*/ return (0); lsp = SYSCTL_CHILDREN(oidp); - if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1, - len, level+1, oidpp, honor_skip)) + if (!sysctl_sysctl_next_ls(lsp, NULL, 0, next + 1, len, + level + 1, honor_skip)) return (0); + /* + * There were no useable children in this node. + * Continue searching for the next oid at this level. + */ goto emptynode; } + /* + * No match yet. Continue seeking the given name. + * + * We are iterating in order by oid_number, so skip oids lower + * than the one we are looking for. + * + * When the current oid_number is higher than the one we seek, + * that means we have reached the next oid in the sequence and + * should return it. + * + * If the oid_number matches the name at this level then we + * have to find a node to continue searching at the next level. + */ if (oidp->oid_number < *name) continue; - if (oidp->oid_number > *name) { + /* + * We have reached the next oid. + * + * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it + * has a handler) and move on to the children. + */ if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) return (0); lsp = SYSCTL_CHILDREN(oidp); - if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, - next+1, len, level+1, oidpp, honor_skip)) + if (!sysctl_sysctl_next_ls(lsp, name + 1, namelen - 1, + next + 1, len, level + 1, honor_skip)) return (0); goto next; } if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) continue; - if (oidp->oid_handler) continue; - lsp = SYSCTL_CHILDREN(oidp); - if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, next+1, - len, level+1, oidpp, honor_skip)) + if (!sysctl_sysctl_next_ls(lsp, name + 1, namelen - 1, + next + 1, len, level + 1, honor_skip)) return (0); next: + /* + * There were no useable children in this node. + * Continue searching for the next oid at the root level. + */ namelen = 1; emptynode: + /* Reset len in case a failed recursive call changed it. */ *len = level; } return (ENOENT); @@ -1169,13 +1203,12 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) int *name = (int *) arg1; u_int namelen = arg2; int len, error; - struct sysctl_oid *oid; struct sysctl_oid_list *lsp = &sysctl__children; struct rm_priotracker tracker; int next[CTL_MAXNAME]; SYSCTL_RLOCK(&tracker); - error = sysctl_sysctl_next_ls(lsp, name, namelen, next, &len, 1, &oid, + error = sysctl_sysctl_next_ls(lsp, name, namelen, next, &len, 1, oidp->oid_number == CTL_SYSCTL_NEXT); SYSCTL_RUNLOCK(&tracker); if (error) From owner-svn-src-all@freebsd.org Sat Oct 24 15:27:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F05F44C34E for ; Sat, 24 Oct 2020 15:27:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQ2j2xGjz4g9g for ; Sat, 24 Oct 2020 15:27:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72a.google.com with SMTP id k9so4480017qki.6 for ; Sat, 24 Oct 2020 08:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SdeMX+1mHWz5ppQ2dcv5hUoGfnVrNWGKM7NYoewaOEY=; b=LrYuWVPi1JRw/yISuL3lDxSnd3nSLGVu7d7QqIbrNAGKloswNIzyVO2zHyq25+m25Q azJ1U7FGvKo6pl8eE99wrC70p3U1TgBnADYrFzO5T9zByRM9MzDV5v4qaINTdVrJpo3B IINJqVwunoIht1FORcD2UPVd3BGeuoKOcZQHxQC8sGh1kkILWAPwUAjp7TGyWvp3Q2Kd Ru85kMfo8WKtzOcAxe0eIuSOcX/BfoS/HV9v+POfNOCsPcczaHk49BKecUOXqMZywrJ2 92BtbsMJb9pycRj4EGDkFwtLkAP8AKQdN10LcKTkHENeoywIroFjMNhpM242yoxvMj5S Qnxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SdeMX+1mHWz5ppQ2dcv5hUoGfnVrNWGKM7NYoewaOEY=; b=LygoiXgAgqIoyq9t+6hjILjw/wP8eJ+EDlrr5lMwfInLvC3m5z+EC+AS465zfutqkM m04KZepuylGeSjStq1K9Pni87HSB2wT50miKFqV3yiazrGpe6mfvwPo5UAQ8L7mhRpVZ Lm7V79R+X2qVKYmNFZCGFTUEX6M9q0ziuTrXoJkRLEyHbEExBjCt+pM+HsSDiO9f+GAe fZTk5lMWLezQj5BZDepmXsaWZVq69FWXtwsd+sa8OK2BczZb/3f3/gzmso902k8lAGhn 9u2tMR7/MZ9jRdhDvpBeV+xdfICWo64Bdun9xGzF5f5YHRgmDuajmtIWysEWVdiBiJzv W4Ow== X-Gm-Message-State: AOAM531w6sDErXav4bEZOSI++eEsmBFSms85IFvSXW7b5K8rATeB5ZTG 0z3guoHqE9acjmuEO6BcRBwh10iAfWNaUlraRKkAdg== X-Google-Smtp-Source: ABdhPJwvBRtz//IhRRsKPXkGlykwAVJakQ1j22LvQAgoSHyedgJS7kVnQXFAtQMUdVcM865doIXxsub+sHk0MXI1Mw8= X-Received: by 2002:a37:478c:: with SMTP id u134mr8438978qka.206.1603553259673; Sat, 24 Oct 2020 08:27:39 -0700 (PDT) MIME-Version: 1.0 References: <202010241023.09OANMcL075640@repo.freebsd.org> <20201024125206.GB38000@FreeBSD.org> <999a005e-1ef8-3c45-fb07-94a3b6ebce1b@selasky.org> <317231603546378@mail.yandex.ru> In-Reply-To: <317231603546378@mail.yandex.ru> From: Warner Losh Date: Sat, 24 Oct 2020 09:27:27 -0600 Message-ID: Subject: Re: svn commit: r366993 - head/sys/net To: "Alexander V. Chernikov" Cc: Hans Petter Selasky , Alexey Dokuchaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CJQ2j2xGjz4g9g X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=LrYuWVPi; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72a) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.68 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.06)[-1.059]; NEURAL_HAM_LONG(-0.97)[-0.970]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.65)[-0.650]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72a:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 15:27:42 -0000 On Sat, Oct 24, 2020, 7:38 AM Alexander V. Chernikov wrote: > 24.10.2020, 14:08, "Hans Petter Selasky" : > > On 2020-10-24 14:52, Alexey Dokuchaev wrote: > >> On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: > >>> New Revision: 366993 > >>> URL: https://svnweb.freebsd.org/changeset/base/366993 > >>> > >>> Log: > >>> Run code through "clang-format -style=file" with some additional > fixes. > >>> No functional change. > >>> > >>> ... > >>> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, > >>> > >>> #ifdef INET6 > >>> static inline void > >>> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, > >>> - const uint8_t *broadcast, uint8_t *buf) > >>> +infiniband_ipv6_multicast_map( > >>> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t *buf) > >>> { > >> > >> This is not how we format these in FreeBSD, please revert. It was > correct > >> before and no "fix" is need here. > Given we already have nice .clang-format, that does most of the job, maybe > it's worth considering looking into tweaking it further to fix this part? > It would be nice if we could finally offload all formatting issues to the > tool and focus on the actual code :-) > It would be nice if it produced one of the style(9) acceptable formats without disrupting things already acceptable. That's been the big problem with the tweaks to date... some things are fixed, others break. It's getting a lot closer, though Warner > Done. > > > > --HPS > From owner-svn-src-all@freebsd.org Sat Oct 24 15:38:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AC9844C5D2; Sat, 24 Oct 2020 15:38:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQGj35hDz3S86; Sat, 24 Oct 2020 15:38:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D5931AB25; Sat, 24 Oct 2020 15:38:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OFc5Oh069181; Sat, 24 Oct 2020 15:38:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OFc5d5069180; Sat, 24 Oct 2020 15:38:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010241538.09OFc5d5069180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 24 Oct 2020 15:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367004 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 367004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 15:38:05 -0000 Author: kevans Date: Sat Oct 24 15:38:04 2020 New Revision: 367004 URL: https://svnweb.freebsd.org/changeset/base/367004 Log: backlight(9): compile with COMPAT_LINUXKPI as well This would be more accurately expressed as COMPAT_LINUXKPI implying or requiring backlight, but config(8) doesn't really have a way to express that. This fixes the build with COMPAT_LINUXKPI specified in one's kernel config. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 24 14:46:38 2020 (r367003) +++ head/sys/conf/files Sat Oct 24 15:38:04 2020 (r367004) @@ -1312,8 +1312,8 @@ dev/ath/ath_rate/sample/sample.c optional ath_rate_sam dev/ath/ath_dfs/null/dfs_null.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # -dev/backlight/backlight_if.m optional backlight -dev/backlight/backlight.c optional backlight +dev/backlight/backlight_if.m optional backlight | compat_linuxkpi +dev/backlight/backlight.c optional backlight | compat_linuxkpi dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge From owner-svn-src-all@freebsd.org Sat Oct 24 15:38:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCE3244CA90; Sat, 24 Oct 2020 15:38:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQHS5c8Cz3SFC; Sat, 24 Oct 2020 15:38:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com [209.85.217.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 97B4B2E5D4; Sat, 24 Oct 2020 15:38:44 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-vs1-f53.google.com with SMTP id f4so2543121vsk.7; Sat, 24 Oct 2020 08:38:44 -0700 (PDT) X-Gm-Message-State: AOAM530AWf5/0LSCC3d6zger62fbd9lb3lS5Gt2hekSQco6ceiEZcM1H Djwy75cXrY3Ph3KHIib8aRtYuBJm+L4zSYS72Po= X-Google-Smtp-Source: ABdhPJw8zSazbkDhC1QgGl97OSZ/esUgrJArmZCaxuw3a8YMOhPZVdQ8p4/A2nDQfShBYSbzhOTcWKsVcERXOxfNDuc= X-Received: by 2002:a67:fb50:: with SMTP id e16mr6262057vsr.10.1603553924055; Sat, 24 Oct 2020 08:38:44 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: From: Kyle Evans Date: Sat, 24 Oct 2020 10:38:32 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Hans Petter Selasky Cc: Warner Losh , Kyle Evans , Niclas Zeising , "Alexander V. Chernikov" , Emmanuel Vadot , "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.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 15:38:44 -0000 On Sat, Oct 24, 2020 at 4:52 AM Hans Petter Selasky wrote: > > On 2020-10-24 02:13, Warner Losh wrote: > > I was going to suggest and try this change, but life has been complicated... > > > > Has it been committed? > > > > No, not yet. > > --HPS > I went ahead and did so: r367004 From owner-svn-src-all@freebsd.org Sat Oct 24 15:42:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AD0D44C9D1 for ; Sat, 24 Oct 2020 15:42:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQMt4Qfwz3SWS for ; Sat, 24 Oct 2020 15:42:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id x20so4508374qkn.1 for ; Sat, 24 Oct 2020 08:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uMTYofULrj9eydUDjnYF5jgFqxPYtC3+Mtk8CLq5oSg=; b=NkdQEAWnLNGD8nFS/+PIWL4MjlAt0JSJuTul/pzCYR6zZ3uE0BcR5yT27rgXYEIcyW 3IjiKNBXsh+LmPa5snHfkKni6VP38MPdtfV8bQ7zIENNQRDJ6Sf1TW93iYSFyhBYVj20 HfAGwsKpbEYEuP+vOaegFxZkzm8nCse/lsXr7slKS3aotp+ctobUQMIEKHqijXEnYSaM de6YFf3ZBKwna3M644cUsoT+RLLZeg0m3Yvtyvf31pULBmqQr12eV6h/gMLT7kwbMs3d 11ZfuQOytzYD9c6IzTNajekJXzKMqNaDc0B/jYyLlQy1+RnBWxSrCEoD4Ei+l/9PRysz HX4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uMTYofULrj9eydUDjnYF5jgFqxPYtC3+Mtk8CLq5oSg=; b=G5FxpIj94e8R6r3HH8kUH+5OpMc+QYd4saovLjyeFdSGIKyByT2xYc6ryfsCQjMKKw HvdNKGYCPJIg1qcZVBvVjZk77qxFM8k0JAouM2mW68FsR5JlcYLgAn5/PqXX2SNyfSg8 IUFZF+qjHWqeqPZYkq0f5Cp8ghkgj3DbR4Du4aEcfq9JQaMMGcJ487+B7vTdf9RgOIoY DQXzuWMQivmGqDU4TWiIFDSEVkz1JMl7m7wpJJiaDU2pJG+avPB5qMh3Cn71S0V+LXxt dEI2ps35bE+/TXE93HBq4JFaV5fqw7F9ZLTQuYW0/FIKlVI3aK+fIaMjAX/hQBn9bnR+ ZE7A== X-Gm-Message-State: AOAM531YWJRu2HPx+4Bgo4cnROIIPgWv3sMOBaJV64G0W25gTYWQQcMZ z3HKYxwU0xAxbW4qIn4UmbyO7umzrjVFqTqklbomIg== X-Google-Smtp-Source: ABdhPJyakgbC8nAlW2hjqlFNrQRATaI0vf6CyP8dlitTJhd3PE8hsQOZRyR7ctOJrvEl5pPDFKIFBsDXFwetOY+dcYk= X-Received: by 2002:a05:620a:1255:: with SMTP id a21mr7224481qkl.89.1603554153509; Sat, 24 Oct 2020 08:42:33 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: From: Warner Losh Date: Sat, 24 Oct 2020 09:42:22 -0600 Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Kyle Evans Cc: Hans Petter Selasky , Niclas Zeising , "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CJQMt4Qfwz3SWS X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=NkdQEAWn; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::729) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.75 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.06)[-1.064]; NEURAL_HAM_LONG(-0.97)[-0.965]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.72)[-0.722]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::729:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 15:42:35 -0000 On Sat, Oct 24, 2020 at 9:38 AM Kyle Evans wrote: > On Sat, Oct 24, 2020 at 4:52 AM Hans Petter Selasky > wrote: > > > > On 2020-10-24 02:13, Warner Losh wrote: > > > I was going to suggest and try this change, but life has been > complicated... > > > > > > Has it been committed? > > > > > > > No, not yet. > > > > --HPS > > > > I went ahead and did so: r367004 > Excellent. I was going to do that, but you committed exactly what I was going to. Warner From owner-svn-src-all@freebsd.org Sat Oct 24 15:58:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6528444D2BD; Sat, 24 Oct 2020 15:58:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQkb2MVgz3TP1; Sat, 24 Oct 2020 15:58:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33B3F1B038; Sat, 24 Oct 2020 15:58:47 +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 09OFwlY4081494; Sat, 24 Oct 2020 15:58:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OFwgLM081466; Sat, 24 Oct 2020 15:58:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010241558.09OFwgLM081466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 24 Oct 2020 15:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367005 - head/contrib/less X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/contrib/less X-SVN-Commit-Revision: 367005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 15:58:47 -0000 Author: delphij Date: Sat Oct 24 15:58:42 2020 New Revision: 367005 URL: https://svnweb.freebsd.org/changeset/base/367005 Log: MFV r366990: less v563. MFC after: 2 weeks Relnotes: yes Modified: head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/compose.uni head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/fmt.uni head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkutable head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/ubin.uni head/contrib/less/version.c head/contrib/less/wide.uni Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/NEWS Sat Oct 24 15:58:42 2020 (r367005) @@ -11,6 +11,31 @@ ====================================================================== + Major changes between "less" versions 551 and 563 + +* Update Unicode tables. + +* Treat Hangul Jamo medial vowels and final consonants as zero width. + +* Display error message immediately when -o is toggled and + input is not a pipe. + +* Fix regression: make screen repaint when "squished" and + a no-movement command is given. + +* Fix erroneous EOF calculation when F command is interrupted. + +* Make WIN32C version include this fix from 551: + Don't count lines in initial screen if using -X with -F. + +* Fix display bug in WIN32C version. + +* Fix memory corruption when built with libtermcap. + +* Support libtinfow. + +====================================================================== + Major changes between "less" versions 530 and 551 * Add --mouse option. Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/README Sat Oct 24 15:58:42 2020 (r367005) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 551 + Less, version 563 - This is the distribution of less, version 551, released 11 Jun 2019. + This is the distribution of less, version 563, released 13 Jun 2020. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -32,6 +32,14 @@ This is the distribution of "less", a paginator simila The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. + +======================================================================= +PRE-INSTALLATION (when using git) + +If you are building from a clone of a git repository, +type "make -f Makefile.aut". +If you are building from a numbered release package (a tar or zip file +with a name like less-999.tar.gz or less-999.zip), you should skip this step. ======================================================================= INSTALLATION (Unix systems only): Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/brac.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/ch.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -408,6 +408,7 @@ end_logfile(VOID_PARAM) } close(logfile); logfile = -1; + free(namelogfile); namelogfile = NULL; } @@ -842,7 +843,8 @@ seekable(f) public void ch_set_eof(VOID_PARAM) { - ch_fsize = ch_fpos; + if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos) + ch_fsize = ch_fpos; } Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/charset.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -509,7 +509,7 @@ prutfchar(ch) */ public int utf_len(ch) - unsigned char ch; + int ch; { if ((ch & 0x80) == 0) return 1; Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/charset.h Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/cmd.h Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/cmdbuf.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -34,7 +34,7 @@ static int literal; /* Next input char should not be static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME -static int cmd_complete(); +static int cmd_complete LESSPARAMS((int action)); /* * These variables are statics used by cmd_complete. */ @@ -960,10 +960,7 @@ cmd_istr(str) step_char(&s, +1, endline); action = cmd_ichar(os, s - os); if (action != CC_OK) - { - bell(); return (action); - } } return (CC_OK); } Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/command.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -90,7 +90,7 @@ struct ungot { }; static struct ungot* ungot = NULL; -static void multi_search(); +static void multi_search LESSPARAMS((char *pattern, int n, int silent)); /* * Move the cursor to start of prompt line before executing a command. @@ -1806,6 +1806,12 @@ commands(VOID_PARAM) optgetname = FALSE; mca_opt_toggle(); c = getcc(); + cbuf = opt_toggle_disallowed(c); + if (cbuf != NULL) + { + error(cbuf, NULL_PARG); + break; + } goto again; case A_DISP_OPTION: Modified: head/contrib/less/compose.uni ============================================================================== --- head/contrib/less/compose.uni Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/compose.uni Sat Oct 24 15:58:42 2020 (r367005) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Mn Me -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x0300, 0x036f }, /* Mn */ { 0x0483, 0x0487 }, /* Mn */ { 0x0488, 0x0489 }, /* Me */ @@ -58,7 +58,7 @@ { 0x0b3f, 0x0b3f }, /* Mn */ { 0x0b41, 0x0b44 }, /* Mn */ { 0x0b4d, 0x0b4d }, /* Mn */ - { 0x0b56, 0x0b56 }, /* Mn */ + { 0x0b55, 0x0b56 }, /* Mn */ { 0x0b62, 0x0b63 }, /* Mn */ { 0x0b82, 0x0b82 }, /* Mn */ { 0x0bc0, 0x0bc0 }, /* Mn */ @@ -81,6 +81,7 @@ { 0x0d41, 0x0d44 }, /* Mn */ { 0x0d4d, 0x0d4d }, /* Mn */ { 0x0d62, 0x0d63 }, /* Mn */ + { 0x0d81, 0x0d81 }, /* Mn */ { 0x0dca, 0x0dca }, /* Mn */ { 0x0dd2, 0x0dd4 }, /* Mn */ { 0x0dd6, 0x0dd6 }, /* Mn */ @@ -88,8 +89,7 @@ { 0x0e34, 0x0e3a }, /* Mn */ { 0x0e47, 0x0e4e }, /* Mn */ { 0x0eb1, 0x0eb1 }, /* Mn */ - { 0x0eb4, 0x0eb9 }, /* Mn */ - { 0x0ebb, 0x0ebc }, /* Mn */ + { 0x0eb4, 0x0ebc }, /* Mn */ { 0x0ec8, 0x0ecd }, /* Mn */ { 0x0f18, 0x0f19 }, /* Mn */ { 0x0f35, 0x0f35 }, /* Mn */ @@ -112,6 +112,7 @@ { 0x1085, 0x1086 }, /* Mn */ { 0x108d, 0x108d }, /* Mn */ { 0x109d, 0x109d }, /* Mn */ + { 0x1160, 0x11ff }, /* Mn */ { 0x135d, 0x135f }, /* Mn */ { 0x1712, 0x1714 }, /* Mn */ { 0x1732, 0x1734 }, /* Mn */ @@ -140,6 +141,7 @@ { 0x1a7f, 0x1a7f }, /* Mn */ { 0x1ab0, 0x1abd }, /* Mn */ { 0x1abe, 0x1abe }, /* Me */ + { 0x1abf, 0x1ac0 }, /* Mn */ { 0x1b00, 0x1b03 }, /* Mn */ { 0x1b34, 0x1b34 }, /* Mn */ { 0x1b36, 0x1b3a }, /* Mn */ @@ -183,6 +185,7 @@ { 0xa806, 0xa806 }, /* Mn */ { 0xa80b, 0xa80b }, /* Mn */ { 0xa825, 0xa826 }, /* Mn */ + { 0xa82c, 0xa82c }, /* Mn */ { 0xa8c4, 0xa8c5 }, /* Mn */ { 0xa8e0, 0xa8f1 }, /* Mn */ { 0xa8ff, 0xa8ff }, /* Mn */ @@ -191,7 +194,7 @@ { 0xa980, 0xa982 }, /* Mn */ { 0xa9b3, 0xa9b3 }, /* Mn */ { 0xa9b6, 0xa9b9 }, /* Mn */ - { 0xa9bc, 0xa9bc }, /* Mn */ + { 0xa9bc, 0xa9bd }, /* Mn */ { 0xa9e5, 0xa9e5 }, /* Mn */ { 0xaa29, 0xaa2e }, /* Mn */ { 0xaa31, 0xaa32 }, /* Mn */ @@ -209,6 +212,8 @@ { 0xabe5, 0xabe5 }, /* Mn */ { 0xabe8, 0xabe8 }, /* Mn */ { 0xabed, 0xabed }, /* Mn */ + { 0xd7b0, 0xd7c6 }, /* Mn */ + { 0xd7cb, 0xd7fb }, /* Mn */ { 0xfb1e, 0xfb1e }, /* Mn */ { 0xfe00, 0xfe0f }, /* Mn */ { 0xfe20, 0xfe2f }, /* Mn */ @@ -222,6 +227,7 @@ { 0x10a3f, 0x10a3f }, /* Mn */ { 0x10ae5, 0x10ae6 }, /* Mn */ { 0x10d24, 0x10d27 }, /* Mn */ + { 0x10eab, 0x10eac }, /* Mn */ { 0x10f46, 0x10f50 }, /* Mn */ { 0x11001, 0x11001 }, /* Mn */ { 0x11038, 0x11046 }, /* Mn */ @@ -235,6 +241,7 @@ { 0x11180, 0x11181 }, /* Mn */ { 0x111b6, 0x111be }, /* Mn */ { 0x111c9, 0x111cc }, /* Mn */ + { 0x111cf, 0x111cf }, /* Mn */ { 0x1122f, 0x11231 }, /* Mn */ { 0x11234, 0x11234 }, /* Mn */ { 0x11236, 0x11237 }, /* Mn */ @@ -270,6 +277,12 @@ { 0x11727, 0x1172b }, /* Mn */ { 0x1182f, 0x11837 }, /* Mn */ { 0x11839, 0x1183a }, /* Mn */ + { 0x1193b, 0x1193c }, /* Mn */ + { 0x1193e, 0x1193e }, /* Mn */ + { 0x11943, 0x11943 }, /* Mn */ + { 0x119d4, 0x119d7 }, /* Mn */ + { 0x119da, 0x119db }, /* Mn */ + { 0x119e0, 0x119e0 }, /* Mn */ { 0x11a01, 0x11a0a }, /* Mn */ { 0x11a33, 0x11a38 }, /* Mn */ { 0x11a3b, 0x11a3e }, /* Mn */ @@ -296,7 +309,9 @@ { 0x11ef3, 0x11ef4 }, /* Mn */ { 0x16af0, 0x16af4 }, /* Mn */ { 0x16b30, 0x16b36 }, /* Mn */ + { 0x16f4f, 0x16f4f }, /* Mn */ { 0x16f8f, 0x16f92 }, /* Mn */ + { 0x16fe4, 0x16fe4 }, /* Mn */ { 0x1bc9d, 0x1bc9e }, /* Mn */ { 0x1d167, 0x1d169 }, /* Mn */ { 0x1d17b, 0x1d182 }, /* Mn */ @@ -314,6 +329,9 @@ { 0x1e01b, 0x1e021 }, /* Mn */ { 0x1e023, 0x1e024 }, /* Mn */ { 0x1e026, 0x1e02a }, /* Mn */ + { 0x1e130, 0x1e136 }, /* Mn */ + { 0x1e2ae, 0x1e2ae }, /* Mn */ + { 0x1e2ec, 0x1e2ef }, /* Mn */ { 0x1e8d0, 0x1e8d6 }, /* Mn */ { 0x1e944, 0x1e94a }, /* Mn */ { 0xe0100, 0xe01ef }, /* Mn */ Modified: head/contrib/less/cvt.c ============================================================================== --- head/contrib/less/cvt.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/cvt.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/decode.c ============================================================================== --- head/contrib/less/decode.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/decode.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/edit.c ============================================================================== --- head/contrib/less/edit.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/edit.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -854,7 +854,6 @@ loop: /* * Don't do anything. */ - free(filename); return; case 'q': quit(QUIT_OK); Modified: head/contrib/less/filename.c ============================================================================== --- head/contrib/less/filename.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/filename.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -795,7 +795,7 @@ lglob(filename) } /* - * @@@ + * Return canonical pathname. */ public char * lrealpath(path) Modified: head/contrib/less/fmt.uni ============================================================================== --- head/contrib/less/fmt.uni Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/fmt.uni Sat Oct 24 15:58:42 2020 (r367005) @@ -1,4 +1,4 @@ -/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Wed Feb 13 17:57:05 PST 2019 */ +/* Generated by "./mkutable -f2 Cf -- unicode/UnicodeData.txt" on Tue May 19 14:47:34 PDT 2020 */ { 0x00ad, 0x00ad }, /* Cf */ { 0x0600, 0x0605 }, /* Cf */ { 0x061c, 0x061c }, /* Cf */ @@ -14,6 +14,7 @@ { 0xfff9, 0xfffb }, /* Cf */ { 0x110bd, 0x110bd }, /* Cf */ { 0x110cd, 0x110cd }, /* Cf */ + { 0x13430, 0x13438 }, /* Cf */ { 0x1bca0, 0x1bca3 }, /* Cf */ { 0x1d173, 0x1d17a }, /* Cf */ { 0xe0001, 0xe0001 }, /* Cf */ Modified: head/contrib/less/forwback.c ============================================================================== --- head/contrib/less/forwback.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/forwback.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -21,7 +21,6 @@ public int screen_trashed; public int squished; public int no_back_scroll = 0; public int forw_prompt; -public int same_pos_bell = 1; extern int sigs; extern int top_scroll; @@ -290,7 +289,7 @@ forw(n, pos, force, only_last, nblank) forw_prompt = 1; } - if (nlines == 0 && !ignore_eoi && same_pos_bell) + if (nlines == 0 && !ignore_eoi) eof_bell(); else if (do_repaint) repaint(); @@ -350,7 +349,7 @@ back(n, pos, force, only_last) } } - if (nlines == 0 && same_pos_bell) + if (nlines == 0) eof_bell(); else if (do_repaint) repaint(); Modified: head/contrib/less/funcs.h ============================================================================== --- head/contrib/less/funcs.h Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/funcs.h Sat Oct 24 15:58:42 2020 (r367005) @@ -61,7 +61,7 @@ public int binary_char LESSPARAMS ((LWCHAR c)); public int control_char LESSPARAMS ((LWCHAR c)); public char * prchar LESSPARAMS ((LWCHAR c)); public char * prutfchar LESSPARAMS ((LWCHAR ch)); -public int utf_len LESSPARAMS ((unsigned char ch)); +public int utf_len LESSPARAMS ((int ch)); public int is_utf8_well_formed LESSPARAMS ((char *ss, int slen)); public void utf_skip_to_lead LESSPARAMS ((char **pp, char *limit)); public LWCHAR get_wchar LESSPARAMS ((constant char *p)); @@ -187,10 +187,10 @@ public void pshift_all LESSPARAMS ((VOID_PARAM)); public int is_ansi_end LESSPARAMS ((LWCHAR ch)); public int is_ansi_middle LESSPARAMS ((LWCHAR ch)); public void skip_ansi LESSPARAMS ((char **pp, constant char *limit)); -public int pappend LESSPARAMS ((unsigned char c, POSITION pos)); +public int pappend LESSPARAMS ((int c, POSITION pos)); public int pflushmbc LESSPARAMS ((VOID_PARAM)); public void pdone LESSPARAMS ((int endline, int chopped, int forw)); -public void set_status_col LESSPARAMS ((char c)); +public void set_status_col LESSPARAMS ((int c)); public int gline LESSPARAMS ((int i, int *ap)); public void null_line LESSPARAMS ((VOID_PARAM)); public POSITION forw_raw_line LESSPARAMS ((POSITION curr_pos, char **linep, int *line_lenp)); @@ -243,6 +243,7 @@ public void scan_option LESSPARAMS ((char *s)); public void toggle_option LESSPARAMS ((struct loption *o, int lower, char *s, int how_toggle)); public int opt_has_param LESSPARAMS ((struct loption *o)); public char * opt_prompt LESSPARAMS ((struct loption *o)); +public char * opt_toggle_disallowed LESSPARAMS ((int c)); public int isoptpending LESSPARAMS ((VOID_PARAM)); public void nopendopt LESSPARAMS ((VOID_PARAM)); public int getnum LESSPARAMS ((char **sp, char *printopt, int *errp)); Modified: head/contrib/less/help.c ============================================================================== --- head/contrib/less/help.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/help.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 18:12 on 2019/6/11 */ +/* This file was generated by mkhelp.pl from less.hlp at 3:34 on 2020/6/14 */ #include "less.h" constant char helpdata[] = { '\n', Modified: head/contrib/less/ifile.c ============================================================================== --- head/contrib/less/ifile.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/ifile.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/input.c ============================================================================== --- head/contrib/less/input.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/input.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/jump.c ============================================================================== --- head/contrib/less/jump.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/jump.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -219,7 +219,7 @@ jump_loc(pos, sline) nline -= sindex; if (nline > 0) forw(nline, position(BOTTOM_PLUS_ONE), 1, 0, 0); - else if (nline < 0) + else back(-nline, position(TOP), 1, 0); #if HILITE_SEARCH if (show_attn) Modified: head/contrib/less/less.h ============================================================================== --- head/contrib/less/less.h Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/less.h Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/less.nro ============================================================================== --- head/contrib/less/less.nro Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/less.nro Sat Oct 24 15:58:42 2020 (r367005) @@ -1,4 +1,5 @@ -.TH LESS 1 "Version 551: 11 Jun 2019" +'\" t +.TH LESS 1 "Version 563: 13 Jun 2020" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -21,19 +22,18 @@ less \- opposite of more .B " [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..." .br (See the OPTIONS section for alternate option syntax with long option names.) - +. .SH DESCRIPTION .I Less is a program similar to -.I more -(1), but which allows backward movement +.IR more (1), +but which allows backward movement in the file as well as forward movement. Also, .I less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like -.I vi -(1). +.IR vi (1). .I Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. @@ -48,7 +48,7 @@ and Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. - +. .SH COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the @@ -229,7 +229,7 @@ that is, do a simple textual comparison. .RE .IP ?pattern Search backward in the file for the N-th line containing the pattern. -The search starts at the last line displayed +The search starts at the last line displayed (but see the \-a and \-j options, which change this). .sp Certain characters are special as in the / command: @@ -376,7 +376,7 @@ this will reset the option to the "opposite" of its de and print a message describing the new setting. This does not work for numeric or string-valued options. .IP \-\-! -Like the \-! command, but takes a long option name +Like the \-!\& command, but takes a long option name rather than a single option letter. .IP _ (Underscore.) @@ -405,7 +405,7 @@ Exits The following four commands may or may not be valid, depending on your particular installation. -.PP +. .IP v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, @@ -425,7 +425,7 @@ On MS-DOS and OS/2 systems, the shell is the normal co .IP "| shell-command" represents any mark letter. Pipes a section of the input file to the given shell command. -The section of the file to be piped is between the position marked by +The section of the file to be piped is between the position marked by the letter and the current screen. The entire current screen is included, regardless of whether the marked position is before or after the current screen. @@ -434,7 +434,7 @@ If is \&.\& or newline, the current screen is pipe .IP "s filename" Save the input to a file. This only works if the input is a pipe, not an ordinary file. -.PP +. .SH OPTIONS Command line options are described below. Most options may be changed while @@ -518,7 +518,7 @@ This was the default behavior in less versions prior t Specifies the amount of buffer space .I less will use for each file, in units of kilobytes (1024 bytes). -By default 64\ K of buffer space is used for each file +By default 64\ KB of buffer space is used for each file (unless the file is a pipe; see the \-B option). The \-b option specifies instead that \fIn\fP kilobytes of buffer space should be used for each file. @@ -530,7 +530,7 @@ buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The \-B option disables this automatic allocation of buffers for pipes, -so that only 64\ K +so that only 64\ KB (or the amount of space specified by the \-b option) is used for the pipe. Warning: use of \-B can result in erroneous display, since only the @@ -563,8 +563,9 @@ A single number \fIN\fP is the same as \fIN.M\fP, where \fIM\fP is the normal background color. The color may start or end with \fBu\fP to use underline (with the normal color, if by itself), if the system supports it (Windows only). -\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering (SGR mode). - +\fBx\fP may also be \fBa\fP to toggle strict ANSI sequence rendering +(SGR mode). +. .IP "\-e or \-\-quit-at-eof" Causes .I less @@ -654,8 +655,8 @@ The status column is also used if the \-w or \-W optio Causes .I less to open and interpret the named file as a -.I lesskey -(1) file. +.IR lesskey (1) +file. Multiple \-k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), @@ -746,7 +747,7 @@ to that string. \-Ph changes the prompt for the help screen. \-P= changes the message printed by the = command. \-Pw changes the message printed while waiting for data (in the F command). - +.sp 1 All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. @@ -762,7 +763,7 @@ The default is to ring the terminal bell in all such c .IP "\-Q or \-\-QUIET or \-\-SILENT" Causes totally "quiet" operation: the terminal bell is never rung. -If the terminal has a "visual bell", it is used in all cases +If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung. .IP "\-r or \-\-raw-control-chars" Causes "raw" control characters to be displayed. @@ -804,7 +805,7 @@ output. Causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in -the screen width is not shown. +the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line. .IP "\-t\fItag\fP or \-\-tag=\fItag\fP" @@ -813,12 +814,12 @@ will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by -.I ctags -(1) or an equivalent command. +.IR ctags (1) +or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with -.I global -(1), and that command is executed to find the tag. +.IR global (1), +and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The \-t option may also be specified from within .I less @@ -870,7 +871,7 @@ If only one \fIn\fP is specified, tab stops are set at If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. -For example, \fI-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. +For example, \fI\-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. The default for \fIn\fP is 8. .IP "\-X or \-\-no-init" Disables sending the termcap initialization and deinitialization strings @@ -944,15 +945,15 @@ will display the contents of that new file. Enables mouse input: scrolling the mouse wheel down moves forward in the file, scrolling the mouse wheel up moves backwards in the file, -and clicking the mouse sets the "#" mark to the line +and clicking the mouse sets the "#" mark to the line where the mouse is clicked. -The number of lines to scroll when the wheel is moved +The number of lines to scroll when the wheel is moved can be set by the \-\-wheel-lines option. Mouse input works only on terminals which support X11 mouse reporting, -and on the Windows version of +and on the Windows version of .IR less . .IP "\-\-MOUSE" -Like \-\-mouse, except the direction scrolled +Like \-\-mouse, except the direction scrolled on mouse wheel movement is reversed. .IP "\-\-no-keypad" Disables sending the keypad initialization and deinitialization strings @@ -961,7 +962,7 @@ This is sometimes useful if the keypad strings make th keypad behave in an undesirable manner. .IP "\-\-no-histdups" This option changes the behavior so that if a search string or -file name is typed in, and the same string is already in the history list, +file name is typed in, and the same string is already in the history list, the existing copy is removed from the history list before the new one is added. Thus, a given string will appear only once in the history list. Normally, a string may appear multiple times. @@ -969,7 +970,7 @@ Normally, a string may appear multiple times. This option changes the character used to mark truncated lines. It may begin with a two-character attribute indicator like LESSBINFMT does. If there is no attribute indicator, standout is used. -If set to "-", truncated lines are not marked. +If set to "\-", truncated lines are not marked. .IP "\-\-save-marks" Save marks in the history file, so marks are retained across different invocations of \fIless\fP. @@ -1001,7 +1002,7 @@ If the option starts with ++, the initial command appl every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file. - +. .SH "LINE EDITING" When entering command line at the bottom of the screen (for example, a filename for the :e command, @@ -1069,13 +1070,12 @@ If you have changed your line-kill character in Unix t other than ^U, that character is used instead of ^U. .IP "^G" Delete the entire command line and return to the main prompt. - +. .SH "KEY BINDINGS" You may define your own .I less commands by using the program -.I lesskey -(1) +.IR lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. @@ -1125,7 +1125,7 @@ was built with a different sysconf directory than /usr that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless. On OS/2 systems, the system-wide lesskey file is c:\esysless.ini. - +. .SH "INPUT PREPROCESSOR" You may define an "input preprocessor" for .IR less . @@ -1294,7 +1294,7 @@ Similarly, if the first two characters of LESSOPEN are the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. - +. .SH "NATIONAL CHARACTER SETS" There are three types of characters in the input file: .IP "normal characters" @@ -1349,7 +1349,7 @@ In this case, the environment variable LESSCHARDEF can to define a character set. It should be set to a string where each character in the string represents one character in the character set. -The character "." is used for a normal character, "c" for control, +The character ".\&" is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b.\&" would mean character 0 is binary, @@ -1361,26 +1361,22 @@ represent any real character set.) .PP This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: -.sp - ascii\ 8bcccbcc18b95.b -.br - dos\ \ \ 8bcccbcc12bc5b95.b. -.br - ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b -.br - \ \ \ \ \ \ 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. -.br - IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc -.br - \ \ \ \ \ \ 191.b -.br - iso8859 8bcccbcc18b95.33b. -.br - koi8-r 8bcccbcc18b95.b128. -.br - latin1 8bcccbcc18b95.33b. -.br - next\ \ 8bcccbcc18b95.bb125.bb +. +.RS 5m +.TS +l l. +ascii 8bcccbcc18b95.b +dos 8bcccbcc12bc5b95.b. +ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b + 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. +IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc + 191.b +iso8859 8bcccbcc18b95.33b. +koi8-r 8bcccbcc18b95.b128. +latin1 8bcccbcc18b95.33b. +next 8bcccbcc18b95.bb125.bb +.TE +.RE .PP If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" @@ -1429,11 +1425,11 @@ setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, -octets of a complete but non-shortest form sequence, illegal octets, +octets of a complete but non-shortest form sequence, invalid octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. - +. .SH "PROMPTS" The \-P option allows you to tailor the prompt to your preference. The string given to the \-P option replaces the specified prompt string. @@ -1500,7 +1496,8 @@ Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. .IP "%T" Normally expands to the word "file". -However if viewing files via a tags list using the \-t option, it expands to the word "tag". +However if viewing files via a tags list using the \-t option, +it expands to the word "tag". .IP "%x" Replaced by the name of the next input file in the list. .PP @@ -1620,7 +1617,7 @@ line number, followed by the shell-escaped file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. - +. .SH SECURITY When the environment variable LESSSECURE is set to 1, .I less @@ -1641,14 +1638,14 @@ log files use of lesskey files .IP "\-t" use of tags files -.IP " " +.IP metacharacters in filenames, such as * -.IP " " +.IP filename completion (TAB, ^L) .RE .PP Less can also be compiled to be permanently in "secure" mode. - +. .SH "COMPATIBILITY WITH MORE" If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", @@ -1666,7 +1663,7 @@ behaves as if the \-E option were set. .PP The \-m option works differently. If the \-m option is not set, the medium prompt is used, -and it is prefixed with the string "--More--". +and it is prefixed with the string "\-\-More\-\-". If the \-m option is set, the short prompt is used. .PP The \-n option acts like the \-z option. @@ -1678,12 +1675,12 @@ command rather than a search pattern. .PP The LESS environment variable is ignored, and the MORE environment variable is used in its place. - +. .SH "ENVIRONMENT VARIABLES" Environment variables may be specified either in the system environment as usual, or in a -.I lesskey -(1) file. +.IR lesskey (1) +file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence @@ -1738,8 +1735,8 @@ See discussion under PROMPTS. .IP LESSGLOBALTAGS Name of the command used by the \-t option to find global tags. Normally should be set to "global" if your system has the -.I global -(1) command. If not set, global tags are not used. +.IR global (1) +command. If not set, global tags are not used. .IP LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of @@ -1752,9 +1749,13 @@ on OS/2 systems. The maximum number of commands to save in the history file. The default is 100. .IP LESSKEY -Name of the default lesskey(1) file. +Name of the default +.IR lesskey (1) +file. .IP LESSKEY_SYSTEM -Name of the default system-wide lesskey(1) file. +Name of the default system-wide +.IR lesskey (1) +file. .IP LESSMETACHARS List of characters which are considered "metacharacters" by the shell. .IP LESSMETAESCAPE @@ -1773,8 +1774,8 @@ String to be appended to a directory name in filename Format for displaying non-printable Unicode code points. .IP LESS_IS_MORE Emulate the -.I more -(1) command. +.IR more (1) +command. .IP LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. @@ -1791,19 +1792,19 @@ compatible mode. User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). .IP SHELL -The shell used to execute the ! command, as well as to expand filenames. +The shell used to execute the !\& command, as well as to expand filenames. .IP TERM The type of terminal on which .I less is being run. .IP VISUAL The name of the editor (used for the v command). - +. .SH "SEE ALSO" -lesskey(1) - +.BR lesskey (1) +. .SH COPYRIGHT -Copyright (C) 1984-2019 Mark Nudelman +Copyright (C) 1984-2020 Mark Nudelman .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it @@ -1823,9 +1824,9 @@ less is distributed in the hope that it will be useful WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - +. .SH AUTHOR -.PP +. Mark Nudelman .br Report bugs at https://github.com/gwsw/less/issues. Modified: head/contrib/less/lessecho.c ============================================================================== --- head/contrib/less/lessecho.c Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/lessecho.c Sat Oct 24 15:58:42 2020 (r367005) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2019 Mark Nudelman + * Copyright (C) 1984-2020 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/lessecho.nro ============================================================================== --- head/contrib/less/lessecho.nro Sat Oct 24 15:38:04 2020 (r367004) +++ head/contrib/less/lessecho.nro Sat Oct 24 15:58:42 2020 (r367005) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 551: 11 Jun 2019" +.TH LESSECHO 1 "Version 563: 13 Jun 2020" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS @@ -44,7 +44,7 @@ Specifies "n" to be the escape char for metachars, as Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted .SH "SEE ALSO" -less(1) +.BR less (1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Oct 24 16:05:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95A3B44D780; Sat, 24 Oct 2020 16:05:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQtV3Rdlz3Tv2; Sat, 24 Oct 2020 16:05:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 595861B282; Sat, 24 Oct 2020 16:05:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OG5c8p087437; Sat, 24 Oct 2020 16:05:38 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OG5c8O087436; Sat, 24 Oct 2020 16:05:38 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010241605.09OG5c8O087436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 16:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367006 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 367006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:05:38 -0000 Author: freqlabs Date: Sat Oct 24 16:05:37 2020 New Revision: 367006 URL: https://svnweb.freebsd.org/changeset/base/367006 Log: sysctl: Misc code cleanup * Use defined SYS_SYSCTL names * Use memcmp instead of explicit loop * Use NULL instead of 0 for pointer value * Use __FBSDID * Reformat, improve comments in parse() No functional changes. Reviewed by: imp MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26832 Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sat Oct 24 15:58:42 2020 (r367005) +++ head/sbin/sysctl/sysctl.c Sat Oct 24 16:05:37 2020 (r367006) @@ -29,20 +29,9 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); -#ifndef lint -#if 0 -static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93"; -#endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - #include #include #include @@ -221,7 +210,7 @@ main(int argc, char **argv) if (Nflag && nflag) usage(); if (aflag && argc == 0) - exit(sysctl_all(0, 0)); + exit(sysctl_all(NULL, 0)); if (argc == 0 && conffile == NULL) usage(); @@ -369,6 +358,13 @@ parse(const char *string, int lineno) else line[0] = '\0'; + /* + * Split the string into name and value. + * + * Either = or : may be used as the delimiter. + * Whitespace surrounding the delimiter is trimmed. + * Quotes around the value are stripped. + */ cp = buf; if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) { warnx("oid too long: '%s'%s", string, line); @@ -381,6 +377,7 @@ parse(const char *string, int lineno) warnx("Can't set variables when using -T or -W"); usage(); } + /* Trim whitespace before the value. */ while (isspace(*cp)) cp++; /* Strip a pair of " or ' if any. */ @@ -394,14 +391,17 @@ parse(const char *string, int lineno) newvalstr = cp; newsize = strlen(cp); } - /* Trim spaces */ + /* Trim whitespace after the name. */ cp = bufp + strlen(bufp) - 1; while (cp >= bufp && isspace((int)*cp)) { *cp = '\0'; cp--; } - len = name2oid(bufp, mib); + /* + * Check the name is a useable oid. + */ + len = name2oid(bufp, mib); if (len < 0) { if (iflag) return (0); @@ -425,6 +425,10 @@ parse(const char *string, int lineno) exit(1); } + /* + * We have a useable oid to work with. If there is no value given, + * show the node and its children. Otherwise, set the new value. + */ if (newvalstr == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { if (dflag) { @@ -438,105 +442,109 @@ parse(const char *string, int lineno) if (!i && !bflag) putchar('\n'); } - } else { - if ((kind & CTLTYPE) == CTLTYPE_NODE) { - warnx("oid '%s' isn't a leaf node%s", bufp, line); - return (1); - } + return (0); + } - if (!(kind & CTLFLAG_WR)) { - if (kind & CTLFLAG_TUN) { - warnx("oid '%s' is a read only tunable%s", bufp, line); - warnx("Tunable values are set in /boot/loader.conf"); - } else - warnx("oid '%s' is read only%s", bufp, line); - return (1); - } + /* + * We have a new value to set. Check its validity and parse if numeric. + */ + if ((kind & CTLTYPE) == CTLTYPE_NODE) { + warnx("oid '%s' isn't a leaf node%s", bufp, line); + return (1); + } - switch (kind & CTLTYPE) { - case CTLTYPE_INT: - case CTLTYPE_UINT: - case CTLTYPE_LONG: - case CTLTYPE_ULONG: - case CTLTYPE_S8: - case CTLTYPE_S16: - case CTLTYPE_S32: - case CTLTYPE_S64: - case CTLTYPE_U8: - case CTLTYPE_U16: - case CTLTYPE_U32: - case CTLTYPE_U64: - if (strlen(newvalstr) == 0) { - warnx("empty numeric value"); - return (1); - } - /* FALLTHROUGH */ - case CTLTYPE_STRING: - break; - default: - warnx("oid '%s' is type %d," - " cannot set that%s", bufp, - kind & CTLTYPE, line); + if (!(kind & CTLFLAG_WR)) { + if (kind & CTLFLAG_TUN) { + warnx("oid '%s' is a read only tunable%s", bufp, line); + warnx("Tunable values are set in /boot/loader.conf"); + } else + warnx("oid '%s' is read only%s", bufp, line); + return (1); + } + + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + case CTLTYPE_S8: + case CTLTYPE_S16: + case CTLTYPE_S32: + case CTLTYPE_S64: + case CTLTYPE_U8: + case CTLTYPE_U16: + case CTLTYPE_U32: + case CTLTYPE_U64: + if (strlen(newvalstr) == 0) { + warnx("empty numeric value"); return (1); } + /* FALLTHROUGH */ + case CTLTYPE_STRING: + break; + default: + warnx("oid '%s' is type %d, cannot set that%s", + bufp, kind & CTLTYPE, line); + return (1); + } - newbuf = NULL; + newbuf = NULL; - switch (kind & CTLTYPE) { - case CTLTYPE_STRING: - newval = newvalstr; - break; - default: - newsize = 0; - while ((cp = strsep(&newvalstr, " ,")) != NULL) { - if (*cp == '\0') - continue; - if (!parse_numeric(cp, fmt, kind, &newbuf, - &newsize)) { - warnx("invalid %s '%s'%s", - ctl_typename[kind & CTLTYPE], - cp, line); - free(newbuf); - return (1); - } - } - newval = newbuf; - break; - } - - i = show_var(mib, len, false); - if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { - free(newbuf); - if (!i && !bflag) - putchar('\n'); - switch (errno) { - case EOPNOTSUPP: - warnx("%s: value is not available%s", - string, line); + switch (kind & CTLTYPE) { + case CTLTYPE_STRING: + newval = newvalstr; + break; + default: + newsize = 0; + while ((cp = strsep(&newvalstr, " ,")) != NULL) { + if (*cp == '\0') + continue; + if (!parse_numeric(cp, fmt, kind, &newbuf, &newsize)) { + warnx("invalid %s '%s'%s", + ctl_typename[kind & CTLTYPE], cp, line); + free(newbuf); return (1); - case ENOTDIR: - warnx("%s: specification is incomplete%s", - string, line); - return (1); - case ENOMEM: - warnx("%s: type is unknown to this program%s", - string, line); - return (1); - default: - warn("%s%s", string, line); - return (1); } } + newval = newbuf; + break; + } + + /* + * Show the current value, then set and show the new value. + */ + i = show_var(mib, len, false); + if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { free(newbuf); - if (!bflag) - printf(" -> "); - i = nflag; - nflag = 1; - j = show_var(mib, len, false); - if (!j && !bflag) + if (!i && !bflag) putchar('\n'); - nflag = i; + switch (errno) { + case EOPNOTSUPP: + warnx("%s: value is not available%s", + string, line); + return (1); + case ENOTDIR: + warnx("%s: specification is incomplete%s", + string, line); + return (1); + case ENOMEM: + warnx("%s: type is unknown to this program%s", + string, line); + return (1); + default: + warn("%s%s", string, line); + return (1); + } } + free(newbuf); + if (!bflag) + printf(" -> "); + i = nflag; + nflag = 1; + j = show_var(mib, len, false); + if (!j && !bflag) + putchar('\n'); + nflag = i; return (0); } @@ -898,8 +906,8 @@ name2oid(const char *name, int *oidp) int i; size_t j; - oid[0] = 0; - oid[1] = 3; + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; j = CTL_MAXNAME * sizeof(int); i = sysctl(oid, 2, oidp, &j, name, strlen(name)); @@ -917,8 +925,8 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind) int i; size_t j; - qoid[0] = 0; - qoid[1] = 4; + qoid[0] = CTL_SYSCTL; + qoid[1] = CTL_SYSCTL_OIDFMT; memcpy(qoid + 2, oid, len * sizeof(int)); j = sizeof(buf); @@ -964,10 +972,10 @@ show_var(int *oid, int nlen, bool honor_skip) bzero(buf, BUFSIZ); bzero(fmt, BUFSIZ); bzero(name, BUFSIZ); - qoid[0] = 0; + qoid[0] = CTL_SYSCTL; memcpy(qoid + 2, oid, nlen * sizeof(int)); - qoid[1] = 1; + qoid[1] = CTL_SYSCTL_NAME; j = sizeof(name); i = sysctl(qoid, nlen + 2, name, &j, 0, 0); if (i || !j) @@ -1006,7 +1014,7 @@ show_var(int *oid, int nlen, bool honor_skip) printf("%s", prntype); return (0); } - qoid[1] = 5; + qoid[1] = CTL_SYSCTL_OIDDESCR; j = sizeof(buf); i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); printf("%s", buf); @@ -1227,9 +1235,8 @@ sysctl_all(int *oid, int len) if (len < 0 || l2 < (unsigned int)len) return (0); - for (i = 0; i < len; i++) - if (name2[i] != oid[i]) - return (0); + if (memcmp(name2, oid, len * sizeof(int)) != 0) + return (0); i = show_var(name2, l2, honor_skip); if (!i && !bflag) From owner-svn-src-all@freebsd.org Sat Oct 24 16:09:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 602A644D738; Sat, 24 Oct 2020 16:09:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJQym1Zqvz3V5W; Sat, 24 Oct 2020 16:09:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 171A31B10C; Sat, 24 Oct 2020 16:09:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OG9J3g087702; Sat, 24 Oct 2020 16:09:19 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OG9Jgd087697; Sat, 24 Oct 2020 16:09:19 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010241609.09OG9Jgd087697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 16:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367007 - in head/sys/netinet: . cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . cc X-SVN-Commit-Revision: 367007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:09:20 -0000 Author: rscheff Date: Sat Oct 24 16:09:18 2020 New Revision: 367007 URL: https://svnweb.freebsd.org/changeset/base/367007 Log: tcp: move cwnd and ssthresh updates into cc modules This will pave the way of setting ssthresh differently in TCP CUBIC, according to RFC8312 section 4.7. No functional change, only code movement. Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26807 Modified: head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:09:18 2020 (r367007) @@ -264,8 +264,10 @@ static void cubic_cong_signal(struct cc_var *ccv, uint32_t type) { struct cubic *cubic_data; + u_int mss; cubic_data = ccv->cc_data; + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -292,6 +294,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), + CCV(ccv, snd_cwnd)) / 2 / mss, + 2) * mss; + CCV(ccv, snd_cwnd) = mss; /* * Grab the current time and record it so we know when the * most recent congestion event was. Only record it when the Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_dctcp.c Sat Oct 24 16:09:18 2020 (r367007) @@ -235,7 +235,7 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -282,6 +282,10 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), + CCV(ccv, snd_cwnd)) / 2 / mss, + 2) * mss; + CCV(ccv, snd_cwnd) = mss; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_htcp.c Sat Oct 24 16:09:18 2020 (r367007) @@ -271,8 +271,10 @@ static void htcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct htcp *htcp_data; + u_int mss; htcp_data = ccv->cc_data; + mss = tcp_maxseg(ccv->ccvc.tcp); switch (type) { case CC_NDUPACK: @@ -311,6 +313,10 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), + CCV(ccv, snd_cwnd)) / 2 / mss, + 2) * mss; + CCV(ccv, snd_cwnd) = mss; /* * Grab the current time and record it so we know when the * most recent congestion event was. Only record it when the Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/cc/cc_newreno.c Sat Oct 24 16:09:18 2020 (r367007) @@ -237,7 +237,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) u_int mss; cwin = CCV(ccv, snd_cwnd); - mss = CCV(ccv, t_maxseg); + mss = tcp_maxseg(ccv->ccvc.tcp); nreno = ccv->cc_data; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; @@ -274,6 +274,12 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) CCV(ccv, snd_cwnd) = cwin; ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } + break; + case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), + CCV(ccv, snd_cwnd)) / 2 / mss, + 2) * mss; + CCV(ccv, snd_cwnd) = mss; break; } } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Oct 24 16:05:37 2020 (r367006) +++ head/sys/netinet/tcp_input.c Sat Oct 24 16:09:18 2020 (r367007) @@ -429,8 +429,6 @@ cc_conn_init(struct tcpcb *tp) void inline cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type) { - u_int maxseg; - INP_WLOCK_ASSERT(tp->t_inpcb); #ifdef STATS @@ -460,13 +458,9 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui } break; case CC_RTO: - maxseg = tcp_maxseg(tp); tp->t_dupacks = 0; tp->t_bytes_acked = 0; EXIT_RECOVERY(tp->t_flags); - tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / - maxseg) * maxseg; - tp->snd_cwnd = maxseg; if (tp->t_flags2 & TF2_ECN_PERMIT) tp->t_flags2 |= TF2_ECN_SND_CWR; break; From owner-svn-src-all@freebsd.org Sat Oct 24 16:11:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E018A44DAF8; Sat, 24 Oct 2020 16:11:46 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJR1Z5hqWz3VYj; Sat, 24 Oct 2020 16:11:46 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A66021B319; Sat, 24 Oct 2020 16:11:46 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OGBkJA089884; Sat, 24 Oct 2020 16:11:46 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OGBkxg089883; Sat, 24 Oct 2020 16:11:46 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010241611.09OGBkxg089883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 16:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367008 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 367008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:11:46 -0000 Author: rscheff Date: Sat Oct 24 16:11:46 2020 New Revision: 367008 URL: https://svnweb.freebsd.org/changeset/base/367008 Log: TCP Cubic: improve reaction to (and rollback from) RTO 1. fix compliancy issue of CUBIC RTO handling according to RFC8312 section 4.7 2. add CUBIC CC_RTO_ERR handling Submitted by: chengc_netapp.com Reviewed by: rrs, tuexen, rscheff MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26808 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:09:18 2020 (r367007) +++ head/sys/netinet/cc/cc_cubic.c Sat Oct 24 16:11:46 2020 (r367008) @@ -78,7 +78,7 @@ static void cubic_conn_init(struct cc_var *ccv); static int cubic_mod_init(void); static void cubic_post_recovery(struct cc_var *ccv); static void cubic_record_rtt(struct cc_var *ccv); -static void cubic_ssthresh_update(struct cc_var *ccv); +static void cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg); static void cubic_after_idle(struct cc_var *ccv); struct cubic { @@ -90,19 +90,28 @@ struct cubic { unsigned long max_cwnd; /* cwnd at the previous congestion event. */ unsigned long prev_max_cwnd; + /* A copy of prev_max_cwnd. Used for CC_RTO_ERR */ + unsigned long prev_max_cwnd_cp; /* various flags */ uint32_t flags; #define CUBICFLAG_CONG_EVENT 0x00000001 /* congestion experienced */ #define CUBICFLAG_IN_SLOWSTART 0x00000002 /* in slow start */ #define CUBICFLAG_IN_APPLIMIT 0x00000004 /* application limited */ +#define CUBICFLAG_RTO_EVENT 0x00000008 /* RTO experienced */ /* Minimum observed rtt in ticks. */ int min_rtt_ticks; /* Mean observed rtt between congestion epochs. */ int mean_rtt_ticks; /* ACKs since last congestion event. */ int epoch_ack_count; - /* Time of last congestion event in ticks. */ + /* Timestamp (in ticks) of arriving in congestion avoidance from last + * congestion event. + */ int t_last_cong; + /* Timestamp (in ticks) of a previous congestion event. Used for + * CC_RTO_ERR. + */ + int t_last_cong_prev; }; static MALLOC_DEFINE(M_CUBIC, "cubic data", @@ -142,7 +151,14 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data->flags |= CUBICFLAG_IN_SLOWSTART; newreno_cc_algo.ack_received(ccv, type); } else { - if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | + if ((cubic_data->flags & CUBICFLAG_RTO_EVENT) && + (cubic_data->flags & CUBICFLAG_IN_SLOWSTART)) { + /* RFC8312 Section 4.7 */ + cubic_data->flags &= ~(CUBICFLAG_RTO_EVENT | + CUBICFLAG_IN_SLOWSTART); + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + cubic_data->K = 0; + } else if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT)) { cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT); @@ -273,10 +289,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - cubic_ssthresh_update(ccv); + cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -284,37 +300,35 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) case CC_ECN: if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - cubic_ssthresh_update(ccv); + cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } break; case CC_RTO: - CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), - CCV(ccv, snd_cwnd)) / 2 / mss, - 2) * mss; - CCV(ccv, snd_cwnd) = mss; - /* - * Grab the current time and record it so we know when the - * most recent congestion event was. Only record it when the - * timeout has fired more than once, as there is a reasonable - * chance the first one is a false alarm and may not indicate - * congestion. - * This will put Cubic firmly into the concave / TCP friendly - * region, for a slower ramp-up after two consecutive RTOs. - */ - if (CCV(ccv, t_rxtshift) >= 2) { - cubic_data->flags |= CUBICFLAG_CONG_EVENT; - cubic_data->t_last_cong = ticks; - cubic_data->max_cwnd = CCV(ccv, snd_cwnd_prev); - cubic_data->K = cubic_k(cubic_data->max_cwnd / - CCV(ccv, t_maxseg)); + /* RFC8312 Section 4.7 */ + if (CCV(ccv, t_rxtshift) == 1) { + cubic_data->t_last_cong_prev = cubic_data->t_last_cong; + cubic_data->prev_max_cwnd_cp = cubic_data->prev_max_cwnd; } + cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; + cubic_data->prev_max_cwnd = cubic_data->max_cwnd; + CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) * + CUBIC_BETA) >> CUBIC_SHIFT; + CCV(ccv, snd_cwnd) = mss; break; + + case CC_RTO_ERR: + cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); + cubic_data->max_cwnd = cubic_data->prev_max_cwnd; + cubic_data->prev_max_cwnd = cubic_data->prev_max_cwnd_cp; + cubic_data->t_last_cong = cubic_data->t_last_cong_prev; + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); + break; } } @@ -436,7 +450,7 @@ cubic_record_rtt(struct cc_var *ccv) * Update the ssthresh in the event of congestion. */ static void -cubic_ssthresh_update(struct cc_var *ccv) +cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg) { struct cubic *cubic_data; uint32_t ssthresh; @@ -466,7 +480,7 @@ cubic_ssthresh_update(struct cc_var *ccv) ssthresh = ((uint64_t)cwnd * CUBIC_BETA) >> CUBIC_SHIFT; } - CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * CCV(ccv, t_maxseg)); + CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg); } DECLARE_CC_MODULE(cubic, &cubic_cc_algo); From owner-svn-src-all@freebsd.org Sat Oct 24 16:17:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D182144DD8F; Sat, 24 Oct 2020 16:17:08 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJR7m5BhQz3Vpy; Sat, 24 Oct 2020 16:17:08 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B7371B2AB; Sat, 24 Oct 2020 16:17:08 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OGH8rt094678; Sat, 24 Oct 2020 16:17:08 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OGH8ZN094676; Sat, 24 Oct 2020 16:17:08 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010241617.09OGH8ZN094676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 16:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367009 - in head: sbin/sysctl sys/kern X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: sbin/sysctl sys/kern X-SVN-Commit-Revision: 367009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:17:08 -0000 Author: freqlabs Date: Sat Oct 24 16:17:07 2020 New Revision: 367009 URL: https://svnweb.freebsd.org/changeset/base/367009 Log: sysctl+kern_sysctl: Honor SKIP for descendant nodes Ensure we also skip descendants of SKIP nodes when iterating through children of an explicitly specified node. Reported by: np Reviewed by: np MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26833 Modified: head/sbin/sysctl/sysctl.c head/sys/kern/kern_sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Sat Oct 24 16:11:46 2020 (r367008) +++ head/sbin/sysctl/sysctl.c Sat Oct 24 16:17:07 2020 (r367009) @@ -952,6 +952,7 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind) static int show_var(int *oid, int nlen, bool honor_skip) { + static int skip_len = 0, skip_oid[CTL_MAXNAME]; u_char buf[BUFSIZ], *val, *oval, *p; char name[BUFSIZ], fmt[BUFSIZ]; const char *sep, *sep1, *prntype; @@ -1021,9 +1022,21 @@ show_var(int *oid, int nlen, bool honor_skip) return (0); } + /* keep track of encountered skip nodes, ignoring descendants */ + if (skip_len == 0 && (kind & CTLFLAG_SKIP) != 0) { + /* Save this oid so we can skip descendants. */ + skip_len = nlen * sizeof(int); + memcpy(skip_oid, oid, skip_len); + } + /* bail before fetching the value if we're honoring skip */ - if (honor_skip && (kind & CTLFLAG_SKIP) != 0) - return (1); + if (honor_skip) { + if (0 < skip_len && skip_len <= nlen * (int)sizeof(int) && + memcmp(skip_oid, oid, skip_len) == 0) + return (1); + /* Not a skip node or descendant of a skip node. */ + skip_len = 0; + } /* don't fetch opaques that we don't know how to print */ if (ctltype == CTLTYPE_OPAQUE) { Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Oct 24 16:11:46 2020 (r367008) +++ head/sys/kern/kern_sysctl.c Sat Oct 24 16:17:07 2020 (r367009) @@ -1126,9 +1126,13 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int * We have reached a node with a full name match and are * looking for the next oid in its children. * + * For CTL_SYSCTL_NEXTNOSKIP we are done. + * * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it * has a handler) and move on to the children. */ + if (!honor_skip) + return (0); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) @@ -1163,9 +1167,13 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int /* * We have reached the next oid. * + * For CTL_SYSCTL_NEXTNOSKIP we are done. + * * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it * has a handler) and move on to the children. */ + if (!honor_skip) + return (0); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); if (oidp->oid_handler) From owner-svn-src-all@freebsd.org Sat Oct 24 16:25:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73FD144E0F6; Sat, 24 Oct 2020 16:25:53 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJRKs2R6Gz3Wfg; Sat, 24 Oct 2020 16:25:53 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36F631B66E; Sat, 24 Oct 2020 16:25:53 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OGPrIN001016; Sat, 24 Oct 2020 16:25:53 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OGPrik001015; Sat, 24 Oct 2020 16:25:53 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010241625.09OGPrik001015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 16:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367010 - head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Commit-Revision: 367010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:25:53 -0000 Author: freqlabs Date: Sat Oct 24 16:25:52 2020 New Revision: 367010 URL: https://svnweb.freebsd.org/changeset/base/367010 Log: Skip RAW kstat sysctls by default hese kstats are often expensive to compute so we want to avoid them unless specifically requested. The following kstats are affected by this change: kstat.zfs.${pool}.multihost kstat.zfs.${pool}.misc.state kstat.zfs.${pool}.txgs kstat.zfs.misc.fletcher_4_bench kstat.zfs.misc.vdev_raidz_bench kstat.zfs.misc.dbufs kstat.zfs.misc.dbgmsg PR: 249258 Reported by: mjg Reviewed by: mjg, allanjude Obtained from: https://github.com/openzfs/zfs/pull/11099 Sponsored by: iXsystems, Inc. Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Sat Oct 24 16:17:07 2020 (r367009) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c Sat Oct 24 16:25:52 2020 (r367010) @@ -475,14 +475,14 @@ kstat_install(kstat_t *ksp) if (ksp->ks_raw_ops.data) { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_STRING | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "A", ksp->ks_name); } else { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_OPAQUE | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "", ksp->ks_name); } break; From owner-svn-src-all@freebsd.org Sat Oct 24 16:40:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C791644E605; Sat, 24 Oct 2020 16:40:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJRfp4xj8z3XWR; Sat, 24 Oct 2020 16:40:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D0951B5B3; Sat, 24 Oct 2020 16:40:34 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OGeYIi007229; Sat, 24 Oct 2020 16:40:34 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OGeYfp007228; Sat, 24 Oct 2020 16:40:34 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010241640.09OGeYfp007228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 24 Oct 2020 16:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367011 - head/usr.bin/getent X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/getent X-SVN-Commit-Revision: 367011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:40:34 -0000 Author: fernape (ports committer) Date: Sat Oct 24 16:40:34 2020 New Revision: 367011 URL: https://svnweb.freebsd.org/changeset/base/367011 Log: getent(1): Add EXAMPLES section Add 3 small examples to the EXAMPLES section. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26866 Modified: head/usr.bin/getent/getent.1 Modified: head/usr.bin/getent/getent.1 ============================================================================== --- head/usr.bin/getent/getent.1 Sat Oct 24 16:25:52 2020 (r367010) +++ head/usr.bin/getent/getent.1 Sat Oct 24 16:40:34 2020 (r367011) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2016 +.Dd October 24, 2020 .Dt GETENT 1 .Os .Sh NAME @@ -103,6 +103,24 @@ utility exits 0 on success, .Ar database , or 3 if there is no support for enumeration on .Ar database . +.Sh EXAMPLES +Show entry for user sshd from the passwd database: +.Bd -literal -offset indent +$ getent passwd sshd +sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +.Ed +.Pp +Show entry for TCP from the protocols database: +.Bd -literal -offset indent +$ getent protocols tcp +tcp 6 TCP +.Ed +.Pp +Show entry for the localhost IPv6 address ::1 from the hosts database: +.Bd -literal -offset indent +$ getent hosts ::1 +::1 localhost localhost.my.domain +.Ed .Sh SEE ALSO .Xr getutxent 3 , .Xr ethers 5 , @@ -123,7 +141,4 @@ command appeared in .Nx 3.0 , and was imported into .Fx 7.0 . -It was based on the command of the same name in -.Tn Solaris -and -.Tn Linux . +It was based on the command of the same name in Solaris and Linux. From owner-svn-src-all@freebsd.org Sat Oct 24 16:42:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAC8344E279; Sat, 24 Oct 2020 16:42:36 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJRj84cjNz3Xj8; Sat, 24 Oct 2020 16:42:36 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A891B840; Sat, 24 Oct 2020 16:42:36 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OGgamh013001; Sat, 24 Oct 2020 16:42:36 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OGgaos013000; Sat, 24 Oct 2020 16:42:36 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010241642.09OGgaos013000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 24 Oct 2020 16:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367012 - head/bin/pwd X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/pwd X-SVN-Commit-Revision: 367012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:42:36 -0000 Author: fernape (ports committer) Date: Sat Oct 24 16:42:35 2020 New Revision: 367012 URL: https://svnweb.freebsd.org/changeset/base/367012 Log: pwd(1): Add EXAMPLES section Small EXAMPLES section. Add reference to realpath(1) due to similarity. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26862 Modified: head/bin/pwd/pwd.1 Modified: head/bin/pwd/pwd.1 ============================================================================== --- head/bin/pwd/pwd.1 Sat Oct 24 16:40:34 2020 (r367011) +++ head/bin/pwd/pwd.1 Sat Oct 24 16:42:35 2020 (r367012) @@ -32,7 +32,7 @@ .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd October 24, 2020 .Dt PWD 1 .Os .Sh NAME @@ -74,10 +74,30 @@ Logical current working directory. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show current working directory with symbolic links resolved: +.Bd -literal -offset indent +$ /bin/pwd +/usr/home/fernape +.Ed +.Pp +Show the logical current directory. +Then use +.Xr file 1 +to inspect the +.Pa /home +directory: +.Bd -literal -offset indent +$ /bin/pwd -L +/home/fernape +$ file /home +/home: symbolic link to usr/home +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr cd 1 , .Xr csh 1 , +.Xr realpath 1 , .Xr sh 1 , .Xr getcwd 3 .Sh STANDARDS From owner-svn-src-all@freebsd.org Sat Oct 24 16:44:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6EC244E87F; Sat, 24 Oct 2020 16:44:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJRlC5yxvz3Y6G; Sat, 24 Oct 2020 16:44:23 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f53.google.com with SMTP id l24so4734261edj.8; Sat, 24 Oct 2020 09:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rfy5XXmOD/9UEQzxrx9Q9XvvPvcqMFhpZb8CEkDyz6Y=; b=FzvmFfdYKNePYr0cLVOCHxEPkIkJlbHGJztLb6emvVczr8/j+rUV7JXVHkHv4bxtUA AqJ4kn6ua3EgO4jqvk9L9eufTdr8F9Sf0eQw7rCCvGav1jeLl9QewROCEP23TYoGxfgM SY2ntQfdSimJnkI3+8+QBnzrMoN+4NMyjZWY9v+PoiaW4qYwKIL07kiM2up6FwBnKn8E s/RJf/tTb3x6DyRZPLTiu/LWqrPSEMOEKSjO82j4YRmcPKeKTscRITnJu7SzLcKo/kcj B/2KHY4xuRmo1yWhZ9HsiCccGXln2ysuNQO3VFahdivedAWO0TNXR7nGqJvpw24h39y1 6ftg== X-Gm-Message-State: AOAM5300lfvikLDbFc7N8ZKh8+9bGBzI2SY4cYmMCUDw5oFaVmcqCGLT 9MNVGrXXNfeJdP1cH7hiloQ92NSngFeT4n0D X-Google-Smtp-Source: ABdhPJyBFPTeMVhuAmP/ZQo8eRda8Sm6KGNhNXABycceazcpKugx53VhgoN+kAR0ty4NbtPJ90ebGg== X-Received: by 2002:aa7:d495:: with SMTP id b21mr7603698edr.231.1603557861933; Sat, 24 Oct 2020 09:44:21 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id j1sm1052097eje.118.2020.10.24.09.44.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Oct 2020 09:44:21 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id c194so5683283wme.2; Sat, 24 Oct 2020 09:44:21 -0700 (PDT) X-Received: by 2002:a1c:c28a:: with SMTP id s132mr3019729wmf.13.1603557861172; Sat, 24 Oct 2020 09:44:21 -0700 (PDT) MIME-Version: 1.0 References: <202010241023.09OANMcL075640@repo.freebsd.org> <20201024125206.GB38000@FreeBSD.org> <999a005e-1ef8-3c45-fb07-94a3b6ebce1b@selasky.org> <317231603546378@mail.yandex.ru> In-Reply-To: From: Alexander Richardson Date: Sat, 24 Oct 2020 17:44:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366993 - head/sys/net To: Warner Losh Cc: "Alexander V. Chernikov" , Hans Petter Selasky , Alexey Dokuchaev , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CJRlC5yxvz3Y6G X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.208.53 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-2.46 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.964]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.43)[-0.432]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.53:from]; NEURAL_HAM_MEDIUM(-1.06)[-1.060]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.53:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 16:44:24 -0000 On Sat, 24 Oct 2020, 16:27 Warner Losh, wrote: > > > On Sat, Oct 24, 2020, 7:38 AM Alexander V. Chernikov > wrote: > >> 24.10.2020, 14:08, "Hans Petter Selasky" : >> > On 2020-10-24 14:52, Alexey Dokuchaev wrote: >> >> On Sat, Oct 24, 2020 at 10:23:22AM +0000, Hans Petter Selasky wrote: >> >>> New Revision: 366993 >> >>> URL: https://svnweb.freebsd.org/changeset/base/366993 >> >>> >> >>> Log: >> >>> Run code through "clang-format -style=file" with some additional >> fixes. >> >>> No functional change. >> >>> >> >>> ... >> >>> @@ -99,8 +97,8 @@ infiniband_ipv4_multicast_map(uint32_t addr, >> >>> >> >>> #ifdef INET6 >> >>> static inline void >> >>> -infiniband_ipv6_multicast_map(const struct in6_addr *addr, >> >>> - const uint8_t *broadcast, uint8_t *buf) >> >>> +infiniband_ipv6_multicast_map( >> >>> + const struct in6_addr *addr, const uint8_t *broadcast, uint8_t >> *buf) >> >>> { >> >> >> >> This is not how we format these in FreeBSD, please revert. It was >> correct >> >> before and no "fix" is need here. >> Given we already have nice .clang-format, that does most of the job, >> maybe it's worth considering looking into tweaking it further to fix this >> part? >> It would be nice if we could finally offload all formatting issues to the >> tool and focus on the actual code :-) >> > > It would be nice if it produced one of the style(9) acceptable formats > without disrupting things already acceptable. That's been the big problem > with the tweaks to date... some things are fixed, others break. It's > getting a lot closer, though > I've upstreamed a few fixes, but haven't got to the line wrapping/continuation indentation stuff yet. That part of clang format is not particularly easy to modify without breaking other stuff and I'm also rather short on time right now, so probably won't get to it any time soon. Alex From owner-svn-src-all@freebsd.org Sat Oct 24 17:09:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9107244F24A; Sat, 24 Oct 2020 17:09:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJSHf3bN3z3Zf1; Sat, 24 Oct 2020 17:09:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E5251BE0D; Sat, 24 Oct 2020 17:09:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OH921w025673; Sat, 24 Oct 2020 17:09:02 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OH8xtM025653; Sat, 24 Oct 2020 17:08:59 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010241708.09OH8xtM025653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 17:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367013 - in head: . contrib/mandoc etc/mtree lib lib/flua lib/flua/libjail share/examples share/examples/flua share/man share/man/man3lua usr.bin/man X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: . contrib/mandoc etc/mtree lib lib/flua lib/flua/libjail share/examples share/examples/flua share/man share/man/man3lua usr.bin/man X-SVN-Commit-Revision: 367013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 17:09:02 -0000 Author: freqlabs Date: Sat Oct 24 17:08:59 2020 New Revision: 367013 URL: https://svnweb.freebsd.org/changeset/base/367013 Log: flua: Add a libjail module libjail is pretty small, so it makes for a good proof of concept demonstrating how a system library can be wrapped to create a loadable Lua module for flua. * Introduce 3lua section for man pages * Add libjail module Reviewed by: kevans, manpages Relnotes: yes Differential Revision: https://reviews.freebsd.org/D26080 Added: head/lib/flua/ head/lib/flua/Makefile (contents, props changed) head/lib/flua/libjail/ head/lib/flua/libjail/Makefile (contents, props changed) head/lib/flua/libjail/jail.3lua (contents, props changed) head/lib/flua/libjail/lua_jail.c (contents, props changed) head/share/examples/flua/ head/share/examples/flua/libjail.lua (contents, props changed) head/share/man/man3lua/ head/share/man/man3lua/Makefile (contents, props changed) head/share/man/man3lua/intro.3lua (contents, props changed) Modified: head/Makefile.inc1 head/contrib/mandoc/msec.in head/etc/mtree/BSD.usr.dist head/lib/Makefile head/share/examples/Makefile head/share/man/Makefile head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Oct 24 16:42:35 2020 (r367012) +++ head/Makefile.inc1 Sat Oct 24 17:08:59 2020 (r367013) @@ -2829,6 +2829,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libelf lib/libexpat \ lib/libfigpar \ ${_lib_libgssapi} \ + lib/libjail \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ lib/libzstd \ ${_lib_casper} \ Modified: head/contrib/mandoc/msec.in ============================================================================== --- head/contrib/mandoc/msec.in Sat Oct 24 16:42:35 2020 (r367012) +++ head/contrib/mandoc/msec.in Sat Oct 24 17:08:59 2020 (r367013) @@ -25,6 +25,7 @@ LINE("1", "FreeBSD General Commands Manual") LINE("2", "FreeBSD System Calls Manual") LINE("3", "FreeBSD Library Functions Manual") +LINE("3lua", "Lua Library Functions Manual") LINE("3p", "Perl Library Functions Manual") LINE("4", "FreeBSD Kernel Interfaces Manual") LINE("5", "FreeBSD File Formats Manual") Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Oct 24 16:42:35 2020 (r367012) +++ head/etc/mtree/BSD.usr.dist Sat Oct 24 17:08:59 2020 (r367013) @@ -281,6 +281,8 @@ .. find_interface .. + flua + .. hast .. hostapd @@ -856,6 +858,8 @@ man2 .. man3 + .. + man3lua .. man4 aarch64 Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Oct 24 16:42:35 2020 (r367012) +++ head/lib/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -142,6 +142,11 @@ SUBDIR_DEPEND_liblzma= ${_libthr} SUBDIR_DEPEND_libpcap= ofed .endif +.if !defined(COMPAT_32BIT) +SUBDIR+= flua +SUBDIR_DEPEND_flua= libjail +.endif + # NB: keep these sorted by MK_* knobs SUBDIR.${MK_ATM}+= libngatm Added: head/lib/flua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= libjail + +.include Added: head/lib/flua/libjail/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/libjail/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SHLIB_NAME= jail.so +SHLIBDIR= ${LIBDIR}/flua + +SRCS+= lua_jail.c + +CFLAGS+= \ + -I${SRCTOP}/contrib/lua/src \ + -I${SRCTOP}/lib/liblua \ + +LIBADD+= jail + +MAN= jail.3lua + +.include Added: head/lib/flua/libjail/jail.3lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/libjail/jail.3lua Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,210 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020, Ryan Moeller +.\" +.\" 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 24, 2020 +.Dt JAIL 3lua +.Os +.Sh NAME +.Nm getid , +.Nm getname , +.Nm allparams , +.Nm getparams , +.Nm setparams , +.Nm CREATE , +.Nm UPDATE , +.Nm ATTACH , +.Nm DYING +.Nd Lua binding to +.Xr jail 3 +.Sh SYNOPSIS +.Bd -literal +local jail = require('jail') +.Ed +.Pp +.Bl -tag -width XXXX -compact +.It Dv jid, err = jail.getid(name) +.It Dv name, err = jail.getname(jid) +.It Dv params, err = jail.allparams() +.It Dv jid, res = jail.getparams(jid|name, params [, flags ] ) +.It Dv jid, err = jail.setparams(jid|name, params, flags ) +.It Dv jail.CREATE +.It Dv jail.UPDATE +.It Dv jail.ATTACH +.It Dv jail.DYING +.El +.Sh DESCRIPTION +The +.Nm jail +module is a binding to the +.Xr jail 3 +library. +It provides a string-oriented interface for the +.Xr jail_get 2 +and +.Xr jail_set 2 +system calls. +.Bl -tag -width XXXX +.It Dv jid, err = jail.getid(name) +Get the jail identifier +.Pq jid +as an integer. +.Fa name +is the name of a jail or a jid in the form of a string. +.It Dv name, err = jail.getname(jid) +Get the name of a jail as a string for the given +.Fa jid +.Pq an integer . +.It Dv params, err = jail.allparams() +Get a list of all supported parameter names +.Pq as strings . +See +.Xr jail 8 +for descriptions of the core jail parameters. +.It Dv jid, res = jail.getparams(jid|name, params [, flags ] ) +Get a table of the requested parameters for the given jail. +.Nm jid|name +can either be the jid as an integer or the jid or name as a string. +.Nm params +is a list of parameter names. +.Nm flags +is an optional integer representing the flag bits to apply for the operation. +See the list of flags below. +Only the +.Dv DYING +flag is valid to set. +.It Dv jid, err = jail.setparams(jid|name, params [, flags ] ) +Set parameters for a given jail. +This is used to create, update, attach to, or destroy a jail. +.Nm jid|name +can either be the jid as an integer or the jid or name as a string. +.Nm params +is a table of parameters to apply to the jail, where each key in the table +is a parameter name as a string and each value is a string that will be +converted to the internal value type by +.Xr jailparam_import 3 . +.Nm flags +is an optional integer representing the flag bits to apply for the operation. +See the list of flags below. +.El +.Pp +The +.Nm flags +arguments are an integer bitwise-or combination of one or more of the following +flags: +.Bl -tag -width XXXX +.It Dv jail.CREATE +Used with +.Fn setparams +to create a new jail. +The jail must not already exist, unless combined with +.Dv UPDATE . +.It Dv jail.UPDATE +Used with +.Fn setparams +to modify an existing jail. +The jail must already exist, unless combined with +.Dv CREATE . +.It Dv jail.ATTACH +Used with +.Fn setparams +in combination with +.Dv CREATE +or +.Dv UPDATE +to attach the current process to a jail. +.It Dv jail.DYING +Allow operating on a jail that is in the process of being removed. +.El +.Sh RETURN VALUES +The +.Fn getid +and +.Fn setparams +functions return a jail identifier integer on success, or +.Dv nil +and an error message string if an error occurred. +.Pp +The +.Fn getname +function returns a jail name string on success, or +.Dv nil +and an error message string if an error occurred. +.Pp +The +.Fn allparams +function returns a list of parameter name strings on success, or +.Dv nil +and an error message string if an error occurred. +.Pp +The +.Fn getparams +function returns a jail identifier integer and a table of jail parameters +with parameter name strings as keys and strings for values on success, or +.Dv nil +and an error message string if an error occurred. +.Sh EXAMPLES +Set the hostname of jail +.Dq foo +to +.Dq foo.bar : +.Bd -literal -offset indent +local jail = require('jail') + +jid, err = jail.setparams("foo", {["host.hostname"]="foo.bar"}, + jail.UPDATE) +if not jid then + error(err) +end +.Ed +.Pp +Retrieve the hostname of jail +.Dq foo : +.Bd -literal -offset indent +local jail = require('jail') + +jid, res = jail.getparams("foo", {"host.hostname"}) +if not jid then + error(res) +end +print(res["host.hostname"]) +.Ed +.Sh SEE ALSO +.Xr jail 2 , +.Xr jail 3 , +.Xr jail 8 +.Sh HISTORY +The +.Nm jail +Lua module for flua first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An Ryan Moeller , +with inspiration from +.Nx +gpio(3lua), by +.An Mark Balmer . Added: head/lib/flua/libjail/lua_jail.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/flua/libjail/lua_jail.c Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,391 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020, Ryan Moeller + * + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +int luaopen_jail(lua_State *); + +static int +l_getid(lua_State *L) +{ + const char *name; + int jid; + + name = luaL_checkstring(L, 1); + jid = jail_getid(name); + if (jid == -1) { + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + lua_pushinteger(L, jid); + return (1); +} + +static int +l_getname(lua_State *L) +{ + char *name; + int jid; + + jid = luaL_checkinteger(L, 1); + name = jail_getname(jid); + if (name == NULL) { + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + lua_pushstring(L, name); + free(name); + return (1); +} + +static int +l_allparams(lua_State *L) +{ + struct jailparam *params; + int params_count; + + params_count = jailparam_all(¶ms); + if (params_count == -1) { + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + lua_newtable(L); + for (int i = 0; i < params_count; ++i) { + lua_pushstring(L, params[i].jp_name); + lua_rawseti(L, -2, i + 1); + } + jailparam_free(params, params_count); + free(params); + return (1); +} + +static int +l_getparams(lua_State *L) +{ + const char *name; + struct jailparam *params; + size_t params_count, skipped; + int flags, jid, type; + + type = lua_type(L, 1); + luaL_argcheck(L, type == LUA_TSTRING || type == LUA_TNUMBER, 1, + "expected a jail name (string) or id (integer)"); + luaL_checktype(L, 2, LUA_TTABLE); + params_count = 1 + lua_rawlen(L, 2); + luaL_argcheck(L, params_count > 1, 2, "expected #params > 0"); + flags = luaL_optinteger(L, 3, 0); + + params = malloc(params_count * sizeof(struct jailparam)); + if (params == NULL) + return (luaL_error(L, "malloc: %s", strerror(errno))); + + /* + * Set the jail name or id param as determined by the first arg. + */ + + if (type == LUA_TSTRING) { + if (jailparam_init(¶ms[0], "name") == -1) { + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + name = lua_tostring(L, 1); + if (jailparam_import(¶ms[0], name) == -1) { + jailparam_free(params, 1); + free(params); + return (luaL_error(L, "jailparam_import: %s", + jail_errmsg)); + } + } else /* type == LUA_TNUMBER */ { + if (jailparam_init(¶ms[0], "jid") == -1) { + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + jid = lua_tointeger(L, 1); + if (jailparam_import_raw(¶ms[0], &jid, sizeof(jid)) == -1) { + jailparam_free(params, 1); + free(params); + return (luaL_error(L, "jailparam_import_raw: %s", + jail_errmsg)); + } + } + + /* + * Set the remaining param names being requested. + */ + + skipped = 0; + for (size_t i = 1; i < params_count; ++i) { + const char *param_name; + + lua_rawgeti(L, -1, i); + param_name = lua_tostring(L, -1); + if (param_name == NULL) { + jailparam_free(params, i - skipped); + free(params); + return (luaL_argerror(L, 2, + "param names must be strings")); + } + lua_pop(L, 1); + /* Skip name or jid, whichever was given. */ + if (type == LUA_TSTRING) { + if (strcmp(param_name, "name") == 0) { + ++skipped; + continue; + } + } else /* type == LUA_TNUMBER */ { + if (strcmp(param_name, "jid") == 0) { + ++skipped; + continue; + } + } + if (jailparam_init(¶ms[i - skipped], param_name) == -1) { + jailparam_free(params, i - skipped); + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + } + params_count -= skipped; + + /* + * Get the values and convert to a table. + */ + + jid = jailparam_get(params, params_count, flags); + if (jid == -1) { + jailparam_free(params, params_count); + free(params); + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + lua_pushinteger(L, jid); + + lua_newtable(L); + for (size_t i = 0; i < params_count; ++i) { + char *value; + + value = jailparam_export(¶ms[i]); + lua_pushstring(L, value); + free(value); + lua_setfield(L, -2, params[i].jp_name); + } + + jailparam_free(params, params_count); + free(params); + + return (2); +} + +static int +l_setparams(lua_State *L) +{ + const char *name; + struct jailparam *params; + size_t params_count; + int flags, jid, type; + + type = lua_type(L, 1); + luaL_argcheck(L, type == LUA_TSTRING || type == LUA_TNUMBER, 1, + "expected a jail name (string) or id (integer)"); + luaL_checktype(L, 2, LUA_TTABLE); + + lua_pushnil(L); + for (params_count = 1; lua_next(L, 2) != 0; ++params_count) + lua_pop(L, 1); + luaL_argcheck(L, params_count > 1, 2, "expected #params > 0"); + + flags = luaL_optinteger(L, 3, 0); + + params = malloc(params_count * sizeof(struct jailparam)); + if (params == NULL) + return (luaL_error(L, "malloc: %s", strerror(errno))); + + /* + * Set the jail name or id param as determined by the first arg. + */ + + if (type == LUA_TSTRING) { + if (jailparam_init(¶ms[0], "name") == -1) { + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + name = lua_tostring(L, 1); + if (jailparam_import(¶ms[0], name) == -1) { + jailparam_free(params, 1); + free(params); + return (luaL_error(L, "jailparam_import: %s", + jail_errmsg)); + } + } else /* type == LUA_TNUMBER */ { + if (jailparam_init(¶ms[0], "jid") == -1) { + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + jid = lua_tointeger(L, 1); + if (jailparam_import_raw(¶ms[0], &jid, sizeof(jid)) == -1) { + jailparam_free(params, 1); + free(params); + return (luaL_error(L, "jailparam_import_raw: %s", + jail_errmsg)); + } + } + + /* + * Set the rest of the provided params. + */ + + lua_pushnil(L); + for (size_t i = 1; i < params_count && lua_next(L, 2) != 0; ++i) { + const char *value; + + name = lua_tostring(L, -2); + if (name == NULL) { + jailparam_free(params, i); + free(params); + return (luaL_argerror(L, 2, + "param names must be strings")); + } + if (jailparam_init(¶ms[i], name) == -1) { + jailparam_free(params, i); + free(params); + return (luaL_error(L, "jailparam_init: %s", + jail_errmsg)); + } + + value = lua_tostring(L, -1); + if (value == NULL) { + jailparam_free(params, i + 1); + free(params); + return (luaL_argerror(L, 2, + "param values must be strings")); + } + if (jailparam_import(¶ms[i], value) == -1) { + jailparam_free(params, i + 1); + free(params); + return (luaL_error(L, "jailparam_import: %s", + jail_errmsg)); + } + + lua_pop(L, 1); + } + + /* + * Attempt to set the params. + */ + + jid = jailparam_set(params, params_count, flags); + if (jid == -1) { + jailparam_free(params, params_count); + free(params); + lua_pushnil(L); + lua_pushstring(L, jail_errmsg); + return (2); + } + lua_pushinteger(L, jid); + + jailparam_free(params, params_count); + free(params); + return (1); +} + +static const struct luaL_Reg l_jail[] = { + /** Get id of a jail by name. + * @param name jail name (string) + * @return jail id (integer) + * or nil, error (string) on error + */ + {"getid", l_getid}, + /** Get name of a jail by id. + * @param jid jail id (integer) + * @return jail name (string) + * or nil, error (string) on error + */ + {"getname", l_getname}, + /** Get a list of all known jail parameters. + * @return list of jail parameter names (table of strings) + * or nil, error (string) on error + */ + {"allparams", l_allparams}, + /** Get the listed params for a given jail. + * @param jail jail name (string) or id (integer) + * @param params list of parameter names (table of strings) + * @param flags optional flags (integer) + * @return jid (integer), params (table of [string] = string) + * or nil, error (string) on error + */ + {"getparams", l_getparams}, + /** Set params for a given jail. + * @param jail jail name (string) or id (integer) + * @param params params and values (table of [string] = string) + * @param flags optional flags (integer) + * @return jid (integer) + * or nil, error (string) on error + */ + {"setparams", l_setparams}, + {NULL, NULL} +}; + +int +luaopen_jail(lua_State *L) +{ + lua_newtable(L); + + luaL_setfuncs(L, l_jail, 0); + + lua_pushinteger(L, JAIL_CREATE); + lua_setfield(L, -2, "CREATE"); + lua_pushinteger(L, JAIL_UPDATE); + lua_setfield(L, -2, "UPDATE"); + lua_pushinteger(L, JAIL_ATTACH); + lua_setfield(L, -2, "ATTACH"); + lua_pushinteger(L, JAIL_DYING); + lua_setfield(L, -2, "DYING"); + + return (1); +} Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Sat Oct 24 16:42:35 2020 (r367012) +++ head/share/examples/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -16,6 +16,7 @@ LDIRS= BSD_daemon \ drivers \ etc \ find_interface \ + flua \ indent \ ipfw \ jails \ @@ -97,6 +98,9 @@ SE_FIND_INTERFACE= \ Makefile \ README \ find_interface.c + +SE_DIRS+= flua +SE_FLUA= libjail.lua SE_DIRS+= indent SE_INDENT= indent.pro Added: head/share/examples/flua/libjail.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/flua/libjail.lua Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,60 @@ +#!/usr/libexec/flua +--[[ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020, Ryan Moeller + * + * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * 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$ + */ +]]-- + +jail = require("jail") +ucl = require("ucl") + +name = "demo" + +-- Create a persistent jail named "demo" with all other parameters default. +jid, err = jail.setparams(name, {persist = "true"}, jail.CREATE) +if not jid then + error(err) +end + +-- Get a list of all known jail parameter names. +allparams = jail.allparams() + +-- Get all the parameters of the jail we created. +jid, res = jail.getparams(name, allparams) +if not jid then + error(res) +end + +-- Display the jail's parameters as a pretty-printed JSON object. +print(ucl.to_json(res)) + +-- Update the "persist" parameter to "false" to remove the jail. +jid, err = jail.setparams(name, {persist = "false"}, jail.UPDATE) +if not jid then + error(err) +end Modified: head/share/man/Makefile ============================================================================== --- head/share/man/Makefile Sat Oct 24 16:42:35 2020 (r367012) +++ head/share/man/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -4,7 +4,7 @@ .include # XXX MISSING: man3f -SUBDIR= man1 man3 man4 man5 man6 man7 man8 man9 +SUBDIR= man1 man3 man3lua man4 man5 man6 man7 man8 man9 SUBDIR_PARALLEL= MAKEWHATIS?= makewhatis Added: head/share/man/man3lua/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3lua/Makefile Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.include + +MAN= intro.3lua + +.include Added: head/share/man/man3lua/intro.3lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3lua/intro.3lua Sat Oct 24 17:08:59 2020 (r367013) @@ -0,0 +1,65 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020, Ryan Moeller +.\" +.\" 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 24, 2020 +.Dt INTRO 3lua +.Os +.Sh NAME +.Nm intro +.Nd introduction to the Lua modules for flua +.Po +.Fx +Lua +.Pc +.Sh DESCRIPTION +This section describes +.Em flua +.Po +.Fx +Lua +.Pc +and the Lua modules provided in the +.Fx +base system. +.Pp +The Lua modules provided by +.Fx +are: +.Bl -tag -width jail +.It Xr jail 3lua +Wrapper for +.Xr jail 3 . +.El +.Sh SEE ALSO +.Xr jail 3lua +.Sh AUTHORS +.An Ryan Moeller , +with inspiration from +.Nx +intro(3lua), by +.An Marc Balmer . Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Sat Oct 24 16:42:35 2020 (r367012) +++ head/usr.bin/man/man.1 Sat Oct 24 17:08:59 2020 (r367013) @@ -365,6 +365,7 @@ Local configuration files. .Xr whatis 1 , .Xr intro 2 , .Xr intro 3 , +.Xr intro 3lua , .Xr intro 4 , .Xr intro 5 , .Xr man.conf 5 , Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Sat Oct 24 16:42:35 2020 (r367012) +++ head/usr.bin/man/man.sh Sat Oct 24 17:08:59 2020 (r367013) @@ -1012,7 +1012,7 @@ STTY=/bin/stty SYSCTL=/sbin/sysctl debug=0 -man_default_sections='1:8:2:3:n:4:5:6:7:9:l' +man_default_sections='1:8:2:3:3lua:n:4:5:6:7:9:l' man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/share/man:/usr/local/man' cattool='/usr/bin/zcat -f' From owner-svn-src-all@freebsd.org Sat Oct 24 17:11:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84D4344F1D7 for ; Sat, 24 Oct 2020 17:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJSLp1c8Dz3Znw; Sat, 24 Oct 2020 17:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01DAB1BF67; Sat, 24 Oct 2020 17:11:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OHBjAS026755; Sat, 24 Oct 2020 17:11:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OHBjj9026754; Sat, 24 Oct 2020 17:11:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010241711.09OHBjj9026754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 24 Oct 2020 17:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r367014 - X-SVN-Group: defaults X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: X-SVN-Commit-Revision: 367014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 17:11:46 -0000 Author: kevans Date: Sat Oct 24 17:11:45 2020 New Revision: 367014 URL: https://svnweb.freebsd.org/changeset/base/367014 Log: base: add *.3lua to auto-props r367013 added a 3lua section for manpages that describe lua libraries. Recognize this in auto-props as well, same properties as *.[0-9]. Modified: Directory Properties: / (props changed) From owner-svn-src-all@freebsd.org Sat Oct 24 17:25:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA55D44F134; Sat, 24 Oct 2020 17:25:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJSf456Fqz3bJZ; Sat, 24 Oct 2020 17:25:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09OHOqDi043466 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 24 Oct 2020 20:24:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09OHOqDi043466 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09OHOqCj043465; Sat, 24 Oct 2020 20:24:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 24 Oct 2020 20:24:52 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366997 - head/sys/kern Message-ID: <20201024172452.GD2643@kib.kiev.ua> References: <202010241330.09ODUb6x089521@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010241330.09ODUb6x089521@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CJSf456Fqz3bJZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 17:25:01 -0000 On Sat, Oct 24, 2020 at 01:30:37PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Oct 24 13:30:37 2020 > New Revision: 366997 > URL: https://svnweb.freebsd.org/changeset/base/366997 > > Log: > vfs: fix a race where reclaim vholds freed vnodes A description of the race in the commit message would be respectful to other readers of the code, so that we do not need to reverse-eng the change to understand what and why was fixed. > > Reported by: pho > Tested by: pho (previous version) > Fixes: r366974 ("vfs: stop taking the interlock in vnode reclaim") > > Modified: > head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Sat Oct 24 13:16:10 2020 (r366996) > +++ head/sys/kern/vfs_subr.c Sat Oct 24 13:30:37 2020 (r366997) > @@ -109,6 +109,7 @@ static void syncer_shutdown(void *arg, int howto); > static int vtryrecycle(struct vnode *vp); > static void v_init_counters(struct vnode *); > static void vgonel(struct vnode *); > +static bool vhold_recycle(struct vnode *); > static void vfs_knllock(void *arg); > static void vfs_knlunlock(void *arg); > static void vfs_knl_assert_locked(void *arg); > @@ -1126,7 +1127,8 @@ restart: > goto next_iter; > } > > - vhold(vp); > + if (!vhold_recycle(vp)) > + goto next_iter; > TAILQ_REMOVE(&vnode_list, mvp, v_vnodelist); > TAILQ_INSERT_AFTER(&vnode_list, vp, mvp, v_vnodelist); > mtx_unlock(&vnode_list_mtx); > @@ -1231,7 +1233,8 @@ restart: > if (__predict_false(vp->v_type == VBAD || vp->v_type == VNON)) { > continue; > } > - vhold(vp); > + if (!vhold_recycle(vp)) > + continue; > count--; > mtx_unlock(&vnode_list_mtx); > vtryrecycle(vp); > @@ -3248,13 +3251,11 @@ vholdnz(struct vnode *vp) > * However, while this is more performant, it hinders debugging by eliminating > * the previously mentioned invariant. > */ > -bool > -vhold_smr(struct vnode *vp) > +static bool __always_inline > +_vhold_cond(struct vnode *vp) > { > int count; > > - VFS_SMR_ASSERT_ENTERED(); > - > count = atomic_load_int(&vp->v_holdcnt); > for (;;) { > if (count & VHOLD_NO_SMR) { > @@ -3270,6 +3271,28 @@ vhold_smr(struct vnode *vp) > return (true); > } > } > +} > + > +bool > +vhold_smr(struct vnode *vp) > +{ > + > + VFS_SMR_ASSERT_ENTERED(); > + return (_vhold_cond(vp)); > +} > + > +/* > + * Special case for vnode recycling. > + * > + * Vnodes are present on the global list until UMA takes them out. > + * Attempts to recycle only need the relevant lock and have no use for SMR. > + */ > +static bool > +vhold_recycle(struct vnode *vp) > +{ > + > + mtx_assert(&vnode_list_mtx, MA_OWNED); > + return (_vhold_cond(vp)); > } > > static void __noinline From owner-svn-src-all@freebsd.org Sat Oct 24 17:47:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6281C44FE4A; Sat, 24 Oct 2020 17:47:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJT8K1xYPz3cJZ; Sat, 24 Oct 2020 17:47:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 225F11C3BF; Sat, 24 Oct 2020 17:47:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OHliDv050091; Sat, 24 Oct 2020 17:47:44 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OHlhPB050085; Sat, 24 Oct 2020 17:47:43 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010241747.09OHlhPB050085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 17:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367015 - in stable/12: sys/netinet usr.bin/netstat X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in stable/12: sys/netinet usr.bin/netstat X-SVN-Commit-Revision: 367015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 17:47:45 -0000 Author: rscheff Date: Sat Oct 24 17:47:43 2020 New Revision: 367015 URL: https://svnweb.freebsd.org/changeset/base/367015 Log: MFC r366566;r366567: Extend netstat to display TCP stack and detailed congestion state Upstreaming the "-c" option used to show detailed per-connection congestion control state for TCP sessions. This is one summary patch, which adds the relevant variables into xtcpcb. As previous "spare" space is used, these changes are ABI compatible (an older version of netstat will simply not show the newly available data from newer kernels, and a newer version of netstat will only show zeroed data querying older kernels. Reviewed by: tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26518 Modified: stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/tcp_var.h stable/12/usr.bin/netstat/inet.c stable/12/usr.bin/netstat/main.c stable/12/usr.bin/netstat/netstat.1 stable/12/usr.bin/netstat/netstat.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/sys/netinet/tcp_subr.c Sat Oct 24 17:47:43 2020 (r367015) @@ -3248,6 +3248,12 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x xt->t_sndzerowin = tp->t_sndzerowin; xt->t_sndrexmitpack = tp->t_sndrexmitpack; xt->t_rcvoopack = tp->t_rcvoopack; + xt->t_rcv_wnd = tp->rcv_wnd; + xt->t_snd_wnd = tp->snd_wnd; + xt->t_snd_cwnd = tp->snd_cwnd; + xt->t_snd_ssthresh = tp->snd_ssthresh; + xt->t_maxseg = tp->t_maxseg; + xt->xt_ecn = (tp->t_flags & TF_ECN_PERMIT) ? 1 : 0; now = getsbinuptime(); #define COPYTIMER(ttt) do { \ Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/sys/netinet/tcp_var.h Sat Oct 24 17:47:43 2020 (r367015) @@ -710,7 +710,13 @@ struct xtcpcb { int32_t tt_2msl; /* (s) */ int32_t tt_delack; /* (s) */ int32_t t_logstate; /* (3) */ - int32_t spare32[32]; + uint32_t t_snd_cwnd; /* (s) */ + uint32_t t_snd_ssthresh; /* (s) */ + uint32_t t_maxseg; /* (s) */ + uint32_t t_rcv_wnd; /* (s) */ + uint32_t t_snd_wnd; /* (s) */ + uint32_t xt_ecn; /* (s) */ + int32_t spare32[26]; } __aligned(8); #ifdef _KERNEL Modified: stable/12/usr.bin/netstat/inet.c ============================================================================== --- stable/12/usr.bin/netstat/inet.c Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/usr.bin/netstat/inet.c Sat Oct 24 17:47:43 2020 (r367015) @@ -85,6 +85,8 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" #include "nl_defs.h" +#define max(a, b) (((a) > (b)) ? (a) : (b)) + #ifdef INET static void inetprint(const char *, struct in_addr *, int, const char *, int, const int); @@ -204,6 +206,7 @@ protopr(u_long off, const char *name, int af1, int pro struct xinpcb *inp; struct xinpgen *xig, *oxig; struct xsocket *so; + int fnamelen, cnamelen; istcp = 0; switch (proto) { @@ -236,6 +239,28 @@ protopr(u_long off, const char *name, int af1, int pro if (!pcblist_sysctl(proto, name, &buf)) return; + if (cflag || Cflag) { + fnamelen = strlen("Stack"); + cnamelen = strlen("CC"); + oxig = xig = (struct xinpgen *)buf; + for (xig = (struct xinpgen*)((char *)xig + xig->xig_len); + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { + if (istcp) { + tp = (struct xtcpcb *)xig; + inp = &tp->xt_inp; + } else { + continue; + } + if (so->xso_protocol != proto) + continue; + if (inp->inp_gencnt > oxig->xig_gen) + continue; + fnamelen = max(fnamelen, (int)strlen(tp->xt_stack)); + cnamelen = max(cnamelen, (int)strlen(tp->xt_cc)); + } + } + oxig = xig = (struct xinpgen *)buf; for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); xig->xig_len > sizeof(struct xinpgen); @@ -341,9 +366,19 @@ protopr(u_long off, const char *name, int af1, int pro xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } + if (cflag) { + xo_emit(" {T:/%-*.*s}", + fnamelen, fnamelen, "Stack"); + } if (Cflag) - xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX, - TCP_CA_NAME_MAX, "CC"); + xo_emit(" {T:/%-*.*s} {T:/%10.10s}" + " {T:/%10.10s} {T:/%5.5s}" + " {T:/%3.3s}", cnamelen, + cnamelen, "CC", + "cwin", + "ssthresh", + "MSS", + "ECN"); if (Pflag) xo_emit(" {T:/%s}", "Log ID"); xo_emit("\n"); @@ -518,9 +553,24 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_flowtype); } if (istcp) { + if (cflag) + xo_emit(" {:stack/%-*.*s}", + + fnamelen, fnamelen, tp->xt_stack); if (Cflag) - xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX, - TCP_CA_NAME_MAX, tp->xt_cc); + xo_emit(" {:cc/%-*.*s}" + " {:snd-cwnd/%10lu}" + " {:snd-ssthresh/%10lu}" + " {:t-maxseg/%5u} {:ecn/%3s}", + cnamelen, cnamelen, tp->xt_cc, + tp->t_snd_cwnd, tp->t_snd_ssthresh, + tp->t_maxseg, + (tp->t_state >= TCPS_ESTABLISHED ? + (tp->xt_ecn > 0 ? + (tp->xt_ecn == 1 ? + "ecn" : "ace") + : "off") + : "n/a")); if (Pflag) xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ? Modified: stable/12/usr.bin/netstat/main.c ============================================================================== --- stable/12/usr.bin/netstat/main.c Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/usr.bin/netstat/main.c Sat Oct 24 17:47:43 2020 (r367015) @@ -205,7 +205,8 @@ int Aflag; /* show addresses of protocol control bloc int aflag; /* show all sockets (including servers) */ static int Bflag; /* show information about bpf consumers */ int bflag; /* show i/f total bytes in/out */ -int Cflag; /* show congestion control */ +int cflag; /* show TCP congestion control stack */ +int Cflag; /* show congestion control algo and vars */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int hflag; /* show counters in human readable format */ @@ -249,7 +250,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbCdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCcdF:f:ghI:iLlM:mN:nPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -278,6 +279,9 @@ main(int argc, char *argv[]) case 'b': bflag = 1; break; + case 'c': + cflag = 1; + break; case 'C': Cflag = 1; break; @@ -862,7 +866,7 @@ static void usage(void) { (void)xo_error("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-46AaLnRSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-46AaCcLnRSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", Modified: stable/12/usr.bin/netstat/netstat.1 ============================================================================== --- stable/12/usr.bin/netstat/netstat.1 Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/usr.bin/netstat/netstat.1 Sat Oct 24 17:47:43 2020 (r367015) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 13, 2020 +.Dd September 25, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -172,8 +172,10 @@ associated with a socket; used for debugging. .It Fl a Show the state of all sockets; normally sockets used by server processes are not shown. +.It Fl c +Show the used TCP stack for each session. .It Fl C -Show the congestion control of TCP sockets. +Show the congestion control algorithm and diagnostic information of TCP sockets. .It Fl L Show the size of the various listen queues. The first count shows the number of unaccepted connections, Modified: stable/12/usr.bin/netstat/netstat.h ============================================================================== --- stable/12/usr.bin/netstat/netstat.h Sat Oct 24 17:11:45 2020 (r367014) +++ stable/12/usr.bin/netstat/netstat.h Sat Oct 24 17:47:43 2020 (r367015) @@ -41,7 +41,8 @@ extern int Aflag; /* show addresses of protocol control block */ extern int aflag; /* show all sockets (including servers) */ extern int bflag; /* show i/f total bytes in/out */ -extern int Cflag; /* show congestion control */ +extern int cflag; /* show congestion control stats */ +extern int Cflag; /* show congestion control algo and stack */ extern int dflag; /* show i/f dropped packets */ extern int gflag; /* show group (multicast) routing or stats */ extern int hflag; /* show counters in human readable format */ From owner-svn-src-all@freebsd.org Sat Oct 24 17:56:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D2464501B9; Sat, 24 Oct 2020 17:56:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.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 4CJTLX662mz3csd; Sat, 24 Oct 2020 17:56:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id WNmLksCpQRAWfWNmMkGXpq; Sat, 24 Oct 2020 11:56:34 -0600 X-Authority-Analysis: v=2.4 cv=P9aEOgMu c=1 sm=1 tr=0 ts=5f946ad3 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=afefHYAZSVUA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=6kwmjJUdz6EiHvdRlJ0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 18ADB3B6; Sat, 24 Oct 2020 10:56:32 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 09OHuVh9006254; Sat, 24 Oct 2020 10:56:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202010241756.09OHuVh9006254@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366997 - head/sys/kern In-reply-to: <20201024172452.GD2643@kib.kiev.ua> References: <202010241330.09ODUb6x089521@repo.freebsd.org> <20201024172452.GD2643@kib.kiev.ua> Comments: In-reply-to Konstantin Belousov message dated "Sat, 24 Oct 2020 20:24:52 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 24 Oct 2020 10:56:31 -0700 X-CMAE-Envelope: MS4xfEV2jF+1S0i6F4+hO3+9UJ/jaMI5UCZO9gBYlNpFSDBsrNVs9beuKxmTQ6F0j1/boMe811Cgu51/onFgQUDKgnjFW7L/iYmytuAggXfe7cMC6D7eZC79 OQODfk0kRC2WmpVYc/Tv6dvLYJHmWpIdcQkY953IkbFE5+rcZHrfHW5IQCLqeKLq3M1/IMUaYvOEDfZir+iJVRhtcgMXEsaN0YfYqfkvnPBlgf4W6brDSfD5 DRyXmfIDjncRbYUTfME6yxRBJoOd2fi8ehIDRG6nNdlzRWNCx4YCjWvbNGIclyGEXHnKj6PvPIGgW3Qtynqm7pPB1PaRWk8QPrIa+WWSo/E= X-Rspamd-Queue-Id: 4CJTLX662mz3csd X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-0.24 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.23)[-0.230]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.229.168:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.138:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.891]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.42)[-0.419]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 17:56:38 -0000 In message <20201024172452.GD2643@kib.kiev.ua>, Konstantin Belousov writes: > On Sat, Oct 24, 2020 at 01:30:37PM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Sat Oct 24 13:30:37 2020 > > New Revision: 366997 > > URL: https://svnweb.freebsd.org/changeset/base/366997 > > > > Log: > > vfs: fix a race where reclaim vholds freed vnodes > A description of the race in the commit message would be respectful to > other readers of the code, so that we do not need to reverse-eng the > change to understand what and why was fixed. +1 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Oct 24 20:09:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CD20453618; Sat, 24 Oct 2020 20:09:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJXHr387Nz435K; Sat, 24 Oct 2020 20:09:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F1C91E18B; Sat, 24 Oct 2020 20:09:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OK9SCk037933; Sat, 24 Oct 2020 20:09:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OK9RKo037929; Sat, 24 Oct 2020 20:09:27 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010242009.09OK9RKo037929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 24 Oct 2020 20:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367016 - in head/sys: dev/iommu kern X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu kern X-SVN-Commit-Revision: 367016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 20:09:28 -0000 Author: br Date: Sat Oct 24 20:09:27 2020 New Revision: 367016 URL: https://svnweb.freebsd.org/changeset/base/367016 Log: o Add iommu de-initialization method for MSI interface. o Add iommu_unmap_msi() to release the msi GAS entry. o Provide default implementations for iommu init/deinit methods. Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26906 Modified: head/sys/dev/iommu/iommu_gas.c head/sys/dev/iommu/iommu_msi.h head/sys/kern/msi_if.m head/sys/kern/subr_intr.c Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/dev/iommu/iommu_gas.c Sat Oct 24 20:09:27 2020 (r367016) @@ -727,6 +727,31 @@ iommu_map(struct iommu_domain *domain, return (error); } +void +iommu_unmap_msi(struct iommu_ctx *ctx) +{ + struct iommu_map_entry *entry; + struct iommu_domain *domain; + + domain = ctx->domain; + entry = domain->msi_entry; + if (entry == NULL) + return; + + domain->ops->unmap(domain, entry->start, entry->end - + entry->start, IOMMU_PGF_WAITOK); + + IOMMU_DOMAIN_LOCK(domain); + iommu_gas_free_space(domain, entry); + IOMMU_DOMAIN_UNLOCK(domain); + + iommu_gas_free_entry(domain, entry); + + domain->msi_entry = NULL; + domain->msi_base = 0; + domain->msi_phys = 0; +} + int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma) Modified: head/sys/dev/iommu/iommu_msi.h ============================================================================== --- head/sys/dev/iommu/iommu_msi.h Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/dev/iommu/iommu_msi.h Sat Oct 24 20:09:27 2020 (r367016) @@ -42,5 +42,6 @@ struct iommu_ctx; void iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr); int iommu_map_msi(struct iommu_ctx *ctx, iommu_gaddr_t size, int offset, u_int eflags, u_int flags, vm_page_t *ma); +void iommu_unmap_msi(struct iommu_ctx *ctx); #endif /* !_DEV_IOMMU_IOMMU_MSI_H_ */ Modified: head/sys/kern/msi_if.m ============================================================================== --- head/sys/kern/msi_if.m Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/kern/msi_if.m Sat Oct 24 20:09:27 2020 (r367016) @@ -38,6 +38,22 @@ HEADER { struct intr_irqsrc; }; +# +# Default implementations of some methods. +# +CODE { + static int + iommu_init(device_t dev, device_t child, struct iommu_domain **domain) + { + *domain = NULL; + return (0); + } + static void + iommu_deinit(device_t dev, device_t child) + { + } +}; + METHOD int alloc_msi { device_t dev; device_t child; @@ -79,4 +95,9 @@ METHOD int iommu_init { device_t dev; device_t child; struct iommu_domain **domain; -}; +} DEFAULT iommu_init; + +METHOD void iommu_deinit { + device_t dev; + device_t child; +} DEFAULT iommu_deinit; Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Sat Oct 24 17:47:43 2020 (r367015) +++ head/sys/kern/subr_intr.c Sat Oct 24 20:09:27 2020 (r367016) @@ -1297,9 +1297,7 @@ int intr_alloc_msi(device_t pci, device_t child, intptr_t xref, int count, int maxcount, int *irqs) { -#ifdef IOMMU struct iommu_domain *domain; -#endif struct intr_irqsrc **isrc; struct intr_pic *pic; device_t pdev; @@ -1314,7 +1312,6 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); -#ifdef IOMMU /* * If this is the first time we have used this context ask the * interrupt controller to map memory the msi source will need. @@ -1322,7 +1319,6 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain); if (err != 0) return (err); -#endif isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); @@ -1332,9 +1328,7 @@ intr_alloc_msi(device_t pci, device_t child, intptr_t } for (i = 0; i < count; i++) { -#ifdef IOMMU isrc[i]->isrc_iommu = domain; -#endif msi = (struct intr_map_data_msi *)intr_alloc_map_data( INTR_MAP_DATA_MSI, sizeof(*msi), M_WAITOK | M_ZERO); msi-> isrc = isrc[i]; @@ -1375,6 +1369,8 @@ intr_release_msi(device_t pci, device_t child, intptr_ isrc[i] = msi->isrc; } + MSI_IOMMU_DEINIT(pic->pic_dev, child); + err = MSI_RELEASE_MSI(pic->pic_dev, child, count, isrc); for (i = 0; i < count; i++) { @@ -1389,9 +1385,7 @@ intr_release_msi(device_t pci, device_t child, intptr_ int intr_alloc_msix(device_t pci, device_t child, intptr_t xref, int *irq) { -#ifdef IOMMU struct iommu_domain *domain; -#endif struct intr_irqsrc *isrc; struct intr_pic *pic; device_t pdev; @@ -1406,7 +1400,6 @@ intr_alloc_msix(device_t pci, device_t child, intptr_t ("%s: Found a non-MSI controller: %s", __func__, device_get_name(pic->pic_dev))); -#ifdef IOMMU /* * If this is the first time we have used this context ask the * interrupt controller to map memory the msi source will need. @@ -1414,15 +1407,12 @@ intr_alloc_msix(device_t pci, device_t child, intptr_t err = MSI_IOMMU_INIT(pic->pic_dev, child, &domain); if (err != 0) return (err); -#endif err = MSI_ALLOC_MSIX(pic->pic_dev, child, &pdev, &isrc); if (err != 0) return (err); -#ifdef IOMMU isrc->isrc_iommu = domain; -#endif msi = (struct intr_map_data_msi *)intr_alloc_map_data( INTR_MAP_DATA_MSI, sizeof(*msi), M_WAITOK | M_ZERO); msi->isrc = isrc; @@ -1456,6 +1446,8 @@ intr_release_msix(device_t pci, device_t child, intptr intr_unmap_irq(irq); return (EINVAL); } + + MSI_IOMMU_DEINIT(pic->pic_dev, child); err = MSI_RELEASE_MSIX(pic->pic_dev, child, isrc); intr_unmap_irq(irq); From owner-svn-src-all@freebsd.org Sat Oct 24 20:23:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93750453B49; Sat, 24 Oct 2020 20:23:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJXbt3PNPz43nl; Sat, 24 Oct 2020 20:23:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57F431DFF7; Sat, 24 Oct 2020 20:23:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OKNMh4050222; Sat, 24 Oct 2020 20:23:22 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OKNLfI050216; Sat, 24 Oct 2020 20:23:21 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242023.09OKNLfI050216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 20:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367017 - in stable/12/sys: net netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in stable/12/sys: net netinet netinet6 X-SVN-Commit-Revision: 367017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 20:23:22 -0000 Author: rscheff Date: Sat Oct 24 20:23:20 2020 New Revision: 367017 URL: https://svnweb.freebsd.org/changeset/base/367017 Log: MFC r366569: Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt) option IP(V6)_VLAN_PCP, which can be set to -1 (interface default), or explicitly to any priority between 0 and 7. Note that for untagged traffic, explicitly adding a priority will insert a special 801.1Q vlan header with vlan ID = 0 to carry the priority setting Reviewed by: gallatin, rrs MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26409 Modified: stable/12/sys/net/if_ethersubr.c stable/12/sys/netinet/in.h stable/12/sys/netinet/in_pcb.h stable/12/sys/netinet/ip_output.c stable/12/sys/netinet6/in6.h stable/12/sys/netinet6/ip6_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_ethersubr.c ============================================================================== --- stable/12/sys/net/if_ethersubr.c Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/net/if_ethersubr.c Sat Oct 24 20:23:20 2020 (r367017) @@ -1349,6 +1349,13 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, } /* + * If PCP is set in mbuf, use it + */ + if ((*mp)->m_flags & M_VLANTAG) { + pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); + } + + /* * If underlying interface can do VLAN tag insertion itself, * just pass the packet along. However, we need some way to * tell the interface where the packet came from so that it Modified: stable/12/sys/netinet/in.h ============================================================================== --- stable/12/sys/netinet/in.h Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/netinet/in.h Sat Oct 24 20:23:20 2020 (r367017) @@ -483,6 +483,10 @@ __END_DECLS /* The following option is private; do not use it from user applications. */ #define IP_MSFILTER 74 /* set/get filter list */ +/* The following option deals with the 802.1Q Ethernet Priority Code Point */ +#define IP_VLAN_PCP 75 /* int; set/get PCP used for packet, */ + /* -1 use interface default */ + /* Protocol Independent Multicast API [RFC3678] */ #define MCAST_JOIN_GROUP 80 /* join an any-source group */ #define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ Modified: stable/12/sys/netinet/in_pcb.h ============================================================================== --- stable/12/sys/netinet/in_pcb.h Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/netinet/in_pcb.h Sat Oct 24 20:23:20 2020 (r367017) @@ -762,6 +762,13 @@ int inp_so_options(const struct inpcb *inp); #define INP_SUPPORTS_MBUFQ 0x00004000 /* Supports the mbuf queue method of LRO */ #define INP_MBUF_QUEUE_READY 0x00008000 /* The transport is pacing, inputs can be queued */ #define INP_DONT_SACK_QUEUE 0x00010000 /* If a sack arrives do not wake me */ +#define INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */ +#define INP_2PCP_BIT0 0x00040000 /* Eth PCP Bit 0 */ +#define INP_2PCP_BIT1 0x00080000 /* Eth PCP Bit 1 */ +#define INP_2PCP_BIT2 0x00100000 /* Eth PCP Bit 2 */ +#define INP_2PCP_BASE INP_2PCP_BIT0 +#define INP_2PCP_MASK (INP_2PCP_BIT0 | INP_2PCP_BIT1 | INP_2PCP_BIT2) +#define INP_2PCP_SHIFT 18 /* shift PCP field in/out of inp_flags2 */ /* * Flags passed to in_pcblookup*() functions. */ Modified: stable/12/sys/netinet/ip_output.c ============================================================================== --- stable/12/sys/netinet/ip_output.c Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/netinet/ip_output.c Sat Oct 24 20:23:20 2020 (r367017) @@ -61,7 +61,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -221,6 +223,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou int hlen = sizeof (struct ip); int mtu; int error = 0; + int vlan_pcp = -1; struct sockaddr_in *dst; const struct sockaddr_in *gw; struct in_ifaddr *ia; @@ -241,6 +244,9 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } + if ((inp->inp_flags2 & INP_2PCP_SET) != 0) + vlan_pcp = (inp->inp_flags2 & INP_2PCP_MASK) >> + INP_2PCP_SHIFT; } if (ro == NULL) { @@ -588,6 +594,9 @@ sendit: } } + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); + /* IN_LOOPBACK must not appear on the wire - RFC1122. */ if (IN_LOOPBACK(ntohl(ip->ip_dst.s_addr)) || IN_LOOPBACK(ntohl(ip->ip_src.s_addr))) { @@ -1087,6 +1096,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) #ifdef RSS case IP_RECVRSSBUCKETID: #endif + case IP_VLAN_PCP: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -1182,6 +1192,28 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) OPTSET2(INP_RECVRSSBUCKETID, optval); break; #endif + case IP_VLAN_PCP: + if ((optval >= -1) && (optval <= + (INP_2PCP_MASK >> INP_2PCP_SHIFT))) { + if (optval == -1) { + INP_WLOCK(inp); + inp->inp_flags2 &= + ~(INP_2PCP_SET | + INP_2PCP_MASK); + INP_WUNLOCK(inp); + } else { + INP_WLOCK(inp); + inp->inp_flags2 |= + INP_2PCP_SET; + inp->inp_flags2 &= + ~INP_2PCP_MASK; + inp->inp_flags2 |= + optval << INP_2PCP_SHIFT; + INP_WUNLOCK(inp); + } + } else + error = EINVAL; + break; } break; #undef OPTSET @@ -1302,6 +1334,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) case IP_RSSBUCKETID: case IP_RECVRSSBUCKETID: #endif + case IP_VLAN_PCP: switch (sopt->sopt_name) { case IP_TOS: @@ -1389,6 +1422,14 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) #endif case IP_BINDMULTI: optval = OPTBIT2(INP_BINDMULTI); + break; + case IP_VLAN_PCP: + if (OPTBIT2(INP_2PCP_SET)) { + optval = (inp->inp_flags2 & + INP_2PCP_MASK) >> INP_2PCP_SHIFT; + } else { + optval = -1; + } break; } error = sooptcopyout(sopt, &optval, sizeof optval); Modified: stable/12/sys/netinet6/in6.h ============================================================================== --- stable/12/sys/netinet6/in6.h Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/netinet6/in6.h Sat Oct 24 20:23:20 2020 (r367017) @@ -510,6 +510,10 @@ struct route_in6 { * set/get multicast source filter list. */ +/* The following option deals with the 802.1Q Ethernet Priority Code Point */ +#define IPV6_VLAN_PCP 75 /* int; set/get PCP used for packet, */ + /* -1 use interface default */ + /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ Modified: stable/12/sys/netinet6/ip6_output.c ============================================================================== --- stable/12/sys/netinet6/ip6_output.c Sat Oct 24 20:09:27 2020 (r367016) +++ stable/12/sys/netinet6/ip6_output.c Sat Oct 24 20:23:20 2020 (r367017) @@ -90,7 +90,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -344,6 +346,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct in6_addr odst; u_char *nexthdrp; int error = 0; + int vlan_pcp = -1; struct in6_ifaddr *ia = NULL; u_long mtu; int alwaysfrag, dontfrag; @@ -367,6 +370,9 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } + if ((inp->inp_flags2 & INP_2PCP_SET) != 0) + vlan_pcp = (inp->inp_flags2 & INP_2PCP_MASK) >> + INP_2PCP_SHIFT; } #if defined(IPSEC) || defined(IPSEC_SUPPORT) @@ -917,6 +923,8 @@ again: } passout: + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); /* * Send the packet to the outgoing interface. * If necessary, do IPv6 fragmentation before sending. @@ -1110,6 +1118,8 @@ sendorfree: m->m_pkthdr.snd_tag = NULL; } #endif + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); error = nd6_output_ifp(ifp, origifp, m, dst, (struct route *)ro); #ifdef RATELIMIT @@ -1600,6 +1610,7 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) #ifdef RSS case IPV6_RSS_LISTEN_BUCKET: #endif + case IPV6_VLAN_PCP: if (optname == IPV6_BINDANY && td != NULL) { error = priv_check(td, PRIV_NETINET_BINDANY); @@ -1791,6 +1802,29 @@ do { \ } break; #endif + case IPV6_VLAN_PCP: + if ((optval >= -1) && (optval <= + (INP_2PCP_MASK >> INP_2PCP_SHIFT))) { + if (optval == -1) { + INP_WLOCK(inp); + inp->inp_flags2 &= + ~(INP_2PCP_SET | + INP_2PCP_MASK); + INP_WUNLOCK(inp); + } else { + INP_WLOCK(inp); + inp->inp_flags2 |= + INP_2PCP_SET; + inp->inp_flags2 &= + ~INP_2PCP_MASK; + inp->inp_flags2 |= + optval << + INP_2PCP_SHIFT; + INP_WUNLOCK(inp); + } + } else + error = EINVAL; + break; } break; @@ -2015,6 +2049,7 @@ do { \ case IPV6_RECVRSSBUCKETID: #endif case IPV6_BINDMULTI: + case IPV6_VLAN_PCP: switch (optname) { case IPV6_RECVHOPOPTS: @@ -2113,7 +2148,17 @@ do { \ optval = OPTBIT2(INP_BINDMULTI); break; + case IPV6_VLAN_PCP: + if (OPTBIT2(INP_2PCP_SET)) { + optval = (inp->inp_flags2 & + INP_2PCP_MASK) >> + INP_2PCP_SHIFT; + } else { + optval = -1; + } + break; } + if (error) break; error = sooptcopyout(sopt, &optval, From owner-svn-src-all@freebsd.org Sat Oct 24 20:48:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D38E4541B9; Sat, 24 Oct 2020 20:48:36 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJY9039HPz453Y; Sat, 24 Oct 2020 20:48:36 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35AC41E90B; Sat, 24 Oct 2020 20:48:36 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OKmZJ3062412; Sat, 24 Oct 2020 20:48:36 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OKmZB9062409; Sat, 24 Oct 2020 20:48:35 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242048.09OKmZB9062409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 20:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367018 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 367018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 20:48:36 -0000 Author: rscheff Date: Sat Oct 24 20:48:35 2020 New Revision: 367018 URL: https://svnweb.freebsd.org/changeset/base/367018 Log: MFC r366570: Stop sending tiny new data segments during SACK recovery Consider the currently in-use TCP options when calculating the amount of new data to be injected during SACK loss recovery. That addresses the effect that very small (new) segments could be injected on partial ACKs while still performing a SACK loss recovery. Reported by: Liang Tian Reviewed by: tuexen, chengc_netapp.com MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26446 Modified: stable/12/sys/netinet/tcp_output.c stable/12/sys/netinet/tcp_sack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Sat Oct 24 20:23:20 2020 (r367017) +++ stable/12/sys/netinet/tcp_output.c Sat Oct 24 20:48:35 2020 (r367018) @@ -322,7 +322,7 @@ again: sendalot = 1; TCPSTAT_INC(tcps_sack_rexmits); TCPSTAT_ADD(tcps_sack_rexmit_bytes, - min(len, tp->t_maxseg)); + min(len, tcp_maxseg(tp))); } } after_sack_rexmit: @@ -841,7 +841,6 @@ send: if (flags & TH_SYN) to.to_flags |= TOF_SACKPERM; else if (TCPS_HAVEESTABLISHED(tp->t_state) && - (tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks > 0) { to.to_flags |= TOF_SACK; to.to_nsacks = tp->rcv_numsacks; Modified: stable/12/sys/netinet/tcp_sack.c ============================================================================== --- stable/12/sys/netinet/tcp_sack.c Sat Oct 24 20:23:20 2020 (r367017) +++ stable/12/sys/netinet/tcp_sack.c Sat Oct 24 20:48:35 2020 (r367018) @@ -787,15 +787,16 @@ void tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) { int num_segs = 1; + u_int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; /* Send one or 2 segments based on how much new data was acked. */ - if ((BYTES_THIS_ACK(tp, th) / tp->t_maxseg) >= 2) + if ((BYTES_THIS_ACK(tp, th) / maxseg) >= 2) num_segs = 2; tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->sack_newdata) + num_segs * tp->t_maxseg); + (tp->snd_nxt - tp->sack_newdata) + num_segs * maxseg); if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; tp->t_flags |= TF_ACKNOW; From owner-svn-src-all@freebsd.org Sat Oct 24 20:52:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58AAE45442A; Sat, 24 Oct 2020 20:52:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYF31jHtz457T; Sat, 24 Oct 2020 20:52:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DE4A1E8A6; Sat, 24 Oct 2020 20:52:07 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OKq6fV066825; Sat, 24 Oct 2020 20:52:07 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OKq5tY066818; Sat, 24 Oct 2020 20:52:05 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242052.09OKq5tY066818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 20:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367019 - in stable/12: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in stable/12: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Commit-Revision: 367019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 20:52:07 -0000 Author: rscheff Date: Sat Oct 24 20:52:05 2020 New Revision: 367019 URL: https://svnweb.freebsd.org/changeset/base/367019 Log: MFC r366573: Add DSCP support for network QoS to iscsi initiator. Allow the DSCP codepoint also to be configurable for the traffic in the direction from the initiator to the target, such that writes and any requests are also treated in the appropriate QoS class. Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26714 Modified: stable/12/sys/dev/iscsi/iscsi_ioctl.h stable/12/usr.bin/iscsictl/Makefile stable/12/usr.bin/iscsictl/iscsi.conf.5 stable/12/usr.bin/iscsictl/iscsictl.c stable/12/usr.bin/iscsictl/iscsictl.h stable/12/usr.bin/iscsictl/parse.y stable/12/usr.bin/iscsictl/token.l stable/12/usr.sbin/iscsid/iscsid.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- stable/12/sys/dev/iscsi/iscsi_ioctl.h Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/sys/dev/iscsi/iscsi_ioctl.h Sat Oct 24 20:52:05 2020 (r367019) @@ -70,7 +70,8 @@ struct iscsi_session_conf { int isc_iser; char isc_offload[ISCSI_OFFLOAD_LEN]; int isc_enable; - int isc_spare[4]; + int isc_dscp; + int isc_spare[3]; }; /* Modified: stable/12/usr.bin/iscsictl/Makefile ============================================================================== --- stable/12/usr.bin/iscsictl/Makefile Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/Makefile Sat Oct 24 20:52:05 2020 (r367019) @@ -7,7 +7,7 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/dev/iscsi MAN= iscsi.conf.5 iscsictl.8 -LIBADD= xo +LIBADD= util xo YFLAGS+= -v LFLAGS+= -i Modified: stable/12/usr.bin/iscsictl/iscsi.conf.5 ============================================================================== --- stable/12/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 20:52:05 2020 (r367019) @@ -145,6 +145,16 @@ for iSCSI over RDMA, or .Qq Ar iSCSI . Default is .Qq Ar iSCSI . +.It Cm dscp +The DiffServ Codepoint used for sending data. The DSCP can be +set to numeric, or hexadecimal values directly, as well as the +well-defined +.Qq Ar cs +and +.Qq Ar af +codepoints. +Default is no specified dscp codepoint, which means the default +of the outgoing interface is used. .El .Sh FILES .Bl -tag -width indent Modified: stable/12/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/12/usr.bin/iscsictl/iscsictl.c Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/iscsictl.c Sat Oct 24 20:52:05 2020 (r367019) @@ -87,6 +87,7 @@ target_new(struct conf *conf) if (targ == NULL) xo_err(1, "calloc"); targ->t_conf = conf; + targ->t_dscp = -1; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); return (targ); @@ -358,6 +359,7 @@ conf_from_target(struct iscsi_session_conf *conf, conf->isc_data_digest = ISCSI_DIGEST_CRC32C; else conf->isc_data_digest = ISCSI_DIGEST_NONE; + conf->isc_dscp = targ->t_dscp; } static int @@ -535,6 +537,9 @@ kernel_list(int iscsi_fd, const struct target *targ __ "Target portal:", conf->isc_target_addr); xo_emit("{L:/%-26s}{V:alias/%s}\n", "Target alias:", state->iss_target_alias); + if (conf->isc_dscp != -1) + xo_emit("{L:/%-26s}{V:dscp/0x%02x}\n", + "Target DSCP:", conf->isc_dscp); xo_close_container("target"); xo_open_container("auth"); Modified: stable/12/usr.bin/iscsictl/iscsictl.h ============================================================================== --- stable/12/usr.bin/iscsictl/iscsictl.h Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/iscsictl.h Sat Oct 24 20:52:05 2020 (r367019) @@ -78,6 +78,7 @@ struct target { int t_session_type; int t_enable; int t_protocol; + int t_dscp; char *t_offload; char *t_user; char *t_secret; Modified: stable/12/usr.bin/iscsictl/parse.y ============================================================================== --- stable/12/usr.bin/iscsictl/parse.y Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/parse.y Sat Oct 24 20:52:05 2020 (r367019) @@ -44,6 +44,8 @@ #include #include "iscsictl.h" +#include +#include extern FILE *yyin; extern char *yytext; @@ -61,7 +63,9 @@ extern void yyrestart(FILE *); %token AUTH_METHOD ENABLE HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS %token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET %token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL OFFLOAD -%token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET +%token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET DSCP +%token AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43 +%token BE EF CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 %union { @@ -127,6 +131,8 @@ target_entry: protocol | ignored + | + dscp ; target_name: TARGET_NAME EQUALS STR @@ -294,6 +300,48 @@ ignored: IGNORED EQUALS STR { xo_warnx("obsolete statement ignored at line %d", lineno); } + ; + +dscp: DSCP EQUALS STR + { + uint64_t tmp; + + if (strcmp($3, "0x") == 0) { + tmp = strtol($3 + 2, NULL, 16); + } else if (expand_number($3, &tmp) != 0) { + yyerror("invalid numeric value"); + free($3); + return(1); + } + if (tmp >= 0x40) { + yyerror("invalid dscp value"); + return(1); + } + + target->t_dscp = tmp; + } + | DSCP EQUALS BE { target->t_dscp = IPTOS_DSCP_CS0 >> 2 ; } + | DSCP EQUALS EF { target->t_dscp = IPTOS_DSCP_EF >> 2 ; } + | DSCP EQUALS CS0 { target->t_dscp = IPTOS_DSCP_CS0 >> 2 ; } + | DSCP EQUALS CS1 { target->t_dscp = IPTOS_DSCP_CS1 >> 2 ; } + | DSCP EQUALS CS2 { target->t_dscp = IPTOS_DSCP_CS2 >> 2 ; } + | DSCP EQUALS CS3 { target->t_dscp = IPTOS_DSCP_CS3 >> 2 ; } + | DSCP EQUALS CS4 { target->t_dscp = IPTOS_DSCP_CS4 >> 2 ; } + | DSCP EQUALS CS5 { target->t_dscp = IPTOS_DSCP_CS5 >> 2 ; } + | DSCP EQUALS CS6 { target->t_dscp = IPTOS_DSCP_CS6 >> 2 ; } + | DSCP EQUALS CS7 { target->t_dscp = IPTOS_DSCP_CS7 >> 2 ; } + | DSCP EQUALS AF11 { target->t_dscp = IPTOS_DSCP_AF11 >> 2 ; } + | DSCP EQUALS AF12 { target->t_dscp = IPTOS_DSCP_AF12 >> 2 ; } + | DSCP EQUALS AF13 { target->t_dscp = IPTOS_DSCP_AF13 >> 2 ; } + | DSCP EQUALS AF21 { target->t_dscp = IPTOS_DSCP_AF21 >> 2 ; } + | DSCP EQUALS AF22 { target->t_dscp = IPTOS_DSCP_AF22 >> 2 ; } + | DSCP EQUALS AF23 { target->t_dscp = IPTOS_DSCP_AF23 >> 2 ; } + | DSCP EQUALS AF31 { target->t_dscp = IPTOS_DSCP_AF31 >> 2 ; } + | DSCP EQUALS AF32 { target->t_dscp = IPTOS_DSCP_AF32 >> 2 ; } + | DSCP EQUALS AF33 { target->t_dscp = IPTOS_DSCP_AF33 >> 2 ; } + | DSCP EQUALS AF41 { target->t_dscp = IPTOS_DSCP_AF41 >> 2 ; } + | DSCP EQUALS AF42 { target->t_dscp = IPTOS_DSCP_AF42 >> 2 ; } + | DSCP EQUALS AF43 { target->t_dscp = IPTOS_DSCP_AF43 >> 2 ; } ; %% Modified: stable/12/usr.bin/iscsictl/token.l ============================================================================== --- stable/12/usr.bin/iscsictl/token.l Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.bin/iscsictl/token.l Sat Oct 24 20:52:05 2020 (r367019) @@ -68,6 +68,7 @@ enable { return ENABLE; } protocol { return PROTOCOL; } offload { return OFFLOAD; } port { return IGNORED; } +dscp { return DSCP; } MaxConnections { return IGNORED; } TargetAlias { return IGNORED; } TargetPortalGroupTag { return IGNORED; } @@ -86,6 +87,28 @@ tags { return IGNORED; } maxluns { return IGNORED; } sockbufsize { return IGNORED; } chapDigest { return IGNORED; } +af11 { return AF11; } +af12 { return AF12; } +af13 { return AF13; } +af21 { return AF21; } +af22 { return AF22; } +af23 { return AF23; } +af31 { return AF31; } +af32 { return AF32; } +af33 { return AF33; } +af41 { return AF41; } +af42 { return AF42; } +af43 { return AF43; } +be { return CS0; } +ef { return EF; } +cs0 { return CS0; } +cs1 { return CS1; } +cs2 { return CS2; } +cs3 { return CS3; } +cs4 { return CS4; } +cs5 { return CS5; } +cs6 { return CS6; } +cs7 { return CS7; } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } [a-zA-Z0-9\.\-_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } Modified: stable/12/usr.sbin/iscsid/iscsid.c ============================================================================== --- stable/12/usr.sbin/iscsid/iscsid.c Sat Oct 24 20:48:35 2020 (r367018) +++ stable/12/usr.sbin/iscsid/iscsid.c Sat Oct 24 20:52:05 2020 (r367019) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -275,6 +276,25 @@ connection_new(int iscsi_fd, const struct iscsi_daemon if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF, &sockbuf, sizeof(sockbuf)) == -1) log_warn("setsockopt(SO_SNDBUF) failed"); + if (conn->conn_conf.isc_dscp != -1) { + int tos = conn->conn_conf.isc_dscp << 2; + if (to_ai->ai_family == AF_INET) { + if (setsockopt(conn->conn_socket, + IPPROTO_IP, IP_TOS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IP_TOS) " + "failed for %s", + from_addr); + } else + if (to_ai->ai_family == AF_INET6) { + if (setsockopt(conn->conn_socket, + IPPROTO_IPV6, IPV6_TCLASS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IPV6_TCLASS) " + "failed for %s", + from_addr); + } + } if (from_ai != NULL) { error = bind(conn->conn_socket, from_ai->ai_addr, from_ai->ai_addrlen); From owner-svn-src-all@freebsd.org Sat Oct 24 20:57:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D252454639; Sat, 24 Oct 2020 20:57:14 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYLy3jdlz45Vk; Sat, 24 Oct 2020 20:57:14 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629CC1E997; Sat, 24 Oct 2020 20:57:14 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OKvE7T068856; Sat, 24 Oct 2020 20:57:14 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OKvD5D068852; Sat, 24 Oct 2020 20:57:13 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010242057.09OKvD5D068852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 24 Oct 2020 20:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367020 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 367020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 20:57:14 -0000 Author: mhorne Date: Sat Oct 24 20:57:13 2020 New Revision: 367020 URL: https://svnweb.freebsd.org/changeset/base/367020 Log: riscv: improve exception code naming The existing names were inherited from arm64, but we should prefer RISC-V terminology. Change the prefix to SCAUSE, and further change the names to better match the RISC-V spec and be more consistent with one another. Also, remove two codes that are not defined for S-mode (machine and hypervisor ecall). While here, apply style(9) to some condition checks. Reviewed by: kp Discussed with: jrtc27 Differential Revision: https://reviews.freebsd.org/D26918 Modified: head/sys/riscv/include/db_machdep.h head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/db_trace.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/db_machdep.h ============================================================================== --- head/sys/riscv/include/db_machdep.h Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/include/db_machdep.h Sat Oct 24 20:57:13 2020 (r367020) @@ -41,7 +41,7 @@ #include #include -#define T_BREAKPOINT (EXCP_BREAKPOINT) +#define T_BREAKPOINT (SCAUSE_BREAKPOINT) #define T_WATCHPOINT (0) typedef vm_offset_t db_addr_t; Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/include/riscvreg.h Sat Oct 24 20:57:13 2020 (r367020) @@ -37,23 +37,21 @@ #ifndef _MACHINE_RISCVREG_H_ #define _MACHINE_RISCVREG_H_ -#define EXCP_MASK (~EXCP_INTR) -#define EXCP_MISALIGNED_FETCH 0 -#define EXCP_FAULT_FETCH 1 -#define EXCP_ILLEGAL_INSTRUCTION 2 -#define EXCP_BREAKPOINT 3 -#define EXCP_MISALIGNED_LOAD 4 -#define EXCP_FAULT_LOAD 5 -#define EXCP_MISALIGNED_STORE 6 -#define EXCP_FAULT_STORE 7 -#define EXCP_USER_ECALL 8 -#define EXCP_SUPERVISOR_ECALL 9 -#define EXCP_HYPERVISOR_ECALL 10 -#define EXCP_MACHINE_ECALL 11 -#define EXCP_INST_PAGE_FAULT 12 -#define EXCP_LOAD_PAGE_FAULT 13 -#define EXCP_STORE_PAGE_FAULT 15 -#define EXCP_INTR (1ul << 63) +#define SCAUSE_INTR (1ul << 63) +#define SCAUSE_CODE (~SCAUSE_INTR) +#define SCAUSE_INST_MISALIGNED 0 +#define SCAUSE_INST_ACCESS_FAULT 1 +#define SCAUSE_ILLEGAL_INSTRUCTION 2 +#define SCAUSE_BREAKPOINT 3 +#define SCAUSE_LOAD_MISALIGNED 4 +#define SCAUSE_LOAD_ACCESS_FAULT 5 +#define SCAUSE_STORE_MISALIGNED 6 +#define SCAUSE_STORE_ACCESS_FAULT 7 +#define SCAUSE_ECALL_USER 8 +#define SCAUSE_ECALL_SUPERVISOR 9 +#define SCAUSE_INST_PAGE_FAULT 12 +#define SCAUSE_LOAD_PAGE_FAULT 13 +#define SCAUSE_STORE_PAGE_FAULT 15 #define SSTATUS_UIE (1 << 0) #define SSTATUS_SIE (1 << 1) Modified: head/sys/riscv/riscv/db_trace.c ============================================================================== --- head/sys/riscv/riscv/db_trace.c Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/riscv/db_trace.c Sat Oct 24 20:57:13 2020 (r367020) @@ -101,12 +101,12 @@ db_stack_trace_cmd(struct unwind_state *frame) tf = (struct trapframe *)(uintptr_t)frame->sp; - if (tf->tf_scause & EXCP_INTR) + if ((tf->tf_scause & SCAUSE_INTR) != 0) db_printf("--- interrupt %ld\n", - tf->tf_scause & EXCP_MASK); + tf->tf_scause & SCAUSE_CODE); else db_printf("--- exception %ld, tval = %#lx\n", - tf->tf_scause & EXCP_MASK, + tf->tf_scause & SCAUSE_CODE, tf->tf_stval); frame->sp = tf->tf_sp; frame->fp = tf->tf_s[0]; Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/riscv/intr_machdep.c Sat Oct 24 20:57:13 2020 (r367020) @@ -158,10 +158,10 @@ riscv_cpu_intr(struct trapframe *frame) struct intr_irqsrc *isrc; int active_irq; - KASSERT(frame->tf_scause & EXCP_INTR, + KASSERT((frame->tf_scause & SCAUSE_INTR) != 0, ("riscv_cpu_intr: wrong frame passed")); - active_irq = frame->tf_scause & EXCP_MASK; + active_irq = frame->tf_scause & SCAUSE_CODE; switch (active_irq) { case IRQ_SOFTWARE_USER: Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Sat Oct 24 20:52:05 2020 (r367019) +++ head/sys/riscv/riscv/trap.c Sat Oct 24 20:57:13 2020 (r367020) @@ -217,9 +217,9 @@ page_fault_handler(struct trapframe *frame, int usermo va = trunc_page(stval); - if (frame->tf_scause == EXCP_STORE_PAGE_FAULT) { + if (frame->tf_scause == SCAUSE_STORE_PAGE_FAULT) { ftype = VM_PROT_WRITE; - } else if (frame->tf_scause == EXCP_INST_PAGE_FAULT) { + } else if (frame->tf_scause == SCAUSE_INST_PAGE_FAULT) { ftype = VM_PROT_EXECUTE; } else { ftype = VM_PROT_READ; @@ -232,7 +232,7 @@ page_fault_handler(struct trapframe *frame, int usermo if (error != KERN_SUCCESS) { if (usermode) { call_trapsignal(td, sig, ucode, (void *)stval, - frame->tf_scause & EXCP_MASK); + frame->tf_scause & SCAUSE_CODE); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -262,8 +262,8 @@ do_trap_supervisor(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, ("Came from S mode with interrupts enabled")); - exception = frame->tf_scause & EXCP_MASK; - if (frame->tf_scause & EXCP_INTR) { + exception = frame->tf_scause & SCAUSE_CODE; + if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ riscv_cpu_intr(frame); return; @@ -278,18 +278,18 @@ do_trap_supervisor(struct trapframe *frame) curthread, frame->tf_sepc, frame); switch (exception) { - case EXCP_FAULT_LOAD: - case EXCP_FAULT_STORE: - case EXCP_FAULT_FETCH: + case SCAUSE_LOAD_ACCESS_FAULT: + case SCAUSE_STORE_ACCESS_FAULT: + case SCAUSE_INST_ACCESS_FAULT: dump_regs(frame); panic("Memory access exception at 0x%016lx\n", frame->tf_sepc); break; - case EXCP_STORE_PAGE_FAULT: - case EXCP_LOAD_PAGE_FAULT: - case EXCP_INST_PAGE_FAULT: + case SCAUSE_STORE_PAGE_FAULT: + case SCAUSE_LOAD_PAGE_FAULT: + case SCAUSE_INST_PAGE_FAULT: page_fault_handler(frame, 0); break; - case EXCP_BREAKPOINT: + case SCAUSE_BREAKPOINT: #ifdef KDTRACE_HOOKS if (dtrace_invop_jump_addr != NULL && dtrace_invop_jump_addr(frame) == 0) @@ -302,7 +302,7 @@ do_trap_supervisor(struct trapframe *frame) panic("No debugger in kernel.\n"); #endif break; - case EXCP_ILLEGAL_INSTRUCTION: + case SCAUSE_ILLEGAL_INSTRUCTION: dump_regs(frame); panic("Illegal instruction at 0x%016lx\n", frame->tf_sepc); break; @@ -330,8 +330,8 @@ do_trap_user(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, ("Came from U mode with interrupts enabled")); - exception = frame->tf_scause & EXCP_MASK; - if (frame->tf_scause & EXCP_INTR) { + exception = frame->tf_scause & SCAUSE_CODE; + if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ riscv_cpu_intr(frame); return; @@ -342,23 +342,23 @@ do_trap_user(struct trapframe *frame) curthread, frame->tf_sepc, frame); switch (exception) { - case EXCP_FAULT_LOAD: - case EXCP_FAULT_STORE: - case EXCP_FAULT_FETCH: + case SCAUSE_LOAD_ACCESS_FAULT: + case SCAUSE_STORE_ACCESS_FAULT: + case SCAUSE_INST_ACCESS_FAULT: call_trapsignal(td, SIGBUS, BUS_ADRERR, (void *)frame->tf_sepc, exception); userret(td, frame); break; - case EXCP_STORE_PAGE_FAULT: - case EXCP_LOAD_PAGE_FAULT: - case EXCP_INST_PAGE_FAULT: + case SCAUSE_STORE_PAGE_FAULT: + case SCAUSE_LOAD_PAGE_FAULT: + case SCAUSE_INST_PAGE_FAULT: page_fault_handler(frame, 1); break; - case EXCP_USER_ECALL: + case SCAUSE_ECALL_USER: frame->tf_sepc += 4; /* Next instruction */ ecall_handler(); break; - case EXCP_ILLEGAL_INSTRUCTION: + case SCAUSE_ILLEGAL_INSTRUCTION: #ifdef FPE if ((pcb->pcb_fpflags & PCB_FP_STARTED) == 0) { /* @@ -376,7 +376,7 @@ do_trap_user(struct trapframe *frame) exception); userret(td, frame); break; - case EXCP_BREAKPOINT: + case SCAUSE_BREAKPOINT: call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_sepc, exception); userret(td, frame); From owner-svn-src-all@freebsd.org Sat Oct 24 21:01:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D01E44544F3; Sat, 24 Oct 2020 21:01:19 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYRg5F8Cz45hd; Sat, 24 Oct 2020 21:01:19 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D7D1E759; Sat, 24 Oct 2020 21:01:19 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OL1JIo072301; Sat, 24 Oct 2020 21:01:19 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OL1Imw072298; Sat, 24 Oct 2020 21:01:18 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242101.09OL1Imw072298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 21:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367021 - in head/sbin: ping ping6 X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sbin: ping ping6 X-SVN-Commit-Revision: 367021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 21:01:19 -0000 Author: rscheff Date: Sat Oct 24 21:01:18 2020 New Revision: 367021 URL: https://svnweb.freebsd.org/changeset/base/367021 Log: Make use of IP_VLAN_PCP setsockopt in ping and ping6. In order to validate the proper marking and use of a different ethernet priority class, add the new session-specific PCP feature to the ping/ping6 utilities. Reviewed by: mav, bcr Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26627 Modified: head/sbin/ping/ping.8 head/sbin/ping/ping.c head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c Modified: head/sbin/ping/ping.8 ============================================================================== --- head/sbin/ping/ping.8 Sat Oct 24 20:57:13 2020 (r367020) +++ head/sbin/ping/ping.8 Sat Oct 24 21:01:18 2020 (r367021) @@ -28,7 +28,7 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 22, 2019 +.Dd October 2, 2020 .Dt PING 8 .Os .Sh NAME @@ -39,6 +39,7 @@ packets to network hosts .Sh SYNOPSIS .Nm .Op Fl AaDdfHnoQqRrv +.Op Fl C Ar pcp .Op Fl c Ar count .Op Fl G Ar sweepmaxsize .Op Fl g Ar sweepminsize @@ -57,6 +58,7 @@ packets to network hosts .Ar host .Nm .Op Fl AaDdfHLnoQqRrv +.Op Fl C Ar pcp .Op Fl c Ar count .Op Fl I Ar iface .Op Fl i Ar wait @@ -112,6 +114,9 @@ Include a bell character in the output when any packet is received. This option is ignored if other format options are present. +.It Fl C Ar pcp +Add an 802.1p Ethernet Priority Code Point when sending a packet. +0..7 uses that specific PCP, -1 uses the interface default PCP (or none). .It Fl c Ar count Stop after sending (and receiving) Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Sat Oct 24 20:57:13 2020 (r367020) +++ head/sbin/ping/ping.c Sat Oct 24 21:01:18 2020 (r367021) @@ -155,6 +155,7 @@ static int options; #define F_TIME 0x100000 #define F_SWEEP 0x200000 #define F_WAITTIME 0x400000 +#define F_IP_VLAN_PCP 0x800000 /* * MAX_DUP_CHK is the number of bits in received table, i.e. the maximum @@ -247,7 +248,7 @@ main(int argc, char *const *argv) u_long alarmtimeout; long ltmp; int almost_done, ch, df, hold, i, icmp_len, mib[4], preload; - int ssend_errno, srecv_errno, tos, ttl; + int ssend_errno, srecv_errno, tos, ttl, pcp; char ctrl[CMSG_SPACE(sizeof(struct timespec))]; char hnamebuf[MAXHOSTNAMELEN], snamebuf[MAXHOSTNAMELEN]; #ifdef IP_OPTIONS @@ -295,11 +296,11 @@ main(int argc, char *const *argv) err(EX_OSERR, "srecv socket"); } - alarmtimeout = df = preload = tos = 0; + alarmtimeout = df = preload = tos = pcp = 0; outpack = outpackhdr + sizeof(struct ip); while ((ch = getopt(argc, argv, - "Aac:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" + "AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC "P:" @@ -314,6 +315,13 @@ main(int argc, char *const *argv) case 'a': options |= F_AUDIBLE; break; + case 'C': + options |= F_IP_VLAN_PCP; + ltmp = strtol(optarg, &ep, 0); + if (*ep || ep == optarg || ltmp > 7 || ltmp < -1) + errx(EX_USAGE, "invalid PCP: `%s'", optarg); + pcp = ltmp; + break; case 'c': ltmp = strtol(optarg, &ep, 0); if (*ep || ep == optarg || ltmp <= 0) @@ -665,6 +673,10 @@ main(int argc, char *const *argv) if (options & F_SO_DONTROUTE) (void)setsockopt(ssend, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, sizeof(hold)); + if (options & F_IP_VLAN_PCP) { + (void)setsockopt(ssend, IPPROTO_IP, IP_VLAN_PCP, (char *)&pcp, + sizeof(pcp)); + } #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC if (options & F_POLICY) { @@ -1762,11 +1774,11 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: ping [-AaDdfHnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]", +"usage: ping [-AaDdfHnoQqRrv] [-C pcp] [-c count] [-G sweepmaxsize] [-g sweepminsize]", " [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]", " " SECOPT " [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]", " [-W waittime] [-z tos] host", -" ping [-AaDdfHLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]", +" ping [-AaDdfHLnoQqRrv] [-C pcp] [-c count] [-I iface] [-i wait] [-l preload]", " [-M mask | time] [-m ttl]" SECOPT " [-p pattern] [-S src_addr]", " [-s packetsize] [-T ttl] [-t timeout] [-W waittime]", " [-z tos] mcast-group"); Modified: head/sbin/ping6/ping6.8 ============================================================================== --- head/sbin/ping6/ping6.8 Sat Oct 24 20:57:13 2020 (r367020) +++ head/sbin/ping6/ping6.8 Sat Oct 24 21:01:18 2020 (r367021) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2020 +.Dd October 2, 2020 .Dt PING6 8 .Os .Sh NAME @@ -47,6 +47,9 @@ packets to network hosts .Op Fl b Ar bufsiz .Ek .Bk -words +.Op Fl C Ar pcp +.Ek +.Bk -words .Op Fl c Ar count .Ek .Bk -words @@ -144,6 +147,9 @@ This is an experimental option. .El .It Fl b Ar bufsiz Set socket buffer size. +.It Fl C Ar pcp +Add an 802.1p Ethernet Priority Code Point when sending a packet. +0..7 uses that specific PCP, -1 uses the interface default PCP (or none). .It Fl c Ar count Stop after sending (and receiving) Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat Oct 24 20:57:13 2020 (r367020) +++ head/sbin/ping6/ping6.c Sat Oct 24 21:01:18 2020 (r367021) @@ -230,6 +230,7 @@ static int ident; /* process id to identify our packe static u_int8_t nonce[8]; /* nonce field for node information */ static int hoplimit = -1; /* hoplimit */ static int tclass = -1; /* traffic class */ +static int pcp = -2; /* vlan priority code point */ static u_char *packet = NULL; static cap_channel_t *capdns; @@ -353,7 +354,7 @@ main(int argc, char *argv[]) #endif /*IPSEC_POLICY_IPSEC*/ #endif while ((ch = getopt(argc, argv, - "k:b:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:z:" ADDOPTS)) != -1) { + "k:b:C:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:z:" ADDOPTS)) != -1) { #undef ADDOPTS switch (ch) { case 'k': @@ -413,6 +414,13 @@ main(int argc, char *argv[]) "-b option ignored: SO_SNDBUF/SO_RCVBUF socket options not supported"); #endif break; + case 'C': /* vlan priority code point */ + pcp = strtol(optarg, &e, 10); + if (*optarg == '\0' || *e != '\0') + errx(1, "illegal vlan pcp %s", optarg); + if (7 < pcp || pcp < -1) + errx(1, "illegal vlan pcp -- %s", optarg); + break; case 'c': npackets = strtol(optarg, &e, 10); if (npackets <= 0 || *optarg == '\0' || *e != '\0') @@ -950,6 +958,12 @@ main(int argc, char *argv[]) if (setsockopt(ssend, IPPROTO_IPV6, IPV6_TCLASS, &tclass, sizeof(tclass)) == -1) err(1, "setsockopt(IPV6_TCLASS)"); + } + + if (pcp != -2) { + if (setsockopt(ssend, IPPROTO_IPV6, IPV6_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + err(1, "setsockopt(IPV6_VLAN_PCP)"); } if (argc > 1) { /* some intermediate addrs are specified */ From owner-svn-src-all@freebsd.org Sat Oct 24 21:07:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2109D454B11; Sat, 24 Oct 2020 21:07:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYZS03vmz45pm; Sat, 24 Oct 2020 21:07:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9AB41EB3D; Sat, 24 Oct 2020 21:07: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 09OL7BIx075001; Sat, 24 Oct 2020 21:07:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OL7BMf074998; Sat, 24 Oct 2020 21:07:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010242107.09OL7BMf074998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 24 Oct 2020 21:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367022 - in head/sys: geom kern sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: geom kern sys X-SVN-Commit-Revision: 367022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 21:07:12 -0000 Author: mav Date: Sat Oct 24 21:07:10 2020 New Revision: 367022 URL: https://svnweb.freebsd.org/changeset/base/367022 Log: Fix asymmetry in devstat(9) calls by GEOM. Before this GEOM passed bio pointer to transaction start, but not end. It was irrelevant until devstat(9) got DTrace hooks, that appeared to provide bio pointer on I/O completion, but not on submission. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_io.c head/sys/kern/subr_devstat.c head/sys/sys/devicestat.h Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Sat Oct 24 21:01:18 2020 (r367021) +++ head/sys/geom/geom_io.c Sat Oct 24 21:07:10 2020 (r367022) @@ -552,9 +552,9 @@ g_io_request(struct bio *bp, struct g_consumer *cp) else getbinuptime(&bp->bio_t0); if (g_collectstats & G_STATS_CONSUMERS) - devstat_start_transaction(cp->stat, &bp->bio_t0); + devstat_start_transaction_bio_t0(cp->stat, bp); if (g_collectstats & G_STATS_PROVIDERS) - devstat_start_transaction(pp->stat, &bp->bio_t0); + devstat_start_transaction_bio_t0(pp->stat, bp); #ifdef INVARIANTS atomic_add_int(&cp->nstart, 1); #endif Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Sat Oct 24 21:01:18 2020 (r367021) +++ head/sys/kern/subr_devstat.c Sat Oct 24 21:07:10 2020 (r367022) @@ -256,6 +256,17 @@ devstat_start_transaction_bio(struct devstat *ds, stru return; binuptime(&bp->bio_t0); + devstat_start_transaction_bio_t0(ds, bp); +} + +void +devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp) +{ + + /* sanity check */ + if (ds == NULL) + return; + devstat_start_transaction(ds, &bp->bio_t0); DTRACE_DEVSTAT_BIO_START(); } Modified: head/sys/sys/devicestat.h ============================================================================== --- head/sys/sys/devicestat.h Sat Oct 24 21:01:18 2020 (r367021) +++ head/sys/sys/devicestat.h Sat Oct 24 21:07:10 2020 (r367022) @@ -196,6 +196,7 @@ struct devstat *devstat_new_entry(const void *dev_name void devstat_remove_entry(struct devstat *ds); void devstat_start_transaction(struct devstat *ds, const struct bintime *now); void devstat_start_transaction_bio(struct devstat *ds, struct bio *bp); +void devstat_start_transaction_bio_t0(struct devstat *ds, struct bio *bp); void devstat_end_transaction(struct devstat *ds, u_int32_t bytes, devstat_tag_type tag_type, devstat_trans_flags flags, From owner-svn-src-all@freebsd.org Sat Oct 24 21:07:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3652D454B14; Sat, 24 Oct 2020 21:07:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYZW2w2Yz46Jt; Sat, 24 Oct 2020 21:07:15 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 300691E8C7; Sat, 24 Oct 2020 21:07:15 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OL7Fbq075055; Sat, 24 Oct 2020 21:07:15 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OL7Dcr075046; Sat, 24 Oct 2020 21:07:13 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242107.09OL7Dcr075046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 21:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367023 - in head: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Commit-Revision: 367023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 21:07:16 -0000 Author: rscheff Date: Sat Oct 24 21:07:13 2020 New Revision: 367023 URL: https://svnweb.freebsd.org/changeset/base/367023 Log: Add network QoS support for PCP to iscsi initiator. Make the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the initiator side only. Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26739 Modified: head/sys/dev/iscsi/iscsi_ioctl.h head/usr.bin/iscsictl/iscsi.conf.5 head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/iscsictl.h head/usr.bin/iscsictl/parse.y head/usr.bin/iscsictl/token.l head/usr.sbin/iscsid/iscsid.c Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Sat Oct 24 21:07:10 2020 (r367022) +++ head/sys/dev/iscsi/iscsi_ioctl.h Sat Oct 24 21:07:13 2020 (r367023) @@ -71,7 +71,8 @@ struct iscsi_session_conf { char isc_offload[ISCSI_OFFLOAD_LEN]; int isc_enable; int isc_dscp; - int isc_spare[3]; + int isc_pcp; + int isc_spare[2]; }; /* Modified: head/usr.bin/iscsictl/iscsi.conf.5 ============================================================================== --- head/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsi.conf.5 Sat Oct 24 21:07:13 2020 (r367023) @@ -155,6 +155,13 @@ and codepoints. Default is no specified dscp codepoint, which means the default of the outgoing interface is used. +.It Cm pcp +The 802.1Q Priority CodePoint used for sending packets. +The PCP can be set to a value in the range between +.Qq Ar 0 +to +.Qq Ar 7 . +When omitted, the default for the outgoing interface is used. .El .Sh FILES .Bl -tag -width indent Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsictl.c Sat Oct 24 21:07:13 2020 (r367023) @@ -88,6 +88,7 @@ target_new(struct conf *conf) xo_err(1, "calloc"); targ->t_conf = conf; targ->t_dscp = -1; + targ->t_pcp = -1; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); return (targ); @@ -360,6 +361,7 @@ conf_from_target(struct iscsi_session_conf *conf, else conf->isc_data_digest = ISCSI_DIGEST_NONE; conf->isc_dscp = targ->t_dscp; + conf->isc_pcp = targ->t_pcp; } static int @@ -540,6 +542,9 @@ kernel_list(int iscsi_fd, const struct target *targ __ if (conf->isc_dscp != -1) xo_emit("{L:/%-26s}{V:dscp/0x%02x}\n", "Target DSCP:", conf->isc_dscp); + if (conf->isc_pcp != -1) + xo_emit("{L:/%-26s}{V:pcp/0x%02x}\n", + "Target PCP:", conf->isc_pcp); xo_close_container("target"); xo_open_container("auth"); Modified: head/usr.bin/iscsictl/iscsictl.h ============================================================================== --- head/usr.bin/iscsictl/iscsictl.h Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/iscsictl.h Sat Oct 24 21:07:13 2020 (r367023) @@ -79,6 +79,7 @@ struct target { int t_enable; int t_protocol; int t_dscp; + int t_pcp; char *t_offload; char *t_user; char *t_secret; Modified: head/usr.bin/iscsictl/parse.y ============================================================================== --- head/usr.bin/iscsictl/parse.y Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/parse.y Sat Oct 24 21:07:13 2020 (r367023) @@ -133,6 +133,8 @@ target_entry: ignored | dscp + | + pcp ; target_name: TARGET_NAME EQUALS STR @@ -306,6 +308,8 @@ dscp: DSCP EQUALS STR { uint64_t tmp; + if (target->t_dscp != -1) + xo_errx(1, "duplicated dscp at line %d", lineno); if (strcmp($3, "0x") == 0) { tmp = strtol($3 + 2, NULL, 16); } else if (expand_number($3, &tmp) != 0) { @@ -342,6 +346,27 @@ dscp: DSCP EQUALS STR | DSCP EQUALS AF41 { target->t_dscp = IPTOS_DSCP_AF41 >> 2 ; } | DSCP EQUALS AF42 { target->t_dscp = IPTOS_DSCP_AF42 >> 2 ; } | DSCP EQUALS AF43 { target->t_dscp = IPTOS_DSCP_AF43 >> 2 ; } + ; + +pcp: PCP EQUALS STR + { + uint64_t tmp; + + if (target->t_pcp != -1) + xo_errx(1, "duplicated pcp at line %d", lineno); + + if (expand_number($3, &tmp) != 0) { + yyerror("invalid numeric value"); + free($3); + return(1); + } + if (!((tmp >=0) && (tmp <= 7))) { + yyerror("invalid pcp value"); + return(1); + } + + target->t_pcp = tmp; + } ; %% Modified: head/usr.bin/iscsictl/token.l ============================================================================== --- head/usr.bin/iscsictl/token.l Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.bin/iscsictl/token.l Sat Oct 24 21:07:13 2020 (r367023) @@ -69,6 +69,7 @@ protocol { return PROTOCOL; } offload { return OFFLOAD; } port { return IGNORED; } dscp { return DSCP; } +pcp { return PCP; } MaxConnections { return IGNORED; } TargetAlias { return IGNORED; } TargetPortalGroupTag { return IGNORED; } Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Sat Oct 24 21:07:10 2020 (r367022) +++ head/usr.sbin/iscsid/iscsid.c Sat Oct 24 21:07:13 2020 (r367023) @@ -297,6 +297,25 @@ connection_new(int iscsi_fd, const struct iscsi_daemon from_addr); } } + if (conn->conn_conf.isc_pcp != -1) { + int pcp = conn->conn_conf.isc_pcp; + if (to_ai->ai_family == AF_INET) { + if (setsockopt(conn->conn_socket, + IPPROTO_IP, IP_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IP_VLAN_PCP) " + "failed for %s", + from_addr); + } else + if (to_ai->ai_family == AF_INET6) { + if (setsockopt(conn->conn_socket, + IPPROTO_IPV6, IPV6_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IPV6_VLAN_PCP) " + "failed for %s", + from_addr); + } + } if (from_ai != NULL) { error = bind(conn->conn_socket, from_ai->ai_addr, from_ai->ai_addrlen); From owner-svn-src-all@freebsd.org Sat Oct 24 21:10:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8CDB454D05; Sat, 24 Oct 2020 21:10:54 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJYfk5vZmz46JS; Sat, 24 Oct 2020 21:10:54 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADEF01EC8E; Sat, 24 Oct 2020 21:10:54 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OLAsfi079079; Sat, 24 Oct 2020 21:10:54 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OLAreS079074; Sat, 24 Oct 2020 21:10:53 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010242110.09OLAreS079074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Sat, 24 Oct 2020 21:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367024 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 367024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 21:10:55 -0000 Author: rscheff Date: Sat Oct 24 21:10:53 2020 New Revision: 367024 URL: https://svnweb.freebsd.org/changeset/base/367024 Log: Add network QoS support for PCP to iscsi target. Mak the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the target side only. Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26740 Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/parse.y head/usr.sbin/ctld/token.l head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/ctl.conf.5 Sat Oct 24 21:10:53 2020 (r367024) @@ -258,6 +258,13 @@ well-defined and .Qq Ar AFxx codepoints. +.It Ic pcp Ar value +The 802.1Q Priority CodePoint used for sending packets. +The PCP can be set to a value in the range between +.Qq Ar 0 +to +.Qq Ar 7 . +When omitted, the default for the outgoing interface is used. .El .Ss target Context .Bl -tag -width indent Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/ctld.c Sat Oct 24 21:10:53 2020 (r367024) @@ -626,6 +626,7 @@ portal_group_new(struct conf *conf, const char *name) pg->pg_conf = conf; pg->pg_tag = 0; /* Assigned later in conf_apply(). */ pg->pg_dscp = -1; + pg->pg_pcp = -1; TAILQ_INSERT_TAIL(&conf->conf_portal_groups, pg, pg_next); return (pg); @@ -2210,6 +2211,32 @@ conf_apply(struct conf *oldconf, struct conf *newconf) IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof(tos)) == -1) log_warn("setsockopt(IPV6_TCLASS) " + "failed for %s", + newp->p_listen); + } + } + if (newpg->pg_pcp != -1) { + struct sockaddr sa; + int len = sizeof(sa); + getsockname(newp->p_socket, &sa, &len); + /* + * Only allow the 6-bit DSCP + * field to be modified + */ + int pcp = newpg->pg_pcp; + if (sa.sa_family == AF_INET) { + if (setsockopt(newp->p_socket, + IPPROTO_IP, IP_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IP_VLAN_PCP) " + "failed for %s", + newp->p_listen); + } else + if (sa.sa_family == AF_INET6) { + if (setsockopt(newp->p_socket, + IPPROTO_IPV6, IPV6_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IPV6_VLAN_PCP) " "failed for %s", newp->p_listen); } Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/ctld.h Sat Oct 24 21:10:53 2020 (r367024) @@ -128,6 +128,7 @@ struct portal_group { char *pg_offload; char *pg_redirection; int pg_dscp; + int pg_pcp; uint16_t pg_tag; }; Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/parse.y Sat Oct 24 21:10:53 2020 (r367024) @@ -65,8 +65,8 @@ extern void yyrestart(FILE *); %token DISCOVERY_AUTH_GROUP DISCOVERY_FILTER DSCP FOREIGN %token INITIATOR_NAME INITIATOR_PORTAL ISNS_SERVER ISNS_PERIOD ISNS_TIMEOUT %token LISTEN LISTEN_ISER LUN MAXPROC OFFLOAD OPENING_BRACKET OPTION -%token PATH PIDFILE PORT PORTAL_GROUP REDIRECT SEMICOLON SERIAL SIZE STR -%token TAG TARGET TIMEOUT +%token PATH PCP PIDFILE PORT PORTAL_GROUP REDIRECT SEMICOLON SERIAL +%token SIZE STR TAG TARGET TIMEOUT %token AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43 %token BE EF CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 @@ -359,6 +359,8 @@ portal_group_entry: portal_group_tag | portal_group_dscp + | + portal_group_pcp ; portal_group_discovery_auth_group: DISCOVERY_AUTH_GROUP STR @@ -512,6 +514,24 @@ portal_group_dscp | DSCP AF43 { portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2 ; } ; +portal_group_pcp: PCP STR + { + uint64_t tmp; + + if (expand_number($2, &tmp) != 0) { + yyerror("invalid numeric value"); + free($2); + return (1); + } + if (!((tmp >= 0) && (tmp <= 7))) { + yyerror("invalid pcp value"); + free($2); + return (1); + } + + portal_group->pg_pcp = tmp; + } + ; lun: LUN lun_name OPENING_BRACKET lun_entries CLOSING_BRACKET Modified: head/usr.sbin/ctld/token.l ============================================================================== --- head/usr.sbin/ctld/token.l Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/token.l Sat Oct 24 21:10:53 2020 (r367024) @@ -64,6 +64,7 @@ device-type { return DEVICE_TYPE; } discovery-auth-group { return DISCOVERY_AUTH_GROUP; } discovery-filter { return DISCOVERY_FILTER; } dscp { return DSCP; } +pcp { return PCP; } foreign { return FOREIGN; } initiator-name { return INITIATOR_NAME; } initiator-portal { return INITIATOR_PORTAL; } Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Sat Oct 24 21:07:13 2020 (r367023) +++ head/usr.sbin/ctld/uclparse.c Sat Oct 24 21:10:53 2020 (r367024) @@ -672,6 +672,19 @@ uclparse_portal_group(const char *name, const ucl_obje } } } + + if (!strcmp(key, "pcp")) { + if (obj->type != UCL_INT) { + log_warnx("\"pcp\" property of portal group " + "\"%s\" is not an integer", portal_group->pg_name); + return(1); + } + portal_group->pg_pcp = ucl_object_toint(obj); + if (!((portal_group->pg_pcp >= 0) && (portal_group->pg_pcp <= 7))) { + log_warnx("invalid \"pcp\" value %d, using default", portal_group->pg_pcp); + portal_group->pg_pcp = -1; + } + } } return (0); From owner-svn-src-all@freebsd.org Sat Oct 24 22:36:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CBCA4563D7; Sat, 24 Oct 2020 22:36:21 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJbYJ6crXz4CqB; Sat, 24 Oct 2020 22:36:20 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6AD81FAAB; Sat, 24 Oct 2020 22:36:20 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OMaK7d030013; Sat, 24 Oct 2020 22:36:20 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OMaKc9030012; Sat, 24 Oct 2020 22:36:20 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010242236.09OMaKc9030012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sat, 24 Oct 2020 22:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367025 - head/usr.bin/sockstat X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.bin/sockstat X-SVN-Commit-Revision: 367025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 22:36:21 -0000 Author: freqlabs Date: Sat Oct 24 22:36:20 2020 New Revision: 367025 URL: https://svnweb.freebsd.org/changeset/base/367025 Log: sockstat: Fix error message when jail_attach fails jail_errmsg is for libjail, jail_attach() is a system call. Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Sat Oct 24 21:10:53 2020 (r367024) +++ head/usr.bin/sockstat/sockstat.c Sat Oct 24 22:36:20 2020 (r367025) @@ -1372,7 +1372,7 @@ main(int argc, char *argv[]) errx(2, "%s", jail_errmsg); case JAIL_SYS_NEW: if (jail_attach(opt_j) < 0) - errx(3, "%s", jail_errmsg); + err(3, "jail_attach()"); /* Set back to -1 for normal output in vnet jail. */ opt_j = -1; break; From owner-svn-src-all@freebsd.org Sat Oct 24 22:48:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBB74456A80; Sat, 24 Oct 2020 22:48:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJbqJ5ZbMz4D5D; Sat, 24 Oct 2020 22:48:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F5EC20080; Sat, 24 Oct 2020 22:48:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OMmSq2036700; Sat, 24 Oct 2020 22:48:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OMmSfj036699; Sat, 24 Oct 2020 22:48:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010242248.09OMmSfj036699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 24 Oct 2020 22:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367026 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 367026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 22:48:28 -0000 Author: rmacklem Date: Sat Oct 24 22:48:28 2020 New Revision: 367026 URL: https://svnweb.freebsd.org/changeset/base/367026 Log: Add "-R" option to tell mountd to not register with rpcbind. rpcbind is now considered a security risk for some sites. Since an NFSv4 only NFS server does not need rpcbind, it makes sense to have an option that implements this. This patch adds a "-R" option that disables the Mount protocol (not used by NFSv4) and does not register with rpcbind. Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd. Those will be in a separate commit. Reviewed by: freqlabs, asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26746 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sat Oct 24 22:36:20 2020 (r367025) +++ head/usr.sbin/mountd/mountd.c Sat Oct 24 22:48:28 2020 (r367026) @@ -427,8 +427,10 @@ main(int argc, char **argv) uint64_t curtime, nexttime; struct timeval tv; struct timespec tp; - sigset_t sighup_mask; + sigset_t sig_mask, sighup_mask; + int enable_rpcbind; + enable_rpcbind = 1; /* Check that another mountd isn't already running. */ pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &otherpid); if (pfh == NULL) { @@ -443,7 +445,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnp:rS")) != -1) + while ((c = getopt(argc, argv, "2deh:lnp:RrS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -454,6 +456,10 @@ main(int argc, char **argv) case 'n': resvport_only = 0; break; + case 'R': + /* Do not support Mount protocol */ + enable_rpcbind = 0; + break; case 'r': dir_only = 0; break; @@ -498,6 +504,21 @@ main(int argc, char **argv) default: usage(); } + if (enable_rpcbind == 0) { + if (svcport_str != NULL) { + warnx("-p option not compatible with -R, ignored"); + free(svcport_str); + svcport_str = NULL; + } + if (nhosts > 0) { + warnx("-h option not compatible with -R, ignored"); + for (k = 0; k < nhosts; k++) + free(hosts[k]); + free(hosts); + hosts = NULL; + nhosts = 0; + } + } if (modfind("nfsd") < 0) { /* Not present in kernel, try loading it */ @@ -531,58 +552,61 @@ main(int argc, char **argv) pidfile_write(pfh); - rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); - rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); - rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); + if (enable_rpcbind != 0) { + rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); + rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); + rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec); - if (!resvport_only) { - if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL, - &resvport_only, sizeof(resvport_only)) != 0 && - errno != ENOENT) { - syslog(LOG_ERR, "sysctl: %m"); - exit(1); + if (!resvport_only) { + if (sysctlbyname("vfs.nfsd.nfs_privport", NULL, NULL, + &resvport_only, sizeof(resvport_only)) != 0 && + errno != ENOENT) { + syslog(LOG_ERR, "sysctl: %m"); + exit(1); + } } - } - /* - * If no hosts were specified, add a wildcard entry to bind to - * INADDR_ANY. Otherwise make sure 127.0.0.1 and ::1 are added to the - * list. - */ - if (nhosts == 0) { - hosts = malloc(sizeof(char *)); - if (hosts == NULL) - out_of_mem(); - hosts[0] = "*"; - nhosts = 1; - } else { - hosts_bak = hosts; - if (have_v6) { - hosts_bak = realloc(hosts, (nhosts + 2) * - sizeof(char *)); - if (hosts_bak == NULL) { - for (k = 0; k < nhosts; k++) - free(hosts[k]); - free(hosts); - out_of_mem(); - } else - hosts = hosts_bak; - nhosts += 2; - hosts[nhosts - 2] = "::1"; - } else { - hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *)); - if (hosts_bak == NULL) { - for (k = 0; k < nhosts; k++) - free(hosts[k]); - free(hosts); + /* + * If no hosts were specified, add a wildcard entry to bind to + * INADDR_ANY. Otherwise make sure 127.0.0.1 and ::1 are added + * to the list. + */ + if (nhosts == 0) { + hosts = malloc(sizeof(char *)); + if (hosts == NULL) out_of_mem(); + hosts[0] = "*"; + nhosts = 1; + } else { + hosts_bak = hosts; + if (have_v6) { + hosts_bak = realloc(hosts, (nhosts + 2) * + sizeof(char *)); + if (hosts_bak == NULL) { + for (k = 0; k < nhosts; k++) + free(hosts[k]); + free(hosts); + out_of_mem(); + } else + hosts = hosts_bak; + nhosts += 2; + hosts[nhosts - 2] = "::1"; } else { - nhosts += 1; - hosts = hosts_bak; + hosts_bak = realloc(hosts, (nhosts + 1) * + sizeof(char *)); + if (hosts_bak == NULL) { + for (k = 0; k < nhosts; k++) + free(hosts[k]); + free(hosts); + out_of_mem(); + } else { + nhosts += 1; + hosts = hosts_bak; + } } - } - hosts[nhosts - 1] = "127.0.0.1"; + hosts[nhosts - 1] = "127.0.0.1"; + } } attempt_cnt = 1; @@ -590,96 +614,109 @@ main(int argc, char **argv) sock_fd = NULL; port_list = NULL; port_len = 0; - nc_handle = setnetconfig(); - while ((nconf = getnetconfig(nc_handle))) { - if (nconf->nc_flag & NC_VISIBLE) { - if (have_v6 == 0 && strcmp(nconf->nc_protofmly, - "inet6") == 0) { - /* DO NOTHING */ - } else { - ret = create_service(nconf); - if (ret == 1) - /* Ignore this call */ - continue; - if (ret < 0) { - /* - * Failed to bind port, so close off - * all sockets created and try again - * if the port# was dynamically - * assigned via bind(2). - */ - clearout_service(); - if (mallocd_svcport != 0 && - attempt_cnt < GETPORT_MAXTRY) { - free(svcport_str); + if (enable_rpcbind != 0) { + nc_handle = setnetconfig(); + while ((nconf = getnetconfig(nc_handle))) { + if (nconf->nc_flag & NC_VISIBLE) { + if (have_v6 == 0 && strcmp(nconf->nc_protofmly, + "inet6") == 0) { + /* DO NOTHING */ + } else { + ret = create_service(nconf); + if (ret == 1) + /* Ignore this call */ + continue; + if (ret < 0) { + /* + * Failed to bind port, so close + * off all sockets created and + * try again if the port# was + * dynamically assigned via + * bind(2). + */ + clearout_service(); + if (mallocd_svcport != 0 && + attempt_cnt < + GETPORT_MAXTRY) { + free(svcport_str); + svcport_str = NULL; + mallocd_svcport = 0; + } else { + errno = EADDRINUSE; + syslog(LOG_ERR, + "bindresvport_sa:" + " %m"); + exit(1); + } + + /* + * Start over at the first + * service. + */ + free(sock_fd); + sock_fdcnt = 0; + sock_fd = NULL; + nc_handle = setnetconfig(); + attempt_cnt++; + } else if (mallocd_svcport != 0 && + attempt_cnt == GETPORT_MAXTRY) { + /* + * For the last attempt, allow + * different port #s for each + * nconf by saving the + * svcport_str setting it back + * to NULL. + */ + port_list = realloc(port_list, + (port_len + 1) * + sizeof(char *)); + if (port_list == NULL) + out_of_mem(); + port_list[port_len++] = + svcport_str; svcport_str = NULL; mallocd_svcport = 0; - } else { - errno = EADDRINUSE; - syslog(LOG_ERR, - "bindresvport_sa: %m"); - exit(1); } - - /* Start over at the first service. */ - free(sock_fd); - sock_fdcnt = 0; - sock_fd = NULL; - nc_handle = setnetconfig(); - attempt_cnt++; - } else if (mallocd_svcport != 0 && - attempt_cnt == GETPORT_MAXTRY) { - /* - * For the last attempt, allow - * different port #s for each nconf - * by saving the svcport_str and - * setting it back to NULL. - */ - port_list = realloc(port_list, - (port_len + 1) * sizeof(char *)); - if (port_list == NULL) - out_of_mem(); - port_list[port_len++] = svcport_str; - svcport_str = NULL; - mallocd_svcport = 0; } } } - } - /* - * Successfully bound the ports, so call complete_service() to - * do the rest of the setup on the service(s). - */ - sock_fdpos = 0; - port_pos = 0; - nc_handle = setnetconfig(); - while ((nconf = getnetconfig(nc_handle))) { - if (nconf->nc_flag & NC_VISIBLE) { - if (have_v6 == 0 && strcmp(nconf->nc_protofmly, - "inet6") == 0) { - /* DO NOTHING */ - } else if (port_list != NULL) { - if (port_pos >= port_len) { - syslog(LOG_ERR, "too many port#s"); - exit(1); - } - complete_service(nconf, port_list[port_pos++]); - } else - complete_service(nconf, svcport_str); + /* + * Successfully bound the ports, so call complete_service() to + * do the rest of the setup on the service(s). + */ + sock_fdpos = 0; + port_pos = 0; + nc_handle = setnetconfig(); + while ((nconf = getnetconfig(nc_handle))) { + if (nconf->nc_flag & NC_VISIBLE) { + if (have_v6 == 0 && strcmp(nconf->nc_protofmly, + "inet6") == 0) { + /* DO NOTHING */ + } else if (port_list != NULL) { + if (port_pos >= port_len) { + syslog(LOG_ERR, "too many" + " port#s"); + exit(1); + } + complete_service(nconf, + port_list[port_pos++]); + } else + complete_service(nconf, svcport_str); + } } - } - endnetconfig(nc_handle); - free(sock_fd); - if (port_list != NULL) { - for (port_pos = 0; port_pos < port_len; port_pos++) - free(port_list[port_pos]); - free(port_list); - } + endnetconfig(nc_handle); + free(sock_fd); + if (port_list != NULL) { + for (port_pos = 0; port_pos < port_len; port_pos++) + free(port_list[port_pos]); + free(port_list); + } - if (xcreated == 0) { - syslog(LOG_ERR, "could not create any services"); - exit(1); + if (xcreated == 0) { + syslog(LOG_ERR, "could not create any services"); + exit(1); + } } /* Expand svc_run() here so that we can call get_exportlist(). */ @@ -690,7 +727,7 @@ main(int argc, char **argv) clock_gettime(CLOCK_MONOTONIC, &tp); curtime = tp.tv_sec; curtime = curtime * 1000000 + tp.tv_nsec / 1000; - sigprocmask(SIG_BLOCK, &sighup_mask, NULL); + sigprocmask(SIG_BLOCK, &sighup_mask, &sig_mask); if (got_sighup && curtime >= nexttime) { got_sighup = 0; sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); @@ -713,22 +750,28 @@ main(int argc, char **argv) tv.tv_usec = 0; else tv.tv_usec = RELOADDELAY; - readfds = svc_fdset; - switch (select(svc_maxfd + 1, &readfds, NULL, NULL, &tv)) { - case -1: - if (errno == EINTR) { + if (enable_rpcbind != 0) { + readfds = svc_fdset; + switch (select(svc_maxfd + 1, &readfds, NULL, NULL, + &tv)) { + case -1: + if (errno == EINTR) { + /* Allow a reload now. */ + nexttime = 0; + continue; + } + syslog(LOG_ERR, "mountd died: select: %m"); + exit(1); + case 0: /* Allow a reload now. */ nexttime = 0; continue; + default: + svc_getreqset(&readfds); } - syslog(LOG_ERR, "mountd died: select: %m"); - exit(1); - case 0: - /* Allow a reload now. */ - nexttime = 0; - continue; - default: - svc_getreqset(&readfds); + } else { + /* Simply wait for a signal. */ + sigsuspend(&sig_mask); } } } From owner-svn-src-all@freebsd.org Sat Oct 24 22:52:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C379456852; Sat, 24 Oct 2020 22:52:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJbvy2FG2z4Dps; Sat, 24 Oct 2020 22:52:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 305601FEB7; Sat, 24 Oct 2020 22:52:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09OMqUWd042328; Sat, 24 Oct 2020 22:52:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09OMqUw8042327; Sat, 24 Oct 2020 22:52:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010242252.09OMqUw8042327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 24 Oct 2020 22:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367027 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 367027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 22:52:30 -0000 Author: rmacklem Date: Sat Oct 24 22:52:29 2020 New Revision: 367027 URL: https://svnweb.freebsd.org/changeset/base/367027 Log: Update man page for -R option added by r376026. This is a content change. Reviewed by: bcr MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26746 Modified: head/usr.sbin/mountd/mountd.8 Modified: head/usr.sbin/mountd/mountd.8 ============================================================================== --- head/usr.sbin/mountd/mountd.8 Sat Oct 24 22:48:28 2020 (r367026) +++ head/usr.sbin/mountd/mountd.8 Sat Oct 24 22:52:29 2020 (r367027) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd August 1, 2019 +.Dd October 11, 2020 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnrS +.Op Fl 2delnRrS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -112,6 +112,17 @@ If .Nm cannot bind to this port, an appropriate error will be recorded in the system log, and the daemon will then exit. +.It Fl R +Do not support the Mount protocol and do not register with +.Xr rpcbind 8 . +This can be done for NFSv4 only servers, since the Mount protocol is not +used by NFSv4. +Useful for NFSv4 only servers that do not wish to run +.Xr rpcbind 8 . +.Xr showmount 8 +will not work, however since NFSv4 mounts are not shown by +.Xr showmount 8 , +this should not be an issue for an NFSv4 only server. .It Fl r Allow mount RPCs requests for regular files to be served. Although this seems to violate the mount protocol specification, From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1EC54573AD; Sat, 24 Oct 2020 23:21:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcXz4p1Rz4G3j; Sat, 24 Oct 2020 23:21:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 880CB1FFD7; Sat, 24 Oct 2020 23:21:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONL7Fh055702; Sat, 24 Oct 2020 23:21:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONL78e055700; Sat, 24 Oct 2020 23:21:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010242321.09ONL78e055700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 23:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367028 - in head: include sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: include sys/sys X-SVN-Commit-Revision: 367028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:07 -0000 Author: imp Date: Sat Oct 24 23:21:06 2020 New Revision: 367028 URL: https://svnweb.freebsd.org/changeset/base/367028 Log: Remove obsolete check for GCC < 3 and support for Intel Compiler We no longer support old versions of GCC. Remove this check by assuming it's false. That will make the entire expression false. Also remove support for Intel compiler, it's badly bitrotted. Technically, this removes support for C89 and K&R from compilers that don't define _Bool in those compilation environments as well. I'm unaware of any working compiler today for which that would be relevant (pcc has it and tcc sadly isn't working for other reasons), though if one pops up in ports, I'll work to resolve the issue. Modified: head/include/stdbool.h head/include/stdlib.h head/sys/sys/types.h Modified: head/include/stdbool.h ============================================================================== --- head/include/stdbool.h Sat Oct 24 22:52:29 2020 (r367027) +++ head/include/stdbool.h Sat Oct 24 23:21:06 2020 (r367028) @@ -37,9 +37,6 @@ #define true 1 #define bool _Bool -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedef int _Bool; -#endif #endif /* !__cplusplus */ #endif /* __bool_true_false_are_defined */ Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Oct 24 22:52:29 2020 (r367027) +++ head/include/stdlib.h Sat Oct 24 23:21:06 2020 (r367028) @@ -253,7 +253,7 @@ extern void (*malloc_message)(void *, const char *); * On platforms where alloca() is not in libc, programs which use it * will fail to link when compiled with non-GNU compilers. */ -#if __GNUC__ >= 2 || defined(__INTEL_COMPILER) +#if __GNUC__ >= 2 #undef alloca /* some GNU bits try to get cute and define this on their own */ #define alloca(sz) __builtin_alloca(sz) #endif Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Sat Oct 24 22:52:29 2020 (r367027) +++ head/sys/sys/types.h Sat Oct 24 23:21:06 2020 (r367028) @@ -300,9 +300,6 @@ typedef struct vm_page *vm_page_t; #define __bool_true_false_are_defined 1 #define false 0 #define true 1 -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedef int _Bool; -#endif typedef _Bool bool; #endif /* !__bool_true_false_are_defined && !__cplusplus */ #endif /* KERNEL || _STANDALONE */ From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DA4C45748A; Sat, 24 Oct 2020 23:21:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcYC5GtSz4Fy0; Sat, 24 Oct 2020 23:21:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7330C20491; Sat, 24 Oct 2020 23:21:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONLJGf055761; Sat, 24 Oct 2020 23:21:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONLJEf055760; Sat, 24 Oct 2020 23:21:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010242321.09ONLJEf055760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 23:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367029 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 367029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:20 -0000 Author: imp Date: Sat Oct 24 23:21:18 2020 New Revision: 367029 URL: https://svnweb.freebsd.org/changeset/base/367029 Log: Remove support for ancient compilers We don't support building the kernel from such old compilers, nor with the Intel Compiler specifically. Remove support for this old construct that was copied from stdbool.h and not relevant here. Modified: head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Sat Oct 24 23:21:06 2020 (r367028) +++ head/sys/dev/bxe/ecore_sp.h Sat Oct 24 23:21:18 2020 (r367029) @@ -75,9 +75,6 @@ typedef volatile int ecore_atomic_t; #ifndef __bool_true_false_are_defined #ifndef __cplusplus #define bool _Bool -#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) -typedef _Bool bool; -#endif #endif /* !__cplusplus */ #endif /* !__bool_true_false_are_defined$ */ From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCDCA457425; Sat, 24 Oct 2020 23:21:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcYH4YQ3z4G53; Sat, 24 Oct 2020 23:21:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6993C2050D; Sat, 24 Oct 2020 23:21:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONLNWW055817; Sat, 24 Oct 2020 23:21:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONLNYu055816; Sat, 24 Oct 2020 23:21:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010242321.09ONLNYu055816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 23:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367030 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 367030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:23 -0000 Author: imp Date: Sat Oct 24 23:21:22 2020 New Revision: 367030 URL: https://svnweb.freebsd.org/changeset/base/367030 Log: Remove intel compiler support from math.h The intel compiler support has badly decayed over the years. Stop pretending that we support it. Note, I've stopped short of requiring gcc builtin support with this commit since other compilers may be used to build non-base software and we need to support those so more investigation is needed before simplifying further. Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Oct 24 23:21:18 2020 (r367029) +++ head/lib/msun/src/math.h Sat Oct 24 23:21:22 2020 (r367030) @@ -34,11 +34,11 @@ extern const union __nan_un { float __uf; } __nan; -#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ__(3, 3) #define __MATH_BUILTIN_CONSTANTS #endif -#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) +#if __GNUC_PREREQ__(3, 0) #define __MATH_BUILTIN_RELOPS #endif From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 465974573D2; Sat, 24 Oct 2020 23:21:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcYP6lVvz4GF2; Sat, 24 Oct 2020 23:21:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADE32017A; Sat, 24 Oct 2020 23:21:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONLRYk055870; Sat, 24 Oct 2020 23:21:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONLRfJ055868; Sat, 24 Oct 2020 23:21:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010242321.09ONLRfJ055868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 23:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367031 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 367031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:31 -0000 Author: imp Date: Sat Oct 24 23:21:27 2020 New Revision: 367031 URL: https://svnweb.freebsd.org/changeset/base/367031 Log: Remove support for intel compiler from i386 in_cksum We no longer support building the kernel with the old intel compiler. Remove support for it from in_cksum. Should there be interest in reviving it, this is as likely to get in the way as to help anyway. Modified: head/sys/i386/i386/in_cksum.c head/sys/i386/include/in_cksum.h Modified: head/sys/i386/i386/in_cksum.c ============================================================================== --- head/sys/i386/i386/in_cksum.c Sat Oct 24 23:21:22 2020 (r367030) +++ head/sys/i386/i386/in_cksum.c Sat Oct 24 23:21:27 2020 (r367031) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); * icc needs to be special cased here, as the asm code below results * in broken code if compiled with icc. */ -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) /* non gcc parts stolen from sys/alpha/alpha/in_cksum.c */ #define REDUCE32 \ { \ @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); #endif #define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);} -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) static const u_int32_t in_masks[] = { /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Sat Oct 24 23:21:22 2020 (r367030) +++ head/sys/i386/include/in_cksum.h Sat Oct 24 23:21:27 2020 (r367031) @@ -55,7 +55,7 @@ * in the normal case (where there are no options and the header length is * therefore always exactly five 32-bit words. */ -#if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER) +#if defined(__GNUCLIKE_ASM) #if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(const struct ip *ip) @@ -137,7 +137,7 @@ in_pseudo(u_int sum, u_int b, u_int c) #endif #ifdef _KERNEL -#if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if !defined(__GNUCLIKE_ASM) #if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); #endif From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA202457438; Sat, 24 Oct 2020 23:21:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcYV32kqz4Fyv; Sat, 24 Oct 2020 23:21:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAC4720495; Sat, 24 Oct 2020 23:21:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONLVA5055923; Sat, 24 Oct 2020 23:21:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONLVg8055922; Sat, 24 Oct 2020 23:21:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010242321.09ONLVg8055922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 24 Oct 2020 23:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367032 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 367032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:34 -0000 Author: imp Date: Sat Oct 24 23:21:31 2020 New Revision: 367032 URL: https://svnweb.freebsd.org/changeset/base/367032 Log: cdefs.h: remove intel_compiler support The age of the intel compiler support is so old as to be uninteresting. No recent recports of intel compiler support have been received. Remove all the special case workarounds for the Intel compiler. Should there be interest in supporting the compiler, contact me and I'll work with people to make it happen, though I suspect these instances are more likely to be in the way than to be helpful. Reviewed by: cem, emaste, vangyzen, dim Differential Revision: https://reviews.freebsd.org/D26817 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Oct 24 23:21:27 2020 (r367031) +++ head/sys/sys/cdefs.h Sat Oct 24 23:21:31 2020 (r367032) @@ -75,9 +75,9 @@ * having a compiler-agnostic source tree. */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) -#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) +#if __GNUC__ >= 3 #define __GNUCLIKE_ASM 3 #define __GNUCLIKE_MATH_BUILTIN_CONSTANTS #else @@ -87,15 +87,9 @@ #define __GNUCLIKE___OFFSETOF 1 #define __GNUCLIKE___SECTION 1 -#ifndef __INTEL_COMPILER #define __GNUCLIKE_CTOR_SECTION_HANDLING 1 -#endif #define __GNUCLIKE_BUILTIN_CONSTANT_P 1 -#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \ - __INTEL_COMPILER < 800 -#undef __GNUCLIKE_BUILTIN_CONSTANT_P -#endif #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) #define __GNUCLIKE_BUILTIN_VARARGS 1 @@ -114,10 +108,8 @@ #define __compiler_membar() __asm __volatile(" " : : : "memory") #endif -#ifndef __INTEL_COMPILER #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 #define __GNUCLIKE_MATH_BUILTIN_RELOPS -#endif #define __GNUCLIKE_BUILTIN_MEMCPY 1 @@ -133,12 +125,12 @@ #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ /* * Macro to test if we're using a specific version of gcc or later. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define __GNUC_PREREQ__(ma, mi) \ (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) #else @@ -212,18 +204,18 @@ * a feature that we cannot live without. */ #define __weak_symbol __attribute__((__weak__)) -#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 5) #define __dead2 #define __pure2 #define __unused #endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused /* XXX Find out what to do for __packed, __aligned and __section */ #endif -#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER) +#if __GNUC_PREREQ__(2, 7) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused __attribute__((__unused__)) @@ -360,7 +352,7 @@ #define __pure #endif -#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ__(3, 1) #define __always_inline __attribute__((__always_inline__)) #else #define __always_inline @@ -393,11 +385,11 @@ #endif /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define __func__ NULL #endif -#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 +#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define __LONG_LONG_SUPPORTED #endif @@ -514,7 +506,7 @@ * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define __printflike(fmtarg, firstvararg) #define __scanflike(fmtarg, firstvararg) #define __format_arg(fmtarg) @@ -534,18 +526,16 @@ /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ - defined(__GNUC__) && !defined(__INTEL_COMPILER) + defined(__GNUC__) #define __printf0like(fmtarg, firstvararg) \ __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) #else #define __printf0like(fmtarg, firstvararg) #endif -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#ifndef __INTEL_COMPILER +#if defined(__GNUC__) #define __strong_reference(sym,aliassym) \ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) -#endif #ifdef __STDC__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ @@ -571,12 +561,12 @@ #define __sym_default(impl,sym,verid) \ __asm__(".symver impl, sym@@@verid") #endif /* __STDC__ */ -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ #define __GLOBL1(sym) __asm__(".globl " #sym) #define __GLOBL(sym) __GLOBL1(sym) -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else /* From owner-svn-src-all@freebsd.org Sat Oct 24 23:21:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 005C54573E3; Sat, 24 Oct 2020 23:21:57 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CJcYv4T2Gz4GBG; Sat, 24 Oct 2020 23:21:55 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18EB520511; Sat, 24 Oct 2020 23:21:52 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ONLpS8058300; Sat, 24 Oct 2020 23:21:51 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ONLpsZ058299; Sat, 24 Oct 2020 23:21:51 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010242321.09ONLpsZ058299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 24 Oct 2020 23:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367033 - head/sys/cddl/dev/dtrace/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/riscv X-SVN-Commit-Revision: 367033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2020 23:21:58 -0000 Author: mhorne Date: Sat Oct 24 23:21:51 2020 New Revision: 367033 URL: https://svnweb.freebsd.org/changeset/base/367033 Log: Fix build after r367020 DTrace also relies on these definitions. Reported by: jenkins Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Sat Oct 24 23:21:31 2020 (r367032) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Sat Oct 24 23:21:51 2020 (r367033) @@ -202,9 +202,9 @@ dtrace_trap(struct trapframe *frame, u_int type) * All the rest will be handled in the usual way. */ switch (type) { - case EXCP_FAULT_LOAD: - case EXCP_FAULT_STORE: - case EXCP_FAULT_FETCH: + case SCAUSE_LOAD_ACCESS_FAULT: + case SCAUSE_STORE_ACCESS_FAULT: + case SCAUSE_INST_ACCESS_FAULT: /* Flag a bad address. */ cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; cpu_core[curcpu].cpuc_dtrace_illval = 0;