From owner-svn-src-stable-12@freebsd.org Sun Mar 31 11:31:02 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81618155A37D; Sun, 31 Mar 2019 11:31:02 +0000 (UTC) (envelope-from avos@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) server-signature RSA-PSS (4096 bits) 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 26403755D9; Sun, 31 Mar 2019 11:31:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 023D926117; Sun, 31 Mar 2019 11:31:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2VBV19M095494; Sun, 31 Mar 2019 11:31:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2VBV1Ch095493; Sun, 31 Mar 2019 11:31:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903311131.x2VBV1Ch095493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 31 Mar 2019 11:31: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: r345752 - in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 11/sys/dev/usb/wlan 12/sys/dev/usb/wlan X-SVN-Commit-Revision: 345752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26403755D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2019 11:31:02 -0000 Author: avos Date: Sun Mar 31 11:31:01 2019 New Revision: 345752 URL: https://svnweb.freebsd.org/changeset/base/345752 Log: MFC r345493: run(4): merge some common TSF-related code into run_disable_tsf() No functional change intended. Modified: stable/12/sys/dev/usb/wlan/if_run.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/usb/wlan/if_run.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/12/sys/dev/usb/wlan/if_run.c Sun Mar 31 09:52:36 2019 (r345751) +++ stable/12/sys/dev/usb/wlan/if_run.c Sun Mar 31 11:31:01 2019 (r345752) @@ -464,6 +464,7 @@ static void run_usb_timeout_cb(void *); static void run_reset_livelock(struct run_softc *); static void run_enable_tsf_sync(struct run_softc *); static void run_enable_tsf(struct run_softc *); +static void run_disable_tsf(struct run_softc *); static void run_get_tsf(struct run_softc *, uint64_t *); static void run_enable_mrr(struct run_softc *); static void run_set_txpreamble(struct run_softc *); @@ -2090,7 +2091,6 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_ struct run_vap *rvp = RUN_VAP(vap); enum ieee80211_state ostate; uint32_t sta[3]; - uint32_t tmp; uint8_t ratectl; uint8_t restart_ratectl = 0; uint8_t bid = 1 << rvp->rvp_id; @@ -2123,12 +2123,8 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_ sc->runbmap &= ~bid; /* abort TSF synchronization if there is no vap running */ - if (--sc->running == 0) { - run_read(sc, RT2860_BCN_TIME_CFG, &tmp); - run_write(sc, RT2860_BCN_TIME_CFG, - tmp & ~(RT2860_BCN_TX_EN | RT2860_TSF_TIMER_EN | - RT2860_TBTT_TIMER_EN)); - } + if (--sc->running == 0) + run_disable_tsf(sc); break; case IEEE80211_S_RUN: @@ -4863,15 +4859,11 @@ static void run_scan_start(struct ieee80211com *ic) { struct run_softc *sc = ic->ic_softc; - uint32_t tmp; RUN_LOCK(sc); /* abort TSF synchronization */ - run_read(sc, RT2860_BCN_TIME_CFG, &tmp); - run_write(sc, RT2860_BCN_TIME_CFG, - tmp & ~(RT2860_BCN_TX_EN | RT2860_TSF_TIMER_EN | - RT2860_TBTT_TIMER_EN)); + run_disable_tsf(sc); run_set_bssid(sc, ieee80211broadcastaddr); RUN_UNLOCK(sc); @@ -5158,6 +5150,18 @@ run_enable_tsf(struct run_softc *sc) } static void +run_disable_tsf(struct run_softc *sc) +{ + uint32_t tmp; + + if (run_read(sc, RT2860_BCN_TIME_CFG, &tmp) == 0) { + tmp &= ~(RT2860_BCN_TX_EN | RT2860_TSF_TIMER_EN | + RT2860_TBTT_TIMER_EN); + run_write(sc, RT2860_BCN_TIME_CFG, tmp); + } +} + +static void run_get_tsf(struct run_softc *sc, uint64_t *buf) { run_read_region_1(sc, RT2860_TSF_TIMER_DW0, (uint8_t *)buf, @@ -6108,10 +6112,7 @@ run_init_locked(struct run_softc *sc) } /* abort TSF synchronization */ - run_read(sc, RT2860_BCN_TIME_CFG, &tmp); - tmp &= ~(RT2860_BCN_TX_EN | RT2860_TSF_TIMER_EN | - RT2860_TBTT_TIMER_EN); - run_write(sc, RT2860_BCN_TIME_CFG, tmp); + run_disable_tsf(sc); /* clear RX WCID search table */ run_set_region_4(sc, RT2860_WCID_ENTRY(0), 0, 512); From owner-svn-src-stable-12@freebsd.org Mon Apr 1 07:54:29 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 244381592DF5; Mon, 1 Apr 2019 07:54:29 +0000 (UTC) (envelope-from avos@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) server-signature RSA-PSS (4096 bits) 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 BF89E8A652; Mon, 1 Apr 2019 07:54:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 977DCB65A; Mon, 1 Apr 2019 07:54:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x317sShU041392; Mon, 1 Apr 2019 07:54:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x317sSYo041391; Mon, 1 Apr 2019 07:54:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201904010754.x317sSYo041391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 1 Apr 2019 07:54: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: r345761 - in stable: 10/sys/net80211 11/sys/net80211 12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable: 10/sys/net80211 11/sys/net80211 12/sys/net80211 X-SVN-Commit-Revision: 345761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF89E8A652 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2019 07:54:29 -0000 Author: avos Date: Mon Apr 1 07:54:27 2019 New Revision: 345761 URL: https://svnweb.freebsd.org/changeset/base/345761 Log: MFC r345252: net80211: correct check for SMPS node flags updates Update node flags when driver supports SMPS, not when it is disabled or in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0). Was checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear from 'ifconfig wlan0' output. Modified: stable/12/sys/net80211/ieee80211_ht.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/net80211/ieee80211_ht.c stable/11/sys/net80211/ieee80211_ht.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/net80211/ieee80211_ht.c ============================================================================== --- stable/12/sys/net80211/ieee80211_ht.c Mon Apr 1 07:46:41 2019 (r345760) +++ stable/12/sys/net80211/ieee80211_ht.c Mon Apr 1 07:54:27 2019 (r345761) @@ -1727,7 +1727,7 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni, const struct ieee80211_ie_htinfo *htinfo; ieee80211_parse_htcap(ni, htcapie); - if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) + if (vap->iv_htcaps & IEEE80211_HTC_SMPS) htcap_update_mimo_ps(ni); htcap_update_shortgi(ni); htcap_update_ldpc(ni); @@ -1880,7 +1880,7 @@ ieee80211_ht_updatehtcap(struct ieee80211_node *ni, co struct ieee80211vap *vap = ni->ni_vap; ieee80211_parse_htcap(ni, htcapie); - if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) + if (vap->iv_htcaps & IEEE80211_HTC_SMPS) htcap_update_mimo_ps(ni); htcap_update_shortgi(ni); htcap_update_ldpc(ni); From owner-svn-src-stable-12@freebsd.org Mon Apr 1 10:51:27 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D963155DD21; Mon, 1 Apr 2019 10:51:27 +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) server-signature RSA-PSS (4096 bits) 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 E329469D6A; Mon, 1 Apr 2019 10:51:26 +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 A6491D50C; Mon, 1 Apr 2019 10:51:26 +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 x31ApQkZ034013; Mon, 1 Apr 2019 10:51:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31ApPGg034006; Mon, 1 Apr 2019 10:51:25 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201904011051.x31ApPGg034006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 1 Apr 2019 10:51:25 +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: r345762 - in stable/12: sys/dev/netmap sys/net tests/sys/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: sys/dev/netmap sys/net tests/sys/netmap X-SVN-Commit-Revision: 345762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E329469D6A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2019 10:51:27 -0000 Author: vmaffione Date: Mon Apr 1 10:51:24 2019 New Revision: 345762 URL: https://svnweb.freebsd.org/changeset/base/345762 Log: MFC r345269, r345323 netmap: add support for multiple host rings Some applications forward from/to host rings most or all the traffic received or sent on a physical interface. In this cases it is desirable to have more than a pair of RX/TX host rings, and use multiple threads to speed up forwarding. This change adds support for multiple host rings. On registering a netmap port, the user can specify the number of desired receive and transmit host rings in the nr_host_tx_rings and nr_host_rx_rings fields of the nmreq_register structure. Modified: stable/12/sys/dev/netmap/netmap.c stable/12/sys/dev/netmap/netmap_legacy.c stable/12/sys/dev/netmap/netmap_mem2.c stable/12/sys/net/netmap.h stable/12/sys/net/netmap_legacy.h stable/12/sys/net/netmap_user.h stable/12/tests/sys/netmap/ctrl-api-test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap.c ============================================================================== --- stable/12/sys/dev/netmap/netmap.c Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/dev/netmap/netmap.c Mon Apr 1 10:51:24 2019 (r345762) @@ -1035,6 +1035,10 @@ netmap_do_unregif(struct netmap_priv_d *priv) } na->nm_krings_delete(na); + + /* restore the default number of host tx and rx rings */ + na->num_host_tx_rings = 1; + na->num_host_rx_rings = 1; } /* possibily decrement counter of tx_si/rx_si users */ @@ -1575,6 +1579,19 @@ netmap_get_na(struct nmreq_header *hdr, *na = ret; netmap_adapter_get(ret); + /* + * if the adapter supports the host rings and it is not alread open, + * try to set the number of host rings as requested by the user + */ + if (((*na)->na_flags & NAF_HOST_RINGS) && (*na)->active_fds == 0) { + if (req->nr_host_tx_rings) + (*na)->num_host_tx_rings = req->nr_host_tx_rings; + if (req->nr_host_rx_rings) + (*na)->num_host_rx_rings = req->nr_host_rx_rings; + } + nm_prdis("%s: host tx %d rx %u", (*na)->name, (*na)->num_host_tx_rings, + (*na)->num_host_rx_rings); + out: if (error) { if (ret) @@ -1856,6 +1873,25 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint3 nm_prdis("ONE_NIC: %s %d %d", nm_txrx2str(t), priv->np_qfirst[t], priv->np_qlast[t]); break; + case NR_REG_ONE_SW: + if (!(na->na_flags & NAF_HOST_RINGS)) { + nm_prerr("host rings not supported"); + return EINVAL; + } + if (nr_ringid >= na->num_host_tx_rings && + nr_ringid >= na->num_host_rx_rings) { + nm_prerr("invalid ring id %d", nr_ringid); + return EINVAL; + } + /* if not enough rings, use the first one */ + j = nr_ringid; + if (j >= nma_get_host_nrings(na, t)) + j = 0; + priv->np_qfirst[t] = nma_get_nrings(na, t) + j; + priv->np_qlast[t] = nma_get_nrings(na, t) + j + 1; + nm_prdis("ONE_SW: %s %d %d", nm_txrx2str(t), + priv->np_qfirst[t], priv->np_qlast[t]); + break; default: nm_prerr("invalid regif type %d", nr_mode); return EINVAL; @@ -2546,6 +2582,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c req->nr_tx_rings = na->num_tx_rings; req->nr_rx_slots = na->num_rx_desc; req->nr_tx_slots = na->num_tx_desc; + req->nr_host_tx_rings = na->num_host_tx_rings; + req->nr_host_rx_rings = na->num_host_rx_rings; error = netmap_mem_get_info(na->nm_mem, &req->nr_memsize, &memflags, &req->nr_mem_id); if (error) { @@ -2610,6 +2648,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c regreq.nr_rx_slots = req->nr_rx_slots; regreq.nr_tx_rings = req->nr_tx_rings; regreq.nr_rx_rings = req->nr_rx_rings; + regreq.nr_host_tx_rings = req->nr_host_tx_rings; + regreq.nr_host_rx_rings = req->nr_host_rx_rings; regreq.nr_mem_id = req->nr_mem_id; /* get a refcount */ @@ -2647,6 +2687,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c req->nr_tx_rings = na->num_tx_rings; req->nr_rx_slots = na->num_rx_desc; req->nr_tx_slots = na->num_tx_desc; + req->nr_host_tx_rings = na->num_host_tx_rings; + req->nr_host_rx_rings = na->num_host_rx_rings; } while (0); netmap_unget_na(na, ifp); NMG_UNLOCK(); Modified: stable/12/sys/dev/netmap/netmap_legacy.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_legacy.c Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/dev/netmap/netmap_legacy.c Mon Apr 1 10:51:24 2019 (r345762) @@ -68,6 +68,8 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n req->nr_rx_slots = nmr->nr_rx_slots; req->nr_tx_rings = nmr->nr_tx_rings; req->nr_rx_rings = nmr->nr_rx_rings; + req->nr_host_tx_rings = 0; + req->nr_host_rx_rings = 0; req->nr_mem_id = nmr->nr_arg2; req->nr_ringid = nmr->nr_ringid & NETMAP_RING_MASK; if ((nmr->nr_flags & NR_REG_MASK) == NR_REG_DEFAULT) { @@ -249,6 +251,8 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) req->nr_rx_slots = nmr->nr_rx_slots; req->nr_tx_rings = nmr->nr_tx_rings; req->nr_rx_rings = nmr->nr_rx_rings; + req->nr_host_tx_rings = 0; + req->nr_host_rx_rings = 0; req->nr_mem_id = nmr->nr_arg2; } break; @@ -367,8 +371,8 @@ netmap_ioctl_legacy(struct netmap_priv_d *priv, u_long struct nmreq *nmr = (struct nmreq *) data; struct nmreq_header *hdr; - if (nmr->nr_version < 11) { - nm_prerr("Minimum supported API is 11 (requested %u)", + if (nmr->nr_version < 14) { + nm_prerr("Minimum supported API is 14 (requested %u)", nmr->nr_version); return EINVAL; } Modified: stable/12/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_mem2.c Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/dev/netmap/netmap_mem2.c Mon Apr 1 10:51:24 2019 (r345762) @@ -2012,6 +2012,10 @@ netmap_mem2_if_new(struct netmap_adapter *na, struct n /* initialize base fields -- override const */ *(u_int *)(uintptr_t)&nifp->ni_tx_rings = na->num_tx_rings; *(u_int *)(uintptr_t)&nifp->ni_rx_rings = na->num_rx_rings; + *(u_int *)(uintptr_t)&nifp->ni_host_tx_rings = + (na->num_host_tx_rings ? na->num_host_tx_rings : 1); + *(u_int *)(uintptr_t)&nifp->ni_host_rx_rings = + (na->num_host_rx_rings ? na->num_host_rx_rings : 1); strlcpy(nifp->ni_name, na->name, sizeof(nifp->ni_name)); /* Modified: stable/12/sys/net/netmap.h ============================================================================== --- stable/12/sys/net/netmap.h Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/net/netmap.h Mon Apr 1 10:51:24 2019 (r345762) @@ -41,9 +41,9 @@ #ifndef _NET_NETMAP_H_ #define _NET_NETMAP_H_ -#define NETMAP_API 13 /* current API version */ +#define NETMAP_API 14 /* current API version */ -#define NETMAP_MIN_API 13 /* min and max versions accepted */ +#define NETMAP_MIN_API 14 /* min and max versions accepted */ #define NETMAP_MAX_API 15 /* * Some fields should be cache-aligned to reduce contention. @@ -64,34 +64,34 @@ KERNEL (opaque, obviously) ==================================================================== - | - USERSPACE | struct netmap_ring - +---->+---------------+ - / | head,cur,tail | - struct netmap_if (nifp, 1 per fd) / | buf_ofs | - +---------------+ / | other fields | - | ni_tx_rings | / +===============+ - | ni_rx_rings | / | buf_idx, len | slot[0] - | | / | flags, ptr | - | | / +---------------+ - +===============+ / | buf_idx, len | slot[1] - | txring_ofs[0] | (rel.to nifp)--' | flags, ptr | - | txring_ofs[1] | +---------------+ - (tx+1 entries) (num_slots entries) - | txring_ofs[t] | | buf_idx, len | slot[n-1] - +---------------+ | flags, ptr | - | rxring_ofs[0] | +---------------+ - | rxring_ofs[1] | - (rx+1 entries) - | rxring_ofs[r] | - +---------------+ + | + USERSPACE | struct netmap_ring + +---->+---------------+ + / | head,cur,tail | + struct netmap_if (nifp, 1 per fd) / | buf_ofs | + +----------------+ / | other fields | + | ni_tx_rings | / +===============+ + | ni_rx_rings | / | buf_idx, len | slot[0] + | | / | flags, ptr | + | | / +---------------+ + +================+ / | buf_idx, len | slot[1] + | txring_ofs[0] | (rel.to nifp)--' | flags, ptr | + | txring_ofs[1] | +---------------+ + (tx+htx entries) (num_slots entries) + | txring_ofs[t] | | buf_idx, len | slot[n-1] + +----------------+ | flags, ptr | + | rxring_ofs[0] | +---------------+ + | rxring_ofs[1] | + (rx+hrx entries) + | rxring_ofs[r] | + +----------------+ * For each "interface" (NIC, host stack, PIPE, VALE switch port) bound to * a file descriptor, the mmap()ed region contains a (logically readonly) * struct netmap_if pointing to struct netmap_ring's. * - * There is one netmap_ring per physical NIC ring, plus one tx/rx ring - * pair attached to the host stack (this pair is unused for non-NIC ports). + * There is one netmap_ring per physical NIC ring, plus at least one tx/rx ring + * pair attached to the host stack (these pairs are unused for non-NIC ports). * * All physical/host stack ports share the same memory region, * so that zero-copy can be implemented between them. @@ -117,11 +117,6 @@ * as the index. On close, ni_bufs_head must point to the list of * buffers to be released. * - * + NIOCREGIF can request space for extra rings (and buffers) - * allocated in the same memory space. The number of extra rings - * is in nr_arg1, and is advisory. This is a no-op on NICs where - * the size of the memory space is fixed. - * * + NIOCREGIF can attach to PIPE rings sharing the same memory * space with a parent device. The ifname indicates the parent device, * which must already exist. Flags in nr_flags indicate if we want to @@ -133,21 +128,22 @@ * * Extra flags in nr_flags support the above functions. * Application libraries may use the following naming scheme: - * netmap:foo all NIC ring pairs - * netmap:foo^ only host ring pair - * netmap:foo+ all NIC ring + host ring pairs - * netmap:foo-k the k-th NIC ring pair - * netmap:foo{k PIPE ring pair k, master side - * netmap:foo}k PIPE ring pair k, slave side + * netmap:foo all NIC rings pairs + * netmap:foo^ only host rings pairs + * netmap:foo^k the k-th host rings pair + * netmap:foo+ all NIC rings + host rings pairs + * netmap:foo-k the k-th NIC rings pair + * netmap:foo{k PIPE rings pair k, master side + * netmap:foo}k PIPE rings pair k, slave side * * Some notes about host rings: * - * + The RX host ring is used to store those packets that the host network + * + The RX host rings are used to store those packets that the host network * stack is trying to transmit through a NIC queue, but only if that queue * is currently in netmap mode. Netmap will not intercept host stack mbufs * designated to NIC queues that are not in netmap mode. As a consequence, * registering a netmap port with netmap:foo^ is not enough to intercept - * mbufs in the RX host ring; the netmap port should be registered with + * mbufs in the RX host rings; the netmap port should be registered with * netmap:foo*, or another registration should be done to open at least a * NIC TX queue in netmap mode. * @@ -157,7 +153,7 @@ * ifconfig on FreeBSD or ethtool -K on Linux) for an interface that is being * used in netmap mode. If the offloadings are not disabled, GSO and/or * unchecksummed packets may be dropped immediately or end up in the host RX - * ring, and will be dropped as soon as the packet reaches another netmap + * rings, and will be dropped as soon as the packet reaches another netmap * adapter. */ @@ -366,7 +362,7 @@ struct netmap_if { /* * The number of packet rings available in netmap mode. * Physical NICs can have different numbers of tx and rx rings. - * Physical NICs also have a 'host' ring pair. + * Physical NICs also have at least a 'host' rings pair. * Additionally, clients can request additional ring pairs to * be used for internal communication. */ @@ -374,14 +370,18 @@ struct netmap_if { const uint32_t ni_rx_rings; /* number of HW rx rings */ uint32_t ni_bufs_head; /* head index for extra bufs */ - uint32_t ni_spare1[5]; + const uint32_t ni_host_tx_rings; /* number of SW tx rings */ + const uint32_t ni_host_rx_rings; /* number of SW rx rings */ + uint32_t ni_spare1[3]; /* * The following array contains the offset of each netmap ring * from this structure, in the following order: - * NIC tx rings (ni_tx_rings); host tx ring (1); extra tx rings; - * NIC rx rings (ni_rx_rings); host tx ring (1); extra rx rings. + * - NIC tx rings (ni_tx_rings); + * - host tx rings (ni_host_tx_rings); + * - NIC rx rings (ni_rx_rings); + * - host rx ring (ni_host_rx_rings); * - * The area is filled up by the kernel on NIOCREGIF, + * The area is filled up by the kernel on NETMAP_REQ_REGISTER, * and then only read by userspace code. */ const ssize_t ring_ofs[0]; @@ -422,7 +422,8 @@ struct netmap_if { * The request body (struct nmreq_register) has several arguments to * specify how the port is to be registered. * - * nr_tx_slots, nr_tx_slots, nr_tx_rings, nr_rx_rings (in/out) + * nr_tx_slots, nr_tx_slots, nr_tx_rings, nr_rx_rings, + * nr_host_tx_rings, nr_host_rx_rings (in/out) * On input, non-zero values may be used to reconfigure the port * according to the requested values, but this is not guaranteed. * On output the actual values in use are reported. @@ -574,6 +575,8 @@ struct nmreq_register { uint32_t nr_rx_slots; /* slots in rx rings */ uint16_t nr_tx_rings; /* number of tx rings */ uint16_t nr_rx_rings; /* number of rx rings */ + uint16_t nr_host_tx_rings; /* number of host tx rings */ + uint16_t nr_host_rx_rings; /* number of host rx rings */ uint16_t nr_mem_id; /* id of the memory allocator */ uint16_t nr_ringid; /* ring(s) we care about */ @@ -592,9 +595,9 @@ struct nmreq_register { #define NR_TX_RINGS_ONLY 0x4000 /* Applications set this flag if they are able to deal with virtio-net headers, * that is send/receive frames that start with a virtio-net header. - * If not set, NIOCREGIF will fail with netmap ports that require applications - * to use those headers. If the flag is set, the application can use the - * NETMAP_VNET_HDR_GET command to figure out the header length. */ + * If not set, NETMAP_REQ_REGISTER will fail with netmap ports that require + * applications to use those headers. If the flag is set, the application can + * use the NETMAP_VNET_HDR_GET command to figure out the header length. */ #define NR_ACCEPT_VNET_HDR 0x8000 /* The following two have the same meaning of NETMAP_NO_TX_POLL and * NETMAP_DO_RX_POLL. */ @@ -611,6 +614,7 @@ enum { NR_REG_DEFAULT = 0, /* backward compat, should NR_REG_PIPE_MASTER = 5, /* deprecated, use "x{y" port name syntax */ NR_REG_PIPE_SLAVE = 6, /* deprecated, use "x}y" port name syntax */ NR_REG_NULL = 7, + NR_REG_ONE_SW = 8, }; /* A single ioctl number is shared by all the new API command. @@ -622,7 +626,7 @@ enum { NR_REG_DEFAULT = 0, /* backward compat, should /* The ioctl commands to sync TX/RX netmap rings. * NIOCTXSYNC, NIOCRXSYNC synchronize tx or rx queues, - * whose identity is set in NIOCREGIF through nr_ringid. + * whose identity is set in NETMAP_REQ_REGISTER through nr_ringid. * These are non blocking and take no argument. */ #define NIOCTXSYNC _IO('i', 148) /* sync tx queues */ #define NIOCRXSYNC _IO('i', 149) /* sync rx queues */ @@ -640,8 +644,10 @@ struct nmreq_port_info_get { uint32_t nr_rx_slots; /* slots in rx rings */ uint16_t nr_tx_rings; /* number of tx rings */ uint16_t nr_rx_rings; /* number of rx rings */ + uint16_t nr_host_tx_rings; /* number of host tx rings */ + uint16_t nr_host_rx_rings; /* number of host rx rings */ uint16_t nr_mem_id; /* memory allocator id (in/out) */ - uint16_t pad1; + uint16_t pad[3]; }; #define NM_BDG_NAME "vale" /* prefix for bridge port name */ Modified: stable/12/sys/net/netmap_legacy.h ============================================================================== --- stable/12/sys/net/netmap_legacy.h Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/net/netmap_legacy.h Mon Apr 1 10:51:24 2019 (r345762) @@ -99,14 +99,7 @@ * nr_flags is the recommended mode to indicate which rings should * be bound to a file descriptor. Values are NR_REG_* * - * nr_arg1 (in) The number of extra rings to be reserved. - * Especially when allocating a VALE port the system only - * allocates the amount of memory needed for the port. - * If more shared memory rings are desired (e.g. for pipes), - * the first invocation for the same basename/allocator - * should specify a suitable number. Memory cannot be - * extended after the first allocation without closing - * all ports on the same region. + * nr_arg1 (in) Reserved. * * nr_arg2 (in/out) The identity of the memory region used. * On input, 0 means the system decides autonomously, @@ -188,7 +181,7 @@ struct nmreq { #define NETMAP_BDG_POLLING_ON 10 /* delete polling kthread */ #define NETMAP_BDG_POLLING_OFF 11 /* delete polling kthread */ #define NETMAP_VNET_HDR_GET 12 /* get the port virtio-net-hdr length */ - uint16_t nr_arg1; /* reserve extra rings in NIOCREGIF */ + uint16_t nr_arg1; /* extra arguments */ #define NETMAP_BDG_HOST 1 /* nr_arg1 value for NETMAP_BDG_ATTACH */ uint16_t nr_arg2; /* id of the memory allocator */ Modified: stable/12/sys/net/netmap_user.h ============================================================================== --- stable/12/sys/net/netmap_user.h Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/sys/net/netmap_user.h Mon Apr 1 10:51:24 2019 (r345762) @@ -93,6 +93,8 @@ #include /* apple needs sockaddr */ #include /* IFNAMSIZ */ #include +#include /* memset */ +#include /* gettimeofday */ #ifndef likely #define likely(x) __builtin_expect(!!(x), 1) @@ -111,7 +113,8 @@ nifp, (nifp)->ring_ofs[index] ) #define NETMAP_RXRING(nifp, index) _NETMAP_OFFSET(struct netmap_ring *, \ - nifp, (nifp)->ring_ofs[index + (nifp)->ni_tx_rings + 1] ) + nifp, (nifp)->ring_ofs[index + (nifp)->ni_tx_rings + \ + (nifp)->ni_host_tx_rings] ) #define NETMAP_BUF(ring, index) \ ((char *)(ring) + (ring)->buf_ofs + ((index)*(ring)->nr_buf_size)) @@ -149,27 +152,6 @@ nm_ring_space(struct netmap_ring *ring) return ret; } - -#ifdef NETMAP_WITH_LIBS -/* - * Support for simple I/O libraries. - * Include other system headers required for compiling this. - */ - -#ifndef HAVE_NETMAP_WITH_LIBS -#define HAVE_NETMAP_WITH_LIBS - -#include -#include -#include -#include /* memset */ -#include -#include /* EINVAL */ -#include /* O_RDWR */ -#include /* close() */ -#include -#include - #ifndef ND /* debug macros */ /* debug support */ #define ND(_fmt, ...) do {} while(0) @@ -198,6 +180,53 @@ nm_ring_space(struct netmap_ring *ring) } while (0) #endif +/* + * this is a slightly optimized copy routine which rounds + * to multiple of 64 bytes and is often faster than dealing + * with other odd sizes. We assume there is enough room + * in the source and destination buffers. + */ +static inline void +nm_pkt_copy(const void *_src, void *_dst, int l) +{ + const uint64_t *src = (const uint64_t *)_src; + uint64_t *dst = (uint64_t *)_dst; + + if (unlikely(l >= 1024 || l % 64)) { + memcpy(dst, src, l); + return; + } + for (; likely(l > 0); l-=64) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } +} + +#ifdef NETMAP_WITH_LIBS +/* + * Support for simple I/O libraries. + * Include other system headers required for compiling this. + */ + +#ifndef HAVE_NETMAP_WITH_LIBS +#define HAVE_NETMAP_WITH_LIBS + +#include +#include +#include +#include +#include /* EINVAL */ +#include /* O_RDWR */ +#include /* close() */ +#include +#include + struct nm_pkthdr { /* first part is the same as pcap_pkthdr */ struct timeval ts; uint32_t caplen; @@ -268,33 +297,6 @@ struct nm_desc { #define NETMAP_FD(d) (P2NMD(d)->fd) -/* - * this is a slightly optimized copy routine which rounds - * to multiple of 64 bytes and is often faster than dealing - * with other odd sizes. We assume there is enough room - * in the source and destination buffers. - */ -static inline void -nm_pkt_copy(const void *_src, void *_dst, int l) -{ - const uint64_t *src = (const uint64_t *)_src; - uint64_t *dst = (uint64_t *)_dst; - - if (unlikely(l >= 1024 || l % 64)) { - memcpy(dst, src, l); - return; - } - for (; likely(l > 0); l-=64) { - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - } -} /* Modified: stable/12/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- stable/12/tests/sys/netmap/ctrl-api-test.c Mon Apr 1 07:54:27 2019 (r345761) +++ stable/12/tests/sys/netmap/ctrl-api-test.c Mon Apr 1 10:51:24 2019 (r345762) @@ -146,12 +146,12 @@ struct TestContext { uint32_t nr_hdr_len; /* for PORT_HDR_SET and PORT_HDR_GET */ uint32_t nr_first_cpu_id; /* vale polling */ uint32_t nr_num_polling_cpus; /* vale polling */ + uint32_t sync_kloop_mode; /* sync-kloop */ int fd; /* netmap file descriptor */ void *csb; /* CSB entries (atok and ktoa) */ struct nmreq_option *nr_opt; /* list of options */ sem_t *sem; /* for thread synchronization */ - struct nmport_d *nmport; /* nmport descriptor from libnetmap */ }; static struct TestContext ctx_; @@ -352,8 +352,11 @@ niocregif(struct TestContext *ctx, int netmap_api) /* The 11 ABI is the one right before the introduction of the new NIOCCTRL * ABI. The 11 ABI is useful to perform tests with legacy applications - * (which use the 11 ABI) and new kernel (which uses 12, or higher). */ -#define NETMAP_API_NIOCREGIF 11 + * (which use the 11 ABI) and new kernel (which uses 12, or higher). + * However, version 14 introduced a change in the layout of struct netmap_if, + * so that binary backward compatibility to 11 is not supported anymore. + */ +#define NETMAP_API_NIOCREGIF 14 static int legacy_regif_default(struct TestContext *ctx) @@ -1113,7 +1116,7 @@ bad_extmem_option(struct TestContext *ctx) pools_info_fill(&pools_info); /* Request a large ring size, to make sure that the kernel * rejects our request. */ - pools_info.nr_ring_pool_objsize = (1 << 16); + pools_info.nr_ring_pool_objsize = (1 << 20); return _extmem_option(ctx, &pools_info) < 0 ? 0 : -1; } @@ -1140,6 +1143,10 @@ duplicate_extmem_options(struct TestContext *ctx) save1 = e1; save2 = e2; + strncpy(ctx->ifname_ext, "vale0:0", sizeof(ctx->ifname_ext)); + ctx->nr_tx_slots = 16; + ctx->nr_rx_slots = 16; + ret = port_register_hwall(ctx); if (ret >= 0) { printf("duplicate option not detected\n"); @@ -1322,51 +1329,58 @@ sync_kloop(struct TestContext *ctx) static int sync_kloop_eventfds(struct TestContext *ctx) { - struct nmreq_opt_sync_kloop_eventfds *opt = NULL; - struct nmreq_option save; + struct nmreq_opt_sync_kloop_eventfds *evopt = NULL; + struct nmreq_opt_sync_kloop_mode modeopt; + struct nmreq_option evsave; int num_entries; size_t opt_size; int ret, i; + memset(&modeopt, 0, sizeof(modeopt)); + modeopt.nro_opt.nro_reqtype = NETMAP_REQ_OPT_SYNC_KLOOP_MODE; + modeopt.mode = ctx->sync_kloop_mode; + push_option(&modeopt.nro_opt, ctx); + num_entries = num_registered_rings(ctx); - opt_size = sizeof(*opt) + num_entries * sizeof(opt->eventfds[0]); - opt = calloc(1, opt_size); - opt->nro_opt.nro_next = 0; - opt->nro_opt.nro_reqtype = NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS; - opt->nro_opt.nro_status = 0; - opt->nro_opt.nro_size = opt_size; + opt_size = sizeof(*evopt) + num_entries * sizeof(evopt->eventfds[0]); + evopt = calloc(1, opt_size); + evopt->nro_opt.nro_next = 0; + evopt->nro_opt.nro_reqtype = NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS; + evopt->nro_opt.nro_status = 0; + evopt->nro_opt.nro_size = opt_size; for (i = 0; i < num_entries; i++) { int efd = eventfd(0, 0); - opt->eventfds[i].ioeventfd = efd; + evopt->eventfds[i].ioeventfd = efd; efd = eventfd(0, 0); - opt->eventfds[i].irqfd = efd; + evopt->eventfds[i].irqfd = efd; } - push_option(&opt->nro_opt, ctx); - save = opt->nro_opt; + push_option(&evopt->nro_opt, ctx); + evsave = evopt->nro_opt; ret = sync_kloop_start_stop(ctx); if (ret != 0) { - free(opt); + free(evopt); clear_options(ctx); return ret; } #ifdef __linux__ - save.nro_status = 0; + evsave.nro_status = 0; #else /* !__linux__ */ - save.nro_status = EOPNOTSUPP; + evsave.nro_status = EOPNOTSUPP; #endif /* !__linux__ */ - ret = checkoption(&opt->nro_opt, &save); - free(opt); + ret = checkoption(&evopt->nro_opt, &evsave); + free(evopt); clear_options(ctx); return ret; } static int -sync_kloop_eventfds_all(struct TestContext *ctx) +sync_kloop_eventfds_all_mode(struct TestContext *ctx, + uint32_t sync_kloop_mode) { int ret; @@ -1375,10 +1389,18 @@ sync_kloop_eventfds_all(struct TestContext *ctx) return ret; } + ctx->sync_kloop_mode = sync_kloop_mode; + return sync_kloop_eventfds(ctx); } static int +sync_kloop_eventfds_all(struct TestContext *ctx) +{ + return sync_kloop_eventfds_all_mode(ctx, 0); +} + +static int sync_kloop_eventfds_all_tx(struct TestContext *ctx) { struct nmreq_opt_csb opt; @@ -1399,6 +1421,27 @@ sync_kloop_eventfds_all_tx(struct TestContext *ctx) } static int +sync_kloop_eventfds_all_direct(struct TestContext *ctx) +{ + return sync_kloop_eventfds_all_mode(ctx, + NM_OPT_SYNC_KLOOP_DIRECT_TX | NM_OPT_SYNC_KLOOP_DIRECT_RX); +} + +static int +sync_kloop_eventfds_all_direct_tx(struct TestContext *ctx) +{ + return sync_kloop_eventfds_all_mode(ctx, + NM_OPT_SYNC_KLOOP_DIRECT_TX); +} + +static int +sync_kloop_eventfds_all_direct_rx(struct TestContext *ctx) +{ + return sync_kloop_eventfds_all_mode(ctx, + NM_OPT_SYNC_KLOOP_DIRECT_RX); +} + +static int sync_kloop_nocsb(struct TestContext *ctx) { int ret; @@ -1677,6 +1720,9 @@ static struct mytest tests[] = { decltest(sync_kloop), decltest(sync_kloop_eventfds_all), decltest(sync_kloop_eventfds_all_tx), + decltest(sync_kloop_eventfds_all_direct), + decltest(sync_kloop_eventfds_all_direct_tx), + decltest(sync_kloop_eventfds_all_direct_rx), decltest(sync_kloop_nocsb), decltest(sync_kloop_csb_enable), decltest(sync_kloop_conflict), From owner-svn-src-stable-12@freebsd.org Mon Apr 1 14:19:11 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 227B11564608; Mon, 1 Apr 2019 14:19:11 +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) server-signature RSA-PSS (4096 bits) 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 BBDBE70C75; Mon, 1 Apr 2019 14:19:10 +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 9783BF8DA; Mon, 1 Apr 2019 14:19:10 +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 x31EJAnA040792; Mon, 1 Apr 2019 14:19:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31EJAwd040790; Mon, 1 Apr 2019 14:19:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904011419.x31EJAwd040790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 1 Apr 2019 14:19:10 +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: r345764 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 345764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBDBE70C75 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2019 14:19:11 -0000 Author: markj Date: Mon Apr 1 14:19:09 2019 New Revision: 345764 URL: https://svnweb.freebsd.org/changeset/base/345764 Log: Fix if_(m)addr_rlock(). The use of a per-ifnet epoch context meant that these KPIs were not reentrant. This was fixed in head in r340413, but the change cannot be MFCed because it breaks the KBI by modifying struct thread. This is a direct commit to stable/12 which uses a per-CPU mutex to fix the problem without changing the KBI. PR: 236846 Submitted by: hselasky Reported and tested by: Viktor Dukhovni Reviewed by: hselasky (previous version) Differential Revision: https://reviews.freebsd.org/D19764 Modified: stable/12/sys/net/if.c stable/12/sys/net/if_var.h Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Mon Apr 1 12:14:45 2019 (r345763) +++ stable/12/sys/net/if.c Mon Apr 1 14:19:09 2019 (r345764) @@ -62,6 +62,8 @@ #include #include #include +#include +#include #include #include @@ -1754,6 +1756,30 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) ifd->ifi_noproto = ifp->if_get_counter(ifp, IFCOUNTER_NOPROTO); } +struct ifnet_read_lock { + struct mtx mtx; /* lock protecting tracker below */ + struct epoch_tracker et; +}; + +DPCPU_DEFINE_STATIC(struct ifnet_read_lock, ifnet_addr_read_lock); +DPCPU_DEFINE_STATIC(struct ifnet_read_lock, ifnet_maddr_read_lock); + +static void +ifnet_read_lock_init(void __unused *arg) +{ + struct ifnet_read_lock *pifrl; + int cpu; + + CPU_FOREACH(cpu) { + pifrl = DPCPU_ID_PTR(cpu, ifnet_addr_read_lock); + mtx_init(&pifrl->mtx, "ifnet_addr_read_lock", NULL, MTX_DEF); + + pifrl = DPCPU_ID_PTR(cpu, ifnet_maddr_read_lock); + mtx_init(&pifrl->mtx, "ifnet_maddr_read_lock", NULL, MTX_DEF); + } +} +SYSINIT(ifnet_read_lock_init, SI_SUB_CPU + 1, SI_ORDER_FIRST, &ifnet_read_lock_init, NULL); + /* * Wrapper functions for struct ifnet address list locking macros. These are * used by kernel modules to avoid encoding programming interface or binary @@ -1763,35 +1789,47 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd) void if_addr_rlock(struct ifnet *ifp) { - MPASS(*(uint64_t *)&ifp->if_addr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et); + struct ifnet_read_lock *pifrl; + + sched_pin(); + pifrl = DPCPU_PTR(ifnet_addr_read_lock); + mtx_lock(&pifrl->mtx); + epoch_enter_preempt(net_epoch_preempt, &pifrl->et); } void if_addr_runlock(struct ifnet *ifp) { - epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et); -#ifdef INVARIANTS - bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker)); -#endif + struct ifnet_read_lock *pifrl; + + pifrl = DPCPU_PTR(ifnet_addr_read_lock); + + epoch_exit_preempt(net_epoch_preempt, &pifrl->et); + mtx_unlock(&pifrl->mtx); + sched_unpin(); } void if_maddr_rlock(if_t ifp) { + struct ifnet_read_lock *pifrl; - MPASS(*(uint64_t *)&ifp->if_maddr_et == 0); - epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et); + sched_pin(); + pifrl = DPCPU_PTR(ifnet_maddr_read_lock); + mtx_lock(&pifrl->mtx); + epoch_enter_preempt(net_epoch_preempt, &pifrl->et); } void if_maddr_runlock(if_t ifp) { + struct ifnet_read_lock *pifrl; - epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et); -#ifdef INVARIANTS - bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker)); -#endif + pifrl = DPCPU_PTR(ifnet_maddr_read_lock); + + epoch_exit_preempt(net_epoch_preempt, &pifrl->et); + mtx_unlock(&pifrl->mtx); + sched_unpin(); } /* Modified: stable/12/sys/net/if_var.h ============================================================================== --- stable/12/sys/net/if_var.h Mon Apr 1 12:14:45 2019 (r345763) +++ stable/12/sys/net/if_var.h Mon Apr 1 14:19:09 2019 (r345764) @@ -381,8 +381,7 @@ struct ifnet { */ struct netdump_methods *if_netdump_methods; struct epoch_context if_epoch_ctx; - struct epoch_tracker if_addr_et; - struct epoch_tracker if_maddr_et; + void *if_unused[4]; /* * Spare fields to be added before branching a stable branch, so From owner-svn-src-stable-12@freebsd.org Tue Apr 2 08:35:25 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7D9155D1D0; Tue, 2 Apr 2019 08:35:25 +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) server-signature RSA-PSS (4096 bits) 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 AF6F3820E2; Tue, 2 Apr 2019 08:35:24 +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 8BCF4237D6; Tue, 2 Apr 2019 08:35:24 +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 x328ZOS0022657; Tue, 2 Apr 2019 08:35:24 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x328ZOwP022656; Tue, 2 Apr 2019 08:35:24 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904020835.x328ZOwP022656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 2 Apr 2019 08:35: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: r345792 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 345792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF6F3820E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2019 08:35:25 -0000 Author: mw Date: Tue Apr 2 08:35:24 2019 New Revision: 345792 URL: https://svnweb.freebsd.org/changeset/base/345792 Log: MFC r344676: Prevent detaching driver if the attach is not finished Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/kern/subr_bus.c Modified: stable/12/sys/kern/subr_bus.c ============================================================================== --- stable/12/sys/kern/subr_bus.c Tue Apr 2 04:12:06 2019 (r345791) +++ stable/12/sys/kern/subr_bus.c Tue Apr 2 08:35:24 2019 (r345792) @@ -2994,6 +2994,10 @@ device_detach(device_t dev) PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); + if (dev->state == DS_ATTACHING) { + device_printf(dev, "device in attaching state! Deferring detach.\n"); + return (EBUSY); + } if (dev->state != DS_ATTACHED) return (0); From owner-svn-src-stable-12@freebsd.org Tue Apr 2 09:31:39 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1438A155EDE3; Tue, 2 Apr 2019 09:31:39 +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) server-signature RSA-PSS (4096 bits) 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 B11EB83E34; Tue, 2 Apr 2019 09:31: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 8E101241A5; Tue, 2 Apr 2019 09:31: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 x329VcsV053468; Tue, 2 Apr 2019 09:31:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x329VcSY053467; Tue, 2 Apr 2019 09:31:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904020931.x329VcSY053467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Apr 2019 09:31: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: r345794 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 345794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B11EB83E34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2019 09:31:39 -0000 Author: ae Date: Tue Apr 2 09:31:38 2019 New Revision: 345794 URL: https://svnweb.freebsd.org/changeset/base/345794 Log: MFC r345292: Convert allocation of bpf_if in bpfattach2 from M_NOWAIT to M_WAITOK and remove possible panic condition. It is already allowed to sleep in bpfattach[2], since BPF_LOCK was converted to SX lock in r332388. Also move KASSERT() to the top of function and make full initialization before bpf_if will be linked to BPF's list of interfaces. Modified: stable/12/sys/net/bpf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/bpf.c ============================================================================== --- stable/12/sys/net/bpf.c Tue Apr 2 08:43:19 2019 (r345793) +++ stable/12/sys/net/bpf.c Tue Apr 2 09:31:38 2019 (r345794) @@ -2592,24 +2592,22 @@ bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, { struct bpf_if *bp; - bp = malloc(sizeof(*bp), M_BPF, M_NOWAIT | M_ZERO); - if (bp == NULL) - panic("bpfattach"); + KASSERT(*driverp == NULL, ("bpfattach2: driverp already initialized")); + bp = malloc(sizeof(*bp), M_BPF, M_WAITOK | M_ZERO); + + rw_init(&bp->bif_lock, "bpf interface lock"); LIST_INIT(&bp->bif_dlist); LIST_INIT(&bp->bif_wlist); bp->bif_ifp = ifp; bp->bif_dlt = dlt; - rw_init(&bp->bif_lock, "bpf interface lock"); - KASSERT(*driverp == NULL, ("bpfattach2: driverp already initialized")); + bp->bif_hdrlen = hdrlen; bp->bif_bpf = driverp; *driverp = bp; BPF_LOCK(); LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); BPF_UNLOCK(); - - bp->bif_hdrlen = hdrlen; if (bootverbose && IS_DEFAULT_VNET(curvnet)) if_printf(ifp, "bpf attached\n"); From owner-svn-src-stable-12@freebsd.org Tue Apr 2 13:57:54 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E30A91567F02; Tue, 2 Apr 2019 13:57:53 +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) server-signature RSA-PSS (4096 bits) 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 82E0C8DA25; Tue, 2 Apr 2019 13:57:53 +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 5DC5326F12; Tue, 2 Apr 2019 13:57:53 +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 x32Dvr2R090081; Tue, 2 Apr 2019 13:57:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32DvrfQ090079; Tue, 2 Apr 2019 13:57:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904021357.x32DvrfQ090079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Apr 2019 13:57:53 +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: r345801 - stable/12/usr.sbin/freebsd-update X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/freebsd-update X-SVN-Commit-Revision: 345801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82E0C8DA25 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2019 13:57:54 -0000 Author: emaste Date: Tue Apr 2 13:57:52 2019 New Revision: 345801 URL: https://svnweb.freebsd.org/changeset/base/345801 Log: MFC r344280: freebsd-update: Clarify help text Improve help text to include example release numbers for reference and clarify the -F option. PR: 231185, 214619 Submitted by: Gerald Aryeetey Reviewed by: delphij, rgrimes Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 stable/12/usr.sbin/freebsd-update/freebsd-update.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- stable/12/usr.sbin/freebsd-update/freebsd-update.8 Tue Apr 2 13:49:32 2019 (r345800) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.8 Tue Apr 2 13:57:52 2019 (r345801) @@ -89,13 +89,13 @@ Read configuration options from .It Fl F Force .Nm Cm fetch -to proceed where it normally would not, such as an unfinished upgrade +to proceed in the case of an unfinished upgrade. .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . (default: read value from configuration file.) .It Fl r Ar newrelease -Specify the new release to which +Specify the new release (e.g. 11.2-RELEASE) to which .Nm should upgrade (upgrade command only). .It Fl s Ar server Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/12/usr.sbin/freebsd-update/freebsd-update.sh Tue Apr 2 13:49:32 2019 (r345800) +++ stable/12/usr.sbin/freebsd-update/freebsd-update.sh Tue Apr 2 13:57:52 2019 (r345801) @@ -45,7 +45,8 @@ Options: (default: /var/db/freebsd-update/) -f conffile -- Read configuration options from conffile (default: /etc/freebsd-update.conf) - -F -- Force a fetch operation to proceed + -F -- Force a fetch operation to proceed in the + case of an unfinished upgrade -k KEY -- Trust an RSA key with SHA256 hash of KEY -r release -- Target for upgrade (e.g., 11.1-RELEASE) -s server -- Server from which to fetch updates From owner-svn-src-stable-12@freebsd.org Wed Apr 3 01:29:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D6C1556147; Wed, 3 Apr 2019 01:29:32 +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) server-signature RSA-PSS (4096 bits) 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 CF06A89B0C; Wed, 3 Apr 2019 01:29:31 +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 A24886A6B; Wed, 3 Apr 2019 01:29:31 +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 x331TVPE055574; Wed, 3 Apr 2019 01:29:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x331TV9w055572; Wed, 3 Apr 2019 01:29:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904030129.x331TV9w055572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Apr 2019 01:29:31 +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: r345819 - in stable/12/sys/dev: ahci ichsmb X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/dev: ahci ichsmb X-SVN-Commit-Revision: 345819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF06A89B0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 01:29:32 -0000 Author: mav Date: Wed Apr 3 01:29:30 2019 New Revision: 345819 URL: https://svnweb.freebsd.org/changeset/base/345819 Log: MFC r345333: Add some Cannon Lake chipset IDs. Modified: stable/12/sys/dev/ahci/ahci_pci.c stable/12/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/12/sys/dev/ahci/ahci_pci.c Tue Apr 2 23:51:08 2019 (r345818) +++ stable/12/sys/dev/ahci/ahci_pci.c Wed Apr 3 01:29:30 2019 (r345819) @@ -232,6 +232,8 @@ static const struct { {0xa2828086, 0x00, "Intel Union Point", 0}, {0xa2868086, 0x00, "Intel Union Point (RAID)", 0}, {0xa28e8086, 0x00, "Intel Union Point (RAID)", 0}, + {0xa3528086, 0x00, "Intel Cannon Lake", 0}, + {0xa3538086, 0x00, "Intel Cannon Lake", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE | AHCI_Q_1CH}, Modified: stable/12/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/12/sys/dev/ichsmb/ichsmb_pci.c Tue Apr 2 23:51:08 2019 (r345818) +++ stable/12/sys/dev/ichsmb/ichsmb_pci.c Wed Apr 3 01:29:30 2019 (r345819) @@ -104,6 +104,7 @@ __FBSDID("$FreeBSD$"); #define ID_LEWISBURG 0xa1a3 #define ID_LEWISBURG2 0xa223 #define ID_KABYLAKE 0xa2a3 +#define ID_CANNONLAKE 0xa323 static const struct ichsmb_device { uint16_t id; @@ -148,6 +149,7 @@ static const struct ichsmb_device { { ID_LEWISBURG, "Intel Lewisburg SMBus controller" }, { ID_LEWISBURG2,"Intel Lewisburg SMBus controller" }, { ID_KABYLAKE, "Intel Kaby Lake SMBus controller" }, + { ID_CANNONLAKE,"Intel Cannon Lake SMBus controller" }, { 0, NULL }, }; From owner-svn-src-stable-12@freebsd.org Wed Apr 3 01:30:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE35A1556214; Wed, 3 Apr 2019 01:30:39 +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) server-signature RSA-PSS (4096 bits) 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 92AF989D6F; Wed, 3 Apr 2019 01:30:39 +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 6E4BE6A7E; Wed, 3 Apr 2019 01:30:39 +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 x331Ud9h056569; Wed, 3 Apr 2019 01:30:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x331UdWH056549; Wed, 3 Apr 2019 01:30:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904030130.x331UdWH056549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Apr 2019 01:30:39 +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: r345821 - stable/12/sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 345821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92AF989D6F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 01:30:40 -0000 Author: mav Date: Wed Apr 3 01:30:38 2019 New Revision: 345821 URL: https://svnweb.freebsd.org/changeset/base/345821 Log: MFC r345332: Tune chipset naming. Modified: stable/12/sys/dev/sound/pci/hda/hdac.c stable/12/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdac.c Wed Apr 3 01:29:54 2019 (r345820) +++ stable/12/sys/dev/sound/pci/hda/hdac.c Wed Apr 3 01:30:38 2019 (r345821) @@ -97,11 +97,11 @@ static const struct { { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_SRPTLP, "Intel Sunrise Point-LP", 0, 0 }, - { HDA_INTEL_KBLKLP, "Intel Kabylake-LP", 0, 0 }, + { HDA_INTEL_KBLKLP, "Intel Kaby Lake-LP", 0, 0 }, { HDA_INTEL_SRPT, "Intel Sunrise Point", 0, 0 }, - { HDA_INTEL_KBLK, "Intel Kabylake", 0, 0 }, - { HDA_INTEL_KBLKH, "Intel Kabylake-H", 0, 0 }, - { HDA_INTEL_CFLK, "Intel Coffelake", 0, 0 }, + { HDA_INTEL_KBLK, "Intel Kaby Lake", 0, 0 }, + { HDA_INTEL_KBLKH, "Intel Kaby Lake-H", 0, 0 }, + { HDA_INTEL_CFLK, "Intel Coffee Lake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/12/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdacc.c Wed Apr 3 01:29:54 2019 (r345820) +++ stable/12/sys/dev/sound/pci/hda/hdacc.c Wed Apr 3 01:30:38 2019 (r345821) @@ -368,7 +368,7 @@ static const struct { { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, { HDA_CODEC_INTELBDW, 0, "Intel Broadwell" }, { HDA_CODEC_INTELSKLK, 0, "Intel Skylake" }, - { HDA_CODEC_INTELKBLK, 0, "Intel Kabylake" }, + { HDA_CODEC_INTELKBLK, 0, "Intel Kaby Lake" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From owner-svn-src-stable-12@freebsd.org Wed Apr 3 03:30:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2998B1559D27; Wed, 3 Apr 2019 03:30:16 +0000 (UTC) (envelope-from rpokala@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) server-signature RSA-PSS (4096 bits) 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 B8F168DB15; Wed, 3 Apr 2019 03:30:15 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92CA77F48; Wed, 3 Apr 2019 03:30:15 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x333UF5W019252; Wed, 3 Apr 2019 03:30:15 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x333UFK8019250; Wed, 3 Apr 2019 03:30:15 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201904030330.x333UFK8019250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 3 Apr 2019 03:30: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: r345826 - in stable/12: lib/libc/gen sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/12: lib/libc/gen sys/kern X-SVN-Commit-Revision: 345826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8F168DB15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 03:30:16 -0000 Author: rpokala Date: Wed Apr 3 03:30:14 2019 New Revision: 345826 URL: https://svnweb.freebsd.org/changeset/base/345826 Log: MFC r345457: Add descriptions for sysctls in kern_mib.c and sysctl.3 which lack them. r343532 noted the difference between "hw.realmem" and "hw.physmem", which I was previously unaware of. I discovered that neither sysctl had a description visible via `sysctl -d', so I found where they were defined and added suitable descriptions. While in the file, I went ahead and added descriptions for all the others which lacked them. I also updated sysctl.3 accordingly. Modified: stable/12/lib/libc/gen/sysctl.3 stable/12/sys/kern/kern_mib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/sysctl.3 ============================================================================== --- stable/12/lib/libc/gen/sysctl.3 Wed Apr 3 03:23:45 2019 (r345825) +++ stable/12/lib/libc/gen/sysctl.3 Wed Apr 3 03:30:14 2019 (r345826) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 22, 2017 +.Dd March 22, 2019 .Dt SYSCTL 3 .Os .Sh NAME @@ -284,6 +284,7 @@ privilege may change the value. .It Dv HW_FLOATINGPT Ta integer Ta no .It Dv HW_MACHINE_ARCH Ta string Ta no .It Dv HW_REALMEM Ta integer Ta no +.It Dv HW_AVAILPAGES Ta integer Ta no .El .Bl -tag -width 6n .It Li HW_MACHINE @@ -295,9 +296,10 @@ The number of cpus. .It Li HW_BYTEORDER The byteorder (4321 or 1234). .It Li HW_PHYSMEM -The bytes of physical memory. +Amount of physical memory (in bytes), minus the amount used by the kernel, +pre-loaded modules, and (on x86) the dcons buffer. .It Li HW_USERMEM -The bytes of non-kernel memory. +Amount of memory (in bytes) which is not wired. .It Li HW_PAGESIZE The software page size. .\".It Fa HW_DISKNAMES @@ -307,7 +309,13 @@ Nonzero if the floating point support is in hardware. .It Li HW_MACHINE_ARCH The machine dependent architecture type. .It Li HW_REALMEM -The bytes of real memory. +Amount of memory (in bytes) reported by the firmware. +That value is sometimes not sane; in that case, the kernel reports the max +memory address instead. +.It Li HW_AVAILPAGES +The same value as +.Li HW_PHYSMEM , +measured in pages rather than bytes. .El .Ss CTL_KERN The string and integer information available for the CTL_KERN level Modified: stable/12/sys/kern/kern_mib.c ============================================================================== --- stable/12/sys/kern/kern_mib.c Wed Apr 3 03:23:45 2019 (r345825) +++ stable/12/sys/kern/kern_mib.c Wed Apr 3 03:30:14 2019 (r345826) @@ -187,7 +187,8 @@ sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", + "Amount of physical memory (in bytes)"); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) @@ -201,7 +202,8 @@ sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", + "Amount of memory (in bytes) reported by the firmware"); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) @@ -216,9 +218,11 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", + "Amount of memory (in bytes) which is not wired"); -SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); +SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, + "Amount of physical memory (in pages)"); u_long pagesizes[MAXPAGESIZES] = { PAGE_SIZE }; From owner-svn-src-stable-12@freebsd.org Wed Apr 3 06:36:42 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A201155F77E; Wed, 3 Apr 2019 06:36:42 +0000 (UTC) (envelope-from rpokala@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) server-signature RSA-PSS (4096 bits) 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 D073D95185; Wed, 3 Apr 2019 06:36:41 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D510A01B; Wed, 3 Apr 2019 06:36:41 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x336afDC022384; Wed, 3 Apr 2019 06:36:41 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x336aft4022383; Wed, 3 Apr 2019 06:36:41 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201904030636.x336aft4022383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 3 Apr 2019 06:36: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: r345836 - stable/12/sys/dev/jedec_dimm X-SVN-Group: stable-12 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/12/sys/dev/jedec_dimm X-SVN-Commit-Revision: 345836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D073D95185 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 06:36:42 -0000 Author: rpokala Date: Wed Apr 3 06:36:41 2019 New Revision: 345836 URL: https://svnweb.freebsd.org/changeset/base/345836 Log: MFC r345611: Teach jedec_dimm(4) to be more forgiving of non-fatal errors. It looks like some DIMMs claim to have a TSOD, but actually don't. Some claim they weren't able to change the SPD page, but they did. Neither of those should be fatal errors. Modified: stable/12/sys/dev/jedec_dimm/jedec_dimm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/jedec_dimm/jedec_dimm.c ============================================================================== --- stable/12/sys/dev/jedec_dimm/jedec_dimm.c Wed Apr 3 06:18:24 2019 (r345835) +++ stable/12/sys/dev/jedec_dimm/jedec_dimm.c Wed Apr 3 06:36:41 2019 (r345836) @@ -271,12 +271,16 @@ jedec_dimm_attach(device_t dev) } /* The MSBit of the TSOD-presence byte reports whether or not the TSOD - * is in fact present. If it is, read manufacturer and device info from - * it to confirm that it's a valid TSOD device. It's an error if any of - * those bytes are unreadable; it's not an error if the device is simply - * not known to us (tsod_match == NULL). - * While DDR3 and DDR4 don't explicitly require a TSOD, essentially all - * DDR3 and DDR4 DIMMs include one. + * is in fact present. (While DDR3 and DDR4 don't explicitly require a + * TSOD, essentially all DDR3 and DDR4 DIMMs include one.) But, as + * discussed in [PR 235944], it turns out that some DIMMs claim to have + * a TSOD when they actually don't. (Or maybe the firmware blocks it?) + * + * If the SPD data says the TSOD is present, try to read manufacturer + * and device info from it to confirm that it's a valid TSOD device. + * If the data is unreadable, just continue as if the TSOD isn't there. + * If the data was read successfully, see if it is a known TSOD device; + * it's okay if it isn't (tsod_match == NULL). */ rc = smbus_readb(sc->smbus, sc->spd_addr, tsod_present_offset, &byte); if (rc != 0) { @@ -290,12 +294,14 @@ jedec_dimm_attach(device_t dev) if (rc != 0) { device_printf(dev, "failed to read TSOD Manufacturer ID\n"); - goto out; + rc = 0; + goto no_tsod; } rc = jedec_dimm_readw_be(sc, TSOD_REG_DEV_REV, &devid); if (rc != 0) { device_printf(dev, "failed to read TSOD Device ID\n"); - goto out; + rc = 0; + goto no_tsod; } tsod_match = jedec_dimm_tsod_match(vendorid, devid); @@ -310,6 +316,7 @@ jedec_dimm_attach(device_t dev) } } } else { +no_tsod: tsod_match = NULL; tsod_present = false; } @@ -622,9 +629,12 @@ jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); if (rc != 0) { + /* Some SPD devices (or SMBus controllers?) claim the + * page-change command failed when it actually + * succeeded. Log a message but soldier on. + */ device_printf(sc->dev, "unable to change page: %d\n", rc); - goto out; } /* Add 256 to the store location, because we're in the second * page. From owner-svn-src-stable-12@freebsd.org Wed Apr 3 13:19:48 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDB67156DD94; Wed, 3 Apr 2019 13:19:47 +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) server-signature RSA-PSS (4096 bits) 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 944B580C7D; Wed, 3 Apr 2019 13:19:47 +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 6DB6CE68C; Wed, 3 Apr 2019 13:19:47 +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 x33DJlQH037156; Wed, 3 Apr 2019 13:19:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x33DJldD037155; Wed, 3 Apr 2019 13:19:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904031319.x33DJldD037155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 3 Apr 2019 13:19: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: r345844 - stable/12/sys/arm/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/arm/arm X-SVN-Commit-Revision: 345844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 944B580C7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 13:19:48 -0000 Author: emaste Date: Wed Apr 3 13:19:47 2019 New Revision: 345844 URL: https://svnweb.freebsd.org/changeset/base/345844 Log: MFC r343764 (jchandra): arm, acpi: increase size of memory region arrays Bump up MAX_HWCNT and MAX_EXCNT to 32 when ACPI is enabled. These are the sizes of the hwregions and exregions arrays respectively. ACPI firmware typically has more memory regions and the current value of 16 is not sufficient for some platforms. This commit fixes a failure seen with AMI firmware on Cavium's Sabre ThunderX2 reference platform. This platform needs 21 physical memory regions and 18 excluded regions to boot correctly with the current firmware release. Modified: stable/12/sys/arm/arm/physmem.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/physmem.c ============================================================================== --- stable/12/sys/arm/arm/physmem.c Wed Apr 3 12:47:49 2019 (r345843) +++ stable/12/sys/arm/arm/physmem.c Wed Apr 3 13:19:47 2019 (r345844) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_ddb.h" /* @@ -48,8 +49,13 @@ __FBSDID("$FreeBSD$"); * that can be allocated, or both, depending on the exclusion flags associated * with the region. */ +#ifdef DEV_ACPI +#define MAX_HWCNT 32 /* ACPI needs more regions */ +#define MAX_EXCNT 32 +#else #define MAX_HWCNT 16 #define MAX_EXCNT 16 +#endif #if defined(__arm__) #define MAX_PHYS_ADDR 0xFFFFFFFFull From owner-svn-src-stable-12@freebsd.org Thu Apr 4 02:05:52 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2508C155D31E; Thu, 4 Apr 2019 02:05:52 +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) server-signature RSA-PSS (4096 bits) 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 B4B0A77294; Thu, 4 Apr 2019 02:05:51 +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 A218E1EB15; Thu, 4 Apr 2019 02:05:51 +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 x3425puJ045336; Thu, 4 Apr 2019 02:05:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3425pxY045334; Thu, 4 Apr 2019 02:05:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904040205.x3425pxY045334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 4 Apr 2019 02:05:51 +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: r345867 - in stable/12/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Commit-Revision: 345867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4B0A77294 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 02:05:52 -0000 Author: markj Date: Thu Apr 4 02:05:50 2019 New Revision: 345867 URL: https://svnweb.freebsd.org/changeset/base/345867 Log: MFC r345359, r345384: Don't attempt to measure TSC skew when running as a VM guest. PR: 218452 Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Apr 4 01:23:06 2019 (r345866) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Apr 4 02:05:50 2019 (r345867) @@ -319,6 +319,9 @@ dtrace_gethrtime_init(void *arg) int i; #endif + if (vm_guest != VM_GUEST_NO) + return; + /* The current CPU is the reference one. */ sched_pin(); tsc_skew[curcpu] = 0; Modified: stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Apr 4 01:23:06 2019 (r345866) +++ stable/12/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Apr 4 02:05:50 2019 (r345867) @@ -321,6 +321,9 @@ dtrace_gethrtime_init(void *arg) int i; #endif + if (vm_guest != VM_GUEST_NO) + return; + /* The current CPU is the reference one. */ sched_pin(); tsc_skew[curcpu] = 0; From owner-svn-src-stable-12@freebsd.org Thu Apr 4 09:08:10 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C724F156A15D; Thu, 4 Apr 2019 09:08:10 +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) server-signature RSA-PSS (4096 bits) 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 694488E2D0; Thu, 4 Apr 2019 09:08:10 +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 335C423365; Thu, 4 Apr 2019 09:08:10 +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 x3498ASi069883; Thu, 4 Apr 2019 09:08:10 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34989XI069881; Thu, 4 Apr 2019 09:08:09 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904040908.x34989XI069881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 4 Apr 2019 09:08:09 +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: r345872 - stable/12/sys/dev/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/12/sys/dev/ena X-SVN-Commit-Revision: 345872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 694488E2D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 09:08:11 -0000 Author: mw Date: Thu Apr 4 09:08:09 2019 New Revision: 345872 URL: https://svnweb.freebsd.org/changeset/base/345872 Log: MFC r345371: Prevent double activation of admin interrupt in ENA Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h Modified: stable/12/sys/dev/ena/ena.c ============================================================================== --- stable/12/sys/dev/ena/ena.c Thu Apr 4 09:06:56 2019 (r345871) +++ stable/12/sys/dev/ena/ena.c Thu Apr 4 09:08:09 2019 (r345872) @@ -1944,14 +1944,6 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) return (ENXIO); } - rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, - irq->vector, irq->res); - if (unlikely(rc != 0)) { - device_printf(adapter->pdev, "could not activate " - "irq vector: %d\n", irq->vector); - goto err_res_free; - } - rc = bus_setup_intr(adapter->pdev, irq->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, ena_intr_msix_mgmnt, irq->data, &irq->cookie); Modified: stable/12/sys/dev/ena/ena.h ============================================================================== --- stable/12/sys/dev/ena/ena.h Thu Apr 4 09:06:56 2019 (r345871) +++ stable/12/sys/dev/ena/ena.h Thu Apr 4 09:08:09 2019 (r345872) @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 0 #define DRV_MODULE_VER_MINOR 8 -#define DRV_MODULE_VER_SUBMINOR 3 +#define DRV_MODULE_VER_SUBMINOR 4 #define DRV_MODULE_NAME "ena" From owner-svn-src-stable-12@freebsd.org Thu Apr 4 12:02:52 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 545D2156EA06; Thu, 4 Apr 2019 12:02:52 +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) server-signature RSA-PSS (4096 bits) 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 E11F46D4E9; Thu, 4 Apr 2019 12:02:51 +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 59013251E0; Thu, 4 Apr 2019 12:02:49 +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 x34C2nOH063116; Thu, 4 Apr 2019 12:02:49 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34C2n1m063115; Thu, 4 Apr 2019 12:02:49 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904041202.x34C2n1m063115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 4 Apr 2019 12:02:49 +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: r345874 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 345874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E11F46D4E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 12:02:52 -0000 Author: mw Date: Thu Apr 4 12:02:48 2019 New Revision: 345874 URL: https://svnweb.freebsd.org/changeset/base/345874 Log: MFC r345373: Add bus_release_resource() method to nexus on arm64 Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/arm64/arm64/nexus.c Modified: stable/12/sys/arm64/arm64/nexus.c ============================================================================== --- stable/12/sys/arm64/arm64/nexus.c Thu Apr 4 12:02:41 2019 (r345873) +++ stable/12/sys/arm64/arm64/nexus.c Thu Apr 4 12:02:48 2019 (r345874) @@ -113,6 +113,8 @@ static int nexus_set_resource(device_t, device_t, int, rman_res_t, rman_res_t); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_release_resource(device_t, device_t, int, int, + struct resource *); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); @@ -137,6 +139,7 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), @@ -268,6 +271,20 @@ nexus_alloc_resource(device_t bus, device_t child, int } return (rv); +} + +static int +nexus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + int error; + + if (rman_get_flags(res) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, res); + if (error) + return (error); + } + return (rman_release_resource(res)); } static int From owner-svn-src-stable-12@freebsd.org Thu Apr 4 17:21:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 941861531A90; Thu, 4 Apr 2019 17:21:32 +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) server-signature RSA-PSS (4096 bits) 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 352D0836AB; Thu, 4 Apr 2019 17:21:32 +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 E8B077D0; Thu, 4 Apr 2019 17:21:31 +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 x34HLVK9030075; Thu, 4 Apr 2019 17:21:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34HLVxW030072; Thu, 4 Apr 2019 17:21:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904041721.x34HLVxW030072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 4 Apr 2019 17:21:31 +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: r345878 - in stable: 11/usr.bin/patch 12/usr.bin/patch X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.bin/patch 12/usr.bin/patch X-SVN-Commit-Revision: 345878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 352D0836AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 17:21:32 -0000 Author: kevans Date: Thu Apr 4 17:21:30 2019 New Revision: 345878 URL: https://svnweb.freebsd.org/changeset/base/345878 Log: MFC r344677: patch(1): Exit successfully if we're fed a 0-length patch This change is made in the name of GNU patch compatibility. If GNU patch is fed a zero-length patch, it will exit successfully with no output. This is used in at least one port to date (comms/wsjtx), and we break on this usage. It seems unlikely that anyone relies on patch(1) calling their completely empty patch garbage and failing, and GNU compatibility is a plus if it helps with porting, so make the switch. Modified: stable/12/usr.bin/patch/common.h stable/12/usr.bin/patch/patch.c stable/12/usr.bin/patch/pch.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/patch/common.h stable/11/usr.bin/patch/patch.c stable/11/usr.bin/patch/pch.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/patch/common.h ============================================================================== --- stable/12/usr.bin/patch/common.h Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/common.h Thu Apr 4 17:21:30 2019 (r345878) @@ -64,6 +64,7 @@ extern size_t buf_size; /* size of general purpose buf extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ +extern bool nonempty_patchf_seen; /* seen a non-zero-length patch file? */ #define MAXFILEC 2 Modified: stable/12/usr.bin/patch/patch.c ============================================================================== --- stable/12/usr.bin/patch/patch.c Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/patch.c Thu Apr 4 17:21:30 2019 (r345878) @@ -53,6 +53,7 @@ size_t buf_size; /* size of the general purpose buff bool using_plan_a = true; /* try to keep everything in memory */ bool out_of_mem = false; /* ran out of memory in plan a */ +bool nonempty_patchf_seen = false; /* seen nonempty patch file? */ #define MAXFILEC 2 @@ -419,7 +420,7 @@ main(int argc, char *argv[]) set_signals(1); } - if (!patch_seen) + if (!patch_seen && nonempty_patchf_seen) error = 2; my_exit(error); Modified: stable/12/usr.bin/patch/pch.c ============================================================================== --- stable/12/usr.bin/patch/pch.c Thu Apr 4 17:20:55 2019 (r345877) +++ stable/12/usr.bin/patch/pch.c Thu Apr 4 17:21:30 2019 (r345878) @@ -179,6 +179,9 @@ there_is_another_patch(void) say("done\n"); return false; } + if (p_filesize == 0) + return false; + nonempty_patchf_seen = true; if (verbose) say("Hmm..."); diff_type = intuit_diff_type(); From owner-svn-src-stable-12@freebsd.org Thu Apr 4 17:24:58 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 011941531CEA; Thu, 4 Apr 2019 17:24:58 +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) server-signature RSA-PSS (4096 bits) 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 96B1D83C56; Thu, 4 Apr 2019 17:24:57 +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 715D1957; Thu, 4 Apr 2019 17:24:57 +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 x34HOvrQ034291; Thu, 4 Apr 2019 17:24:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34HOvKA034290; Thu, 4 Apr 2019 17:24:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904041724.x34HOvKA034290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 4 Apr 2019 17:24: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: r345879 - stable/12/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/contrib/netbsd-tests/lib/libc/regex X-SVN-Commit-Revision: 345879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96B1D83C56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 17:24:58 -0000 Author: kevans Date: Thu Apr 4 17:24:57 2019 New Revision: 345879 URL: https://svnweb.freebsd.org/changeset/base/345879 Log: MFC r345516: netbsd-tests: import memory bump for libc/regex/t_exhaust Modified: stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Thu Apr 4 17:21:30 2019 (r345878) +++ stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Thu Apr 4 17:24:57 2019 (r345879) @@ -1,4 +1,4 @@ -/* $NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $ */ +/* $NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__RCSID("$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $"); +__RCSID("$NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $"); #include #include @@ -56,7 +56,7 @@ mkstr(const char *str, size_t len) { size_t slen = strlen(str); char *p = malloc(slen * len + 1); - ATF_REQUIRE(p != NULL); + ATF_REQUIRE_MSG(p != NULL, "slen=%zu, len=%zu", slen, len); for (size_t i = 0; i < len; i++) strcpy(&p[i * slen], str); return p; @@ -183,11 +183,12 @@ ATF_TC_HEAD(regcomp_too_big, tc) ATF_TC_BODY(regcomp_too_big, tc) { regex_t re; - struct rlimit limit; int e; + struct rlimit limit; - limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024; + limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); + for (size_t i = 0; i < __arraycount(tests); i++) { char *d = (*tests[i].pattern)(REGEX_MAXSIZE); e = regcomp(&re, d, tests[i].type); From owner-svn-src-stable-12@freebsd.org Thu Apr 4 17:26:38 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF281531D7A; Thu, 4 Apr 2019 17:26:38 +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) server-signature RSA-PSS (4096 bits) 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 AE87383D9F; Thu, 4 Apr 2019 17:26:37 +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 92B82958; Thu, 4 Apr 2019 17:26:37 +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 x34HQbsZ034453; Thu, 4 Apr 2019 17:26:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34HQZrp034444; Thu, 4 Apr 2019 17:26:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904041726.x34HQZrp034444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 4 Apr 2019 17:26: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: r345880 - stable/12/usr.bin/dtc X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/usr.bin/dtc X-SVN-Commit-Revision: 345880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE87383D9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 17:26:38 -0000 Author: kevans Date: Thu Apr 4 17:26:35 2019 New Revision: 345880 URL: https://svnweb.freebsd.org/changeset/base/345880 Log: dtc(1): Update to 1a79f5f26631 Highlights: - Bugfix for order in which /delete-node/ and /delete-property/ are processed [0] - /omit-if-no-ref/ support has been added (used only by U-Boot at this point, in theory) - GPL dtc compat version bumped to 1.4.7 - Various small fixes and compatibility improvements Modified: stable/12/usr.bin/dtc/dtb.cc stable/12/usr.bin/dtc/dtb.hh stable/12/usr.bin/dtc/dtc.1 stable/12/usr.bin/dtc/dtc.cc stable/12/usr.bin/dtc/fdt.cc stable/12/usr.bin/dtc/fdt.hh stable/12/usr.bin/dtc/input_buffer.cc stable/12/usr.bin/dtc/util.hh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/dtc/dtb.cc ============================================================================== --- stable/12/usr.bin/dtc/dtb.cc Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/dtb.cc Thu Apr 4 17:26:35 2019 (r345880) @@ -37,9 +37,33 @@ #include #include #include +#include using std::string; +namespace { + +void write(dtc::byte_buffer &buffer, int fd) +{ + size_t size = buffer.size(); + uint8_t *data = buffer.data(); + while (size > 0) + { + ssize_t r = ::write(fd, data, size); + if (r >= 0) + { + data += r; + size -= r; + } + else if (errno != EAGAIN) + { + fprintf(stderr, "Writing to file failed\n"); + exit(-1); + } + } +} +} + namespace dtc { namespace dtb @@ -90,8 +114,7 @@ binary_writer::write_data(uint64_t v) void binary_writer::write_to_file(int fd) { - // FIXME: Check return - write(fd, buffer.data(), buffer.size()); + write(buffer, fd); } uint32_t @@ -222,8 +245,7 @@ asm_writer::write_data(uint64_t v) void asm_writer::write_to_file(int fd) { - // FIXME: Check return - write(fd, buffer.data(), buffer.size()); + write(buffer, fd); } uint32_t Modified: stable/12/usr.bin/dtc/dtb.hh ============================================================================== --- stable/12/usr.bin/dtc/dtb.hh Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/dtb.hh Thu Apr 4 17:26:35 2019 (r345880) @@ -109,6 +109,8 @@ inline const char *token_type_name(token_type t) return "FDT_END"; } assert(0); + // Not reached. + return nullptr; } /** Modified: stable/12/usr.bin/dtc/dtc.1 ============================================================================== --- stable/12/usr.bin/dtc/dtc.1 Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/dtc.1 Thu Apr 4 17:26:35 2019 (r345880) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 7, 2018 +.Dd March 27, 2019 .Dt DTC 1 .Os .Sh NAME @@ -304,7 +304,18 @@ Overlay blobs can be applied at boot time by setting in .Xr loader.conf 5 . Multiple overlays may be specified, and they will be applied in the order given. -.El +.Sh NODE OMISSION +This utility supports the +.Va /omit-if-no-ref/ +statement to mark nodes for omission if they are ultimately not referenced +elsewhere in the device tree. +This may be used in more space-constrained environments to remove nodes that may +not be applicable to the specific device the tree is being compiled for. +.Pp +When the +.Fl @ +flag is used to write symbols, nodes with labels will be considered referenced +and will not be removed from the tree. .Sh EXAMPLES The command: .Pp @@ -403,7 +414,11 @@ A dtc tool first appeared in This version of the tool first appeared in .Fx 10.0 . .Sh AUTHORS -.An David T. Chisnall +.Nm +was written by +.An David T. Chisnall . +Some features were added later by +.An Kyle Evans . .Pp Note: The fact that the tool and the author share the same initials is entirely coincidental. Modified: stable/12/usr.bin/dtc/dtc.cc ============================================================================== --- stable/12/usr.bin/dtc/dtc.cc Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/dtc.cc Thu Apr 4 17:26:35 2019 (r345880) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -65,7 +66,7 @@ int version_minor_compatible = 4; * The current patch level of the tool. */ int version_patch = 0; -int version_patch_compatible = 0; +int version_patch_compatible = 7; void usage(const string &argv0) { @@ -105,7 +106,7 @@ main(int argc, char **argv) bool debug_mode = false; auto write_fn = &device_tree::write_binary; auto read_fn = &device_tree::parse_dts; - uint32_t boot_cpu; + uint32_t boot_cpu = 0; bool boot_cpu_specified = false; bool keep_going = false; bool sort = false; Modified: stable/12/usr.bin/dtc/fdt.cc ============================================================================== --- stable/12/usr.bin/dtc/fdt.cc Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/fdt.cc Thu Apr 4 17:26:35 2019 (r345880) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -491,6 +492,7 @@ property::property(text_input_buffer &input, break; } } + [[fallthrough]]; default: input.parse_error("Invalid property value."); valid = false; @@ -622,6 +624,7 @@ property_value::try_to_merge(property_value &other) return false; case EMPTY: *this = other; + [[fallthrough]]; case STRING: case STRING_LIST: case CROSS_REFERENCE: @@ -846,6 +849,7 @@ node_ptr node::create_special_node(const string &name, } node::node(text_input_buffer &input, + device_tree &tree, string &&n, std::unordered_set &&l, string &&a, @@ -862,6 +866,9 @@ node::node(text_input_buffer &input, // flag set if we find any characters that are only in // the property name character set, not the node bool is_property = false; + // flag set if our node is marked as /omit-if-no-ref/ to be + // garbage collected later if nothing references it + bool marked_omit_if_no_ref = false; string child_name, child_address; std::unordered_set child_labels; auto parse_delete = [&](const char *expected, bool at) @@ -908,6 +915,12 @@ node::node(text_input_buffer &input, } continue; } + if (input.consume("/omit-if-no-ref/")) + { + input.next_token(); + marked_omit_if_no_ref = true; + tree.set_needs_garbage_collection(); + } child_name = parse_name(input, is_property, "Expected property or node name"); while (input.consume(':')) @@ -943,10 +956,11 @@ node::node(text_input_buffer &input, } else if (!is_property && *input == ('{')) { - node_ptr child = node::parse(input, std::move(child_name), + node_ptr child = node::parse(input, tree, std::move(child_name), std::move(child_labels), std::move(child_address), defines); if (child) { + child->omit_if_no_ref = marked_omit_if_no_ref; children.push_back(std::move(child)); } else @@ -998,12 +1012,14 @@ node::sort() node_ptr node::parse(text_input_buffer &input, + device_tree &tree, string &&name, string_set &&label, string &&address, define_map *defines) { node_ptr n(new node(input, + tree, std::move(name), std::move(label), std::move(address), @@ -1046,6 +1062,30 @@ node::merge_node(node_ptr &other) { labels.insert(l); } + children.erase(std::remove_if(children.begin(), children.end(), + [&](const node_ptr &p) { + string full_name = p->name; + if (p->unit_address != string()) + { + full_name += '@'; + full_name += p->unit_address; + } + if (other->deleted_children.count(full_name) > 0) + { + other->deleted_children.erase(full_name); + return true; + } + return false; + }), children.end()); + props.erase(std::remove_if(props.begin(), props.end(), + [&](const property_ptr &p) { + if (other->deleted_props.count(p->get_key()) > 0) + { + other->deleted_props.erase(p->get_key()); + return true; + } + return false; + }), props.end()); // Note: this is an O(n*m) operation. It might be sensible to // optimise this if we find that there are nodes with very // large numbers of properties, but for typical usage the @@ -1085,30 +1125,6 @@ node::merge_node(node_ptr &other) children.push_back(std::move(c)); } } - children.erase(std::remove_if(children.begin(), children.end(), - [&](const node_ptr &p) { - string full_name = p->name; - if (p->unit_address != string()) - { - full_name += '@'; - full_name += p->unit_address; - } - if (other->deleted_children.count(full_name) > 0) - { - other->deleted_children.erase(full_name); - return true; - } - return false; - }), children.end()); - props.erase(std::remove_if(props.begin(), props.end(), - [&](const property_ptr &p) { - if (other->deleted_props.count(p->get_key()) > 0) - { - other->deleted_props.erase(p->get_key()); - return true; - } - return false; - }), props.end()); } void @@ -1187,6 +1203,7 @@ device_tree::collect_names_recursive(node_ptr &n, node { node_names.insert(std::make_pair(name, n.get())); node_paths.insert(std::make_pair(name, path)); + ordered_node_paths.push_back({name, path}); } else { @@ -1243,6 +1260,7 @@ device_tree::collect_names() node_path p; node_names.clear(); node_paths.clear(); + ordered_node_paths.clear(); cross_references.clear(); fixups.clear(); collect_names_recursive(root, p); @@ -1353,7 +1371,6 @@ device_tree::resolve_cross_references(uint32_t &phandl return node::VISIT_RECURSE; }, nullptr); assert(sorted_phandles.size() == fixups.size()); - for (auto &i : sorted_phandles) { string target_name = i.get().val.string_data; @@ -1441,7 +1458,104 @@ device_tree::resolve_cross_references(uint32_t &phandl } } +bool +device_tree::garbage_collect_marked_nodes() +{ + std::unordered_set previously_referenced_nodes; + std::unordered_set newly_referenced_nodes; + auto mark_referenced_nodes_used = [&](node &n) + { + for (auto &p : n.properties()) + { + for (auto &v : *p) + { + if (v.is_phandle()) + { + node *nx = node_names[v.string_data]; + if (nx == nullptr) + { + // Try it again, but as a path + for (auto &s : node_paths) + { + if (v.string_data == s.second.to_string()) + { + nx = node_names[s.first]; + break; + } + } + } + if (nx == nullptr) + { + // Couldn't resolve this one? + continue; + } + // Only mark those currently unmarked + if (!nx->used) + { + nx->used = 1; + newly_referenced_nodes.insert(nx); + } + } + } + } + }; + + // Seed our referenced nodes with those that have been seen by a node that + // either will not be omitted if it's unreferenced or has a symbol. + // Nodes with symbols are explicitly not garbage collected because they may + // be expected for referencing by an overlay, and we do not want surprises + // there. + root->visit([&](node &n, node *) { + if (!n.omit_if_no_ref || (write_symbols && !n.labels.empty())) + { + mark_referenced_nodes_used(n); + } + // Recurse as normal + return node::VISIT_RECURSE; + }, nullptr); + + while (!newly_referenced_nodes.empty()) + { + previously_referenced_nodes = std::move(newly_referenced_nodes); + for (auto *n : previously_referenced_nodes) + { + mark_referenced_nodes_used(*n); + } + } + + previously_referenced_nodes.clear(); + bool children_deleted = false; + + // Delete + root->visit([&](node &n, node *) { + bool gc_children = false; + + for (auto &cn : n.child_nodes()) + { + if (cn->omit_if_no_ref && !cn->used) + { + gc_children = true; + break; + } + } + + if (gc_children) + { + children_deleted = true; + n.delete_children_if([](node_ptr &nx) { + return (nx->omit_if_no_ref && !nx->used); + }); + + return node::VISIT_CONTINUE; + } + + return node::VISIT_RECURSE; + }, nullptr); + + return children_deleted; +} + void device_tree::parse_file(text_input_buffer &input, std::vector &roots, @@ -1486,7 +1600,7 @@ device_tree::parse_file(text_input_buffer &input, if (input.consume('/')) { input.next_token(); - n = node::parse(input, string(), string_set(), string(), &defines); + n = node::parse(input, *this, string(), string_set(), string(), &defines); } else if (input.consume('&')) { @@ -1507,7 +1621,7 @@ device_tree::parse_file(text_input_buffer &input, name = input.parse_node_name(); } input.next_token(); - n = node::parse(input, std::move(name), string_set(), string(), &defines); + n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); n->name_is_path_reference = name_is_path_reference; } else @@ -1890,6 +2004,12 @@ device_tree::parse_dts(const string &fn, FILE *depfile } } collect_names(); + // Return value indicates whether we've dirtied the tree or not and need to + // recollect names + if (garbage_collect && garbage_collect_marked_nodes()) + { + collect_names(); + } uint32_t phandle = 1; // If we're writing symbols, go ahead and assign phandles to the entire // tree. We'll do this before we resolve cross references, just to keep @@ -1906,8 +2026,14 @@ device_tree::parse_dts(const string &fn, FILE *depfile // referenced by other plugins, so we create a __symbols__ node inside // the root that contains mappings (properties) from label names to // paths. - for (auto &s : node_paths) + for (auto i=ordered_node_paths.rbegin(), e=ordered_node_paths.rend() ; i!=e ; ++i) { + auto &s = *i; + if (node_paths.find(s.first) == node_paths.end()) + { + // Erased node, skip it. + continue; + } property_value v; v.string_data = s.second.to_string(); v.type = property_value::STRING; @@ -1986,19 +2112,23 @@ device_tree::parse_dts(const string &fn, FILE *depfile { if (c->name == p.first) { - string path = p.first; - if (!(p.second.empty())) + if (c->unit_address == p.second) { - path += '@'; - path += p.second; + n = c.get(); + found = true; + break; } - n->add_child(node::create_special_node(path, symbols)); - n = (--n->child_end())->get(); } } if (!found) { - n->add_child(node::create_special_node(p.first, symbols)); + string path = p.first; + if (!(p.second.empty())) + { + path += '@'; + path += p.second; + } + n->add_child(node::create_special_node(path, symbols)); n = (--n->child_end())->get(); } } Modified: stable/12/usr.bin/dtc/fdt.hh ============================================================================== --- stable/12/usr.bin/dtc/fdt.hh Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/fdt.hh Thu Apr 4 17:26:35 2019 (r345880) @@ -56,6 +56,7 @@ namespace fdt { class property; class node; +class device_tree; /** * Type for (owned) pointers to properties. */ @@ -418,6 +419,17 @@ class node */ std::string unit_address; /** + * A flag indicating that this node has been marked /omit-if-no-ref/ and + * will be omitted if it is not referenced, either directly or indirectly, + * by a node that is not similarly denoted. + */ + bool omit_if_no_ref = false; + /** + * A flag indicating that this node has been referenced, either directly + * or indirectly, by a node that is not marked /omit-if-no-ref/. + */ + bool used = false; + /** * The type for the property vector. */ typedef std::vector property_vector; @@ -507,6 +519,7 @@ class node * already been parsed. */ node(text_input_buffer &input, + device_tree &tree, std::string &&n, std::unordered_set &&l, std::string &&a, @@ -603,6 +616,7 @@ class node * have been parsed. */ static node_ptr parse(text_input_buffer &input, + device_tree &tree, std::string &&name, std::unordered_set &&label=std::unordered_set(), std::string &&address=std::string(), @@ -640,6 +654,13 @@ class node children.push_back(std::move(n)); } /** + * Deletes any children from this node. + */ + inline void delete_children_if(bool (*predicate)(node_ptr &)) + { + children.erase(std::remove_if(children.begin(), children.end(), predicate), children.end()); + } + /** * Merges a node into this one. Any properties present in both are * overridden, any properties present in only one are preserved. */ @@ -710,6 +731,11 @@ class device_tree */ bool valid = true; /** + * Flag indicating that this tree requires garbage collection. This will be + * set to true if a node marked /omit-if-no-ref/ is encountered. + */ + bool garbage_collect = false; + /** * Type used for memory reservations. A reservation is two 64-bit * values indicating a base address and length in memory that the * kernel should not use. The high 32 bits are ignored on 32-bit @@ -736,6 +762,12 @@ class device_tree */ std::unordered_map node_paths; /** + * All of the elements in `node_paths` in the order that they were + * created. This is used for emitting the `__symbols__` section, where + * we want to guarantee stable ordering. + */ + std::vector> ordered_node_paths; + /** * A collection of property values that are references to other nodes. * These should be expanded to the full path of their targets. */ @@ -847,10 +879,20 @@ class device_tree * node must have their values replaced by either the node path or * phandle value. The phandle parameter holds the next phandle to be * assigned, should the need arise. It will be incremented upon each - * assignment of a phandle. + * assignment of a phandle. Garbage collection of unreferenced nodes + * marked for "delete if unreferenced" will also occur here. */ void resolve_cross_references(uint32_t &phandle); /** + * Garbage collects nodes that have been marked /omit-if-no-ref/ and do not + * have any references to them from nodes that are similarly marked. This + * is a fairly expensive operation. The return value indicates whether the + * tree has been dirtied as a result of this operation, so that the caller + * may take appropriate measures to bring the device tree into a consistent + * state as needed. + */ + bool garbage_collect_marked_nodes(); + /** * Parses a dts file in the given buffer and adds the roots to the parsed * set. The `read_header` argument indicates whether the header has * already been read. Some dts files place the header in an include, @@ -931,6 +973,14 @@ class device_tree inline bool is_valid() { return valid; + } + /** + * Mark this tree as needing garbage collection, because an /omit-if-no-ref/ + * node has been encountered. + */ + void set_needs_garbage_collection() + { + garbage_collect = true; } /** * Sets the format for writing phandle properties. Modified: stable/12/usr.bin/dtc/input_buffer.cc ============================================================================== --- stable/12/usr.bin/dtc/input_buffer.cc Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/input_buffer.cc Thu Apr 4 17:26:35 2019 (r345880) @@ -126,7 +126,7 @@ mmap_input_buffer::~mmap_input_buffer() { if (buffer != 0) { - munmap((void*)buffer, size); + munmap(const_cast(buffer), size); } } Modified: stable/12/usr.bin/dtc/util.hh ============================================================================== --- stable/12/usr.bin/dtc/util.hh Thu Apr 4 17:24:57 2019 (r345879) +++ stable/12/usr.bin/dtc/util.hh Thu Apr 4 17:26:35 2019 (r345880) @@ -47,6 +47,38 @@ #endif #endif +#ifdef MISSING_DIGITTOINT +namespace +{ + /** + * Glibc doesn't have a definition of digittoint, so provide our own. + */ + inline int digittoint(int c) + { + switch (c) + { + default: + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + case 'a': return 10; + case 'b': return 11; + case 'c': return 12; + case 'd': return 13; + case 'e': return 14; + case 'f': return 15; + } + } +} +#endif + namespace dtc { /** From owner-svn-src-stable-12@freebsd.org Thu Apr 4 17:29:46 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29ACC153C049; Thu, 4 Apr 2019 17:29: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) server-signature RSA-PSS (4096 bits) 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 C5BD884115; Thu, 4 Apr 2019 17:29:45 +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 87D8D960; Thu, 4 Apr 2019 17:29:45 +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 x34HTjh7034709; Thu, 4 Apr 2019 17:29:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x34HTjLa034707; Thu, 4 Apr 2019 17:29:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904041729.x34HTjLa034707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 4 Apr 2019 17:29:45 +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: r345882 - in stable: 11/stand/lua 12/stand/lua X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/lua 12/stand/lua X-SVN-Commit-Revision: 345882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5BD884115 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 17:29:46 -0000 Author: kevans Date: Thu Apr 4 17:29:43 2019 New Revision: 345882 URL: https://svnweb.freebsd.org/changeset/base/345882 Log: MFC r344243, r345517-r345518: lualoader: More intelligent screen clearing r344243: lualoader: only clear the screen before first password prompt This was previously an unconditional screen clear, regardless of whether or not we would be prompting for any passwords. This is pointless, given that the screen clear is only there to put our screen into a consistent state before we draw the prompts and do cursor manipulation. This is also the only screen clear besides that to draw the menu. One can now see early pre-loader and loader output with the menu disabled, which may be useful for diagnostics. r345517: lualoader: Clear the screen before prompting for password Assuming that the autoboot sequence was interrupted, we've done enough cursor manipulation that the prompt for the password will be sufficiently obscured a couple of lines up. Clear the screen and reset the cursor position here, too. r345518: lualoader: Fix up some luacheck concerns - Garbage collect an unused (removed because it was useless) constant - Don't bother with vararg notation if args will not be used Modified: stable/12/stand/lua/config.lua stable/12/stand/lua/menu.lua stable/12/stand/lua/password.lua Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/lua/config.lua stable/11/stand/lua/menu.lua stable/11/stand/lua/password.lua Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/lua/config.lua ============================================================================== --- stable/12/stand/lua/config.lua Thu Apr 4 17:27:01 2019 (r345881) +++ stable/12/stand/lua/config.lua Thu Apr 4 17:29:43 2019 (r345882) @@ -45,7 +45,6 @@ local MSG_FAILOPENCFG = "Failed to open config: '%s'" local MSG_FAILREADCFG = "Failed to read config: '%s'" local MSG_FAILPARSECFG = "Failed to parse config: '%s'" local MSG_FAILEXBEF = "Failed to execute '%s' before loading '%s'" -local MSG_FAILEXMOD = "Failed to execute '%s'" local MSG_FAILEXAF = "Failed to execute '%s' after loading '%s'" local MSG_MALFORMED = "Malformed line (%d):\n\t'%s'" local MSG_DEFAULTKERNFAIL = "No kernel set, failed to load from module_path" Modified: stable/12/stand/lua/menu.lua ============================================================================== --- stable/12/stand/lua/menu.lua Thu Apr 4 17:27:01 2019 (r345881) +++ stable/12/stand/lua/menu.lua Thu Apr 4 17:29:43 2019 (r345882) @@ -494,7 +494,7 @@ function menu.autoboot(delay) end -- CLI commands -function cli.menu(...) +function cli.menu() menu.run() end Modified: stable/12/stand/lua/password.lua ============================================================================== --- stable/12/stand/lua/password.lua Thu Apr 4 17:27:01 2019 (r345881) +++ stable/12/stand/lua/password.lua Thu Apr 4 17:29:43 2019 (r345882) @@ -38,7 +38,14 @@ local INCORRECT_PASSWORD = "loader: incorrect password -- Asterisks as a password mask local show_password_mask = false local twiddle_chars = {"/", "-", "\\", "|"} +local screen_setup = false +local function setup_screen() + screen.clear() + screen.defcursor() + screen_setup = true +end + -- Module exports function password.read(prompt_length) local str = "" @@ -80,8 +87,6 @@ function password.read(prompt_length) end function password.check() - screen.clear() - screen.defcursor() -- pwd is optionally supplied if we want to check it local function doPrompt(prompt, pwd) local attempts = 1 @@ -90,6 +95,10 @@ function password.check() printc("\r" .. string.rep(" ", #INCORRECT_PASSWORD)) end + if not screen_setup then + setup_screen() + end + while true do if attempts > 1 then clear_incorrect_text_prompt() @@ -126,6 +135,11 @@ function password.check() local pwd = loader.getenv("password") if pwd ~= nil then core.autoboot() + -- The autoboot sequence was interrupted, so we'll need to + -- prompt for a password. Put the screen back into a known + -- good state, otherwise we're drawing back a couple lines + -- in the middle of other text. + setup_screen() end compare("Loader password:", pwd) end From owner-svn-src-stable-12@freebsd.org Thu Apr 4 17:36:17 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BCE8153C49F; Thu, 4 Apr 2019 17:36:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF9E846C1; Thu, 4 Apr 2019 17:36:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x34HaF2b034356; Thu, 4 Apr 2019 10:36:15 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x34HaFb3034355; Thu, 4 Apr 2019 10:36:15 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904041736.x34HaFb3034355@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345880 - stable/12/usr.bin/dtc In-Reply-To: <201904041726.x34HQZrp034444@repo.freebsd.org> To: Kyle Evans Date: Thu, 4 Apr 2019 10:36:15 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: BEF9E846C1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.923,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 17:36:17 -0000 > Author: kevans > Date: Thu Apr 4 17:26:35 2019 > New Revision: 345880 > URL: https://svnweb.freebsd.org/changeset/base/345880 > > Log: > dtc(1): Update to 1a79f5f26631 Is there someway to update the quality of this pointer? When googled it tends to loop back to FreeBSD.org stuff. Thanks, Rod > Highlights: > - Bugfix for order in which /delete-node/ and /delete-property/ are > processed [0] > - /omit-if-no-ref/ support has been added (used only by U-Boot at this > point, in theory) > - GPL dtc compat version bumped to 1.4.7 > - Various small fixes and compatibility improvements > > Modified: > stable/12/usr.bin/dtc/dtb.cc > stable/12/usr.bin/dtc/dtb.hh > stable/12/usr.bin/dtc/dtc.1 > stable/12/usr.bin/dtc/dtc.cc > stable/12/usr.bin/dtc/fdt.cc > stable/12/usr.bin/dtc/fdt.hh > stable/12/usr.bin/dtc/input_buffer.cc > stable/12/usr.bin/dtc/util.hh > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/usr.bin/dtc/dtb.cc > ============================================================================== > --- stable/12/usr.bin/dtc/dtb.cc Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/dtb.cc Thu Apr 4 17:26:35 2019 (r345880) > @@ -37,9 +37,33 @@ > #include > #include > #include > +#include > > using std::string; > > +namespace { > + > +void write(dtc::byte_buffer &buffer, int fd) > +{ > + size_t size = buffer.size(); > + uint8_t *data = buffer.data(); > + while (size > 0) > + { > + ssize_t r = ::write(fd, data, size); > + if (r >= 0) > + { > + data += r; > + size -= r; > + } > + else if (errno != EAGAIN) > + { > + fprintf(stderr, "Writing to file failed\n"); > + exit(-1); > + } > + } > +} > +} > + > namespace dtc > { > namespace dtb > @@ -90,8 +114,7 @@ binary_writer::write_data(uint64_t v) > void > binary_writer::write_to_file(int fd) > { > - // FIXME: Check return > - write(fd, buffer.data(), buffer.size()); > + write(buffer, fd); > } > > uint32_t > @@ -222,8 +245,7 @@ asm_writer::write_data(uint64_t v) > void > asm_writer::write_to_file(int fd) > { > - // FIXME: Check return > - write(fd, buffer.data(), buffer.size()); > + write(buffer, fd); > } > > uint32_t > > Modified: stable/12/usr.bin/dtc/dtb.hh > ============================================================================== > --- stable/12/usr.bin/dtc/dtb.hh Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/dtb.hh Thu Apr 4 17:26:35 2019 (r345880) > @@ -109,6 +109,8 @@ inline const char *token_type_name(token_type t) > return "FDT_END"; > } > assert(0); > + // Not reached. > + return nullptr; > } > > /** > > Modified: stable/12/usr.bin/dtc/dtc.1 > ============================================================================== > --- stable/12/usr.bin/dtc/dtc.1 Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/dtc.1 Thu Apr 4 17:26:35 2019 (r345880) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\"/ > -.Dd April 7, 2018 > +.Dd March 27, 2019 > .Dt DTC 1 > .Os > .Sh NAME > @@ -304,7 +304,18 @@ Overlay blobs can be applied at boot time by setting > in > .Xr loader.conf 5 . > Multiple overlays may be specified, and they will be applied in the order given. > -.El > +.Sh NODE OMISSION > +This utility supports the > +.Va /omit-if-no-ref/ > +statement to mark nodes for omission if they are ultimately not referenced > +elsewhere in the device tree. > +This may be used in more space-constrained environments to remove nodes that may > +not be applicable to the specific device the tree is being compiled for. > +.Pp > +When the > +.Fl @ > +flag is used to write symbols, nodes with labels will be considered referenced > +and will not be removed from the tree. > .Sh EXAMPLES > The command: > .Pp > @@ -403,7 +414,11 @@ A dtc tool first appeared in > This version of the tool first appeared in > .Fx 10.0 . > .Sh AUTHORS > -.An David T. Chisnall > +.Nm > +was written by > +.An David T. Chisnall . > +Some features were added later by > +.An Kyle Evans . > .Pp > Note: The fact that the tool and the author share the same initials is entirely > coincidental. > > Modified: stable/12/usr.bin/dtc/dtc.cc > ============================================================================== > --- stable/12/usr.bin/dtc/dtc.cc Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/dtc.cc Thu Apr 4 17:26:35 2019 (r345880) > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -65,7 +66,7 @@ int version_minor_compatible = 4; > * The current patch level of the tool. > */ > int version_patch = 0; > -int version_patch_compatible = 0; > +int version_patch_compatible = 7; > > void usage(const string &argv0) > { > @@ -105,7 +106,7 @@ main(int argc, char **argv) > bool debug_mode = false; > auto write_fn = &device_tree::write_binary; > auto read_fn = &device_tree::parse_dts; > - uint32_t boot_cpu; > + uint32_t boot_cpu = 0; > bool boot_cpu_specified = false; > bool keep_going = false; > bool sort = false; > > Modified: stable/12/usr.bin/dtc/fdt.cc > ============================================================================== > --- stable/12/usr.bin/dtc/fdt.cc Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/fdt.cc Thu Apr 4 17:26:35 2019 (r345880) > @@ -46,6 +46,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -491,6 +492,7 @@ property::property(text_input_buffer &input, > break; > } > } > + [[fallthrough]]; > default: > input.parse_error("Invalid property value."); > valid = false; > @@ -622,6 +624,7 @@ property_value::try_to_merge(property_value &other) > return false; > case EMPTY: > *this = other; > + [[fallthrough]]; > case STRING: > case STRING_LIST: > case CROSS_REFERENCE: > @@ -846,6 +849,7 @@ node_ptr node::create_special_node(const string &name, > } > > node::node(text_input_buffer &input, > + device_tree &tree, > string &&n, > std::unordered_set &&l, > string &&a, > @@ -862,6 +866,9 @@ node::node(text_input_buffer &input, > // flag set if we find any characters that are only in > // the property name character set, not the node > bool is_property = false; > + // flag set if our node is marked as /omit-if-no-ref/ to be > + // garbage collected later if nothing references it > + bool marked_omit_if_no_ref = false; > string child_name, child_address; > std::unordered_set child_labels; > auto parse_delete = [&](const char *expected, bool at) > @@ -908,6 +915,12 @@ node::node(text_input_buffer &input, > } > continue; > } > + if (input.consume("/omit-if-no-ref/")) > + { > + input.next_token(); > + marked_omit_if_no_ref = true; > + tree.set_needs_garbage_collection(); > + } > child_name = parse_name(input, is_property, > "Expected property or node name"); > while (input.consume(':')) > @@ -943,10 +956,11 @@ node::node(text_input_buffer &input, > } > else if (!is_property && *input == ('{')) > { > - node_ptr child = node::parse(input, std::move(child_name), > + node_ptr child = node::parse(input, tree, std::move(child_name), > std::move(child_labels), std::move(child_address), defines); > if (child) > { > + child->omit_if_no_ref = marked_omit_if_no_ref; > children.push_back(std::move(child)); > } > else > @@ -998,12 +1012,14 @@ node::sort() > > node_ptr > node::parse(text_input_buffer &input, > + device_tree &tree, > string &&name, > string_set &&label, > string &&address, > define_map *defines) > { > node_ptr n(new node(input, > + tree, > std::move(name), > std::move(label), > std::move(address), > @@ -1046,6 +1062,30 @@ node::merge_node(node_ptr &other) > { > labels.insert(l); > } > + children.erase(std::remove_if(children.begin(), children.end(), > + [&](const node_ptr &p) { > + string full_name = p->name; > + if (p->unit_address != string()) > + { > + full_name += '@'; > + full_name += p->unit_address; > + } > + if (other->deleted_children.count(full_name) > 0) > + { > + other->deleted_children.erase(full_name); > + return true; > + } > + return false; > + }), children.end()); > + props.erase(std::remove_if(props.begin(), props.end(), > + [&](const property_ptr &p) { > + if (other->deleted_props.count(p->get_key()) > 0) > + { > + other->deleted_props.erase(p->get_key()); > + return true; > + } > + return false; > + }), props.end()); > // Note: this is an O(n*m) operation. It might be sensible to > // optimise this if we find that there are nodes with very > // large numbers of properties, but for typical usage the > @@ -1085,30 +1125,6 @@ node::merge_node(node_ptr &other) > children.push_back(std::move(c)); > } > } > - children.erase(std::remove_if(children.begin(), children.end(), > - [&](const node_ptr &p) { > - string full_name = p->name; > - if (p->unit_address != string()) > - { > - full_name += '@'; > - full_name += p->unit_address; > - } > - if (other->deleted_children.count(full_name) > 0) > - { > - other->deleted_children.erase(full_name); > - return true; > - } > - return false; > - }), children.end()); > - props.erase(std::remove_if(props.begin(), props.end(), > - [&](const property_ptr &p) { > - if (other->deleted_props.count(p->get_key()) > 0) > - { > - other->deleted_props.erase(p->get_key()); > - return true; > - } > - return false; > - }), props.end()); > } > > void > @@ -1187,6 +1203,7 @@ device_tree::collect_names_recursive(node_ptr &n, node > { > node_names.insert(std::make_pair(name, n.get())); > node_paths.insert(std::make_pair(name, path)); > + ordered_node_paths.push_back({name, path}); > } > else > { > @@ -1243,6 +1260,7 @@ device_tree::collect_names() > node_path p; > node_names.clear(); > node_paths.clear(); > + ordered_node_paths.clear(); > cross_references.clear(); > fixups.clear(); > collect_names_recursive(root, p); > @@ -1353,7 +1371,6 @@ device_tree::resolve_cross_references(uint32_t &phandl > return node::VISIT_RECURSE; > }, nullptr); > assert(sorted_phandles.size() == fixups.size()); > - > for (auto &i : sorted_phandles) > { > string target_name = i.get().val.string_data; > @@ -1441,7 +1458,104 @@ device_tree::resolve_cross_references(uint32_t &phandl > } > } > > +bool > +device_tree::garbage_collect_marked_nodes() > +{ > + std::unordered_set previously_referenced_nodes; > + std::unordered_set newly_referenced_nodes; > > + auto mark_referenced_nodes_used = [&](node &n) > + { > + for (auto &p : n.properties()) > + { > + for (auto &v : *p) > + { > + if (v.is_phandle()) > + { > + node *nx = node_names[v.string_data]; > + if (nx == nullptr) > + { > + // Try it again, but as a path > + for (auto &s : node_paths) > + { > + if (v.string_data == s.second.to_string()) > + { > + nx = node_names[s.first]; > + break; > + } > + } > + } > + if (nx == nullptr) > + { > + // Couldn't resolve this one? > + continue; > + } > + // Only mark those currently unmarked > + if (!nx->used) > + { > + nx->used = 1; > + newly_referenced_nodes.insert(nx); > + } > + } > + } > + } > + }; > + > + // Seed our referenced nodes with those that have been seen by a node that > + // either will not be omitted if it's unreferenced or has a symbol. > + // Nodes with symbols are explicitly not garbage collected because they may > + // be expected for referencing by an overlay, and we do not want surprises > + // there. > + root->visit([&](node &n, node *) { > + if (!n.omit_if_no_ref || (write_symbols && !n.labels.empty())) > + { > + mark_referenced_nodes_used(n); > + } > + // Recurse as normal > + return node::VISIT_RECURSE; > + }, nullptr); > + > + while (!newly_referenced_nodes.empty()) > + { > + previously_referenced_nodes = std::move(newly_referenced_nodes); > + for (auto *n : previously_referenced_nodes) > + { > + mark_referenced_nodes_used(*n); > + } > + } > + > + previously_referenced_nodes.clear(); > + bool children_deleted = false; > + > + // Delete > + root->visit([&](node &n, node *) { > + bool gc_children = false; > + > + for (auto &cn : n.child_nodes()) > + { > + if (cn->omit_if_no_ref && !cn->used) > + { > + gc_children = true; > + break; > + } > + } > + > + if (gc_children) > + { > + children_deleted = true; > + n.delete_children_if([](node_ptr &nx) { > + return (nx->omit_if_no_ref && !nx->used); > + }); > + > + return node::VISIT_CONTINUE; > + } > + > + return node::VISIT_RECURSE; > + }, nullptr); > + > + return children_deleted; > +} > + > void > device_tree::parse_file(text_input_buffer &input, > std::vector &roots, > @@ -1486,7 +1600,7 @@ device_tree::parse_file(text_input_buffer &input, > if (input.consume('/')) > { > input.next_token(); > - n = node::parse(input, string(), string_set(), string(), &defines); > + n = node::parse(input, *this, string(), string_set(), string(), &defines); > } > else if (input.consume('&')) > { > @@ -1507,7 +1621,7 @@ device_tree::parse_file(text_input_buffer &input, > name = input.parse_node_name(); > } > input.next_token(); > - n = node::parse(input, std::move(name), string_set(), string(), &defines); > + n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); > n->name_is_path_reference = name_is_path_reference; > } > else > @@ -1890,6 +2004,12 @@ device_tree::parse_dts(const string &fn, FILE *depfile > } > } > collect_names(); > + // Return value indicates whether we've dirtied the tree or not and need to > + // recollect names > + if (garbage_collect && garbage_collect_marked_nodes()) > + { > + collect_names(); > + } > uint32_t phandle = 1; > // If we're writing symbols, go ahead and assign phandles to the entire > // tree. We'll do this before we resolve cross references, just to keep > @@ -1906,8 +2026,14 @@ device_tree::parse_dts(const string &fn, FILE *depfile > // referenced by other plugins, so we create a __symbols__ node inside > // the root that contains mappings (properties) from label names to > // paths. > - for (auto &s : node_paths) > + for (auto i=ordered_node_paths.rbegin(), e=ordered_node_paths.rend() ; i!=e ; ++i) > { > + auto &s = *i; > + if (node_paths.find(s.first) == node_paths.end()) > + { > + // Erased node, skip it. > + continue; > + } > property_value v; > v.string_data = s.second.to_string(); > v.type = property_value::STRING; > @@ -1986,19 +2112,23 @@ device_tree::parse_dts(const string &fn, FILE *depfile > { > if (c->name == p.first) > { > - string path = p.first; > - if (!(p.second.empty())) > + if (c->unit_address == p.second) > { > - path += '@'; > - path += p.second; > + n = c.get(); > + found = true; > + break; > } > - n->add_child(node::create_special_node(path, symbols)); > - n = (--n->child_end())->get(); > } > } > if (!found) > { > - n->add_child(node::create_special_node(p.first, symbols)); > + string path = p.first; > + if (!(p.second.empty())) > + { > + path += '@'; > + path += p.second; > + } > + n->add_child(node::create_special_node(path, symbols)); > n = (--n->child_end())->get(); > } > } > > Modified: stable/12/usr.bin/dtc/fdt.hh > ============================================================================== > --- stable/12/usr.bin/dtc/fdt.hh Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/fdt.hh Thu Apr 4 17:26:35 2019 (r345880) > @@ -56,6 +56,7 @@ namespace fdt > { > class property; > class node; > +class device_tree; > /** > * Type for (owned) pointers to properties. > */ > @@ -418,6 +419,17 @@ class node > */ > std::string unit_address; > /** > + * A flag indicating that this node has been marked /omit-if-no-ref/ and > + * will be omitted if it is not referenced, either directly or indirectly, > + * by a node that is not similarly denoted. > + */ > + bool omit_if_no_ref = false; > + /** > + * A flag indicating that this node has been referenced, either directly > + * or indirectly, by a node that is not marked /omit-if-no-ref/. > + */ > + bool used = false; > + /** > * The type for the property vector. > */ > typedef std::vector property_vector; > @@ -507,6 +519,7 @@ class node > * already been parsed. > */ > node(text_input_buffer &input, > + device_tree &tree, > std::string &&n, > std::unordered_set &&l, > std::string &&a, > @@ -603,6 +616,7 @@ class node > * have been parsed. > */ > static node_ptr parse(text_input_buffer &input, > + device_tree &tree, > std::string &&name, > std::unordered_set &&label=std::unordered_set(), > std::string &&address=std::string(), > @@ -640,6 +654,13 @@ class node > children.push_back(std::move(n)); > } > /** > + * Deletes any children from this node. > + */ > + inline void delete_children_if(bool (*predicate)(node_ptr &)) > + { > + children.erase(std::remove_if(children.begin(), children.end(), predicate), children.end()); > + } > + /** > * Merges a node into this one. Any properties present in both are > * overridden, any properties present in only one are preserved. > */ > @@ -710,6 +731,11 @@ class device_tree > */ > bool valid = true; > /** > + * Flag indicating that this tree requires garbage collection. This will be > + * set to true if a node marked /omit-if-no-ref/ is encountered. > + */ > + bool garbage_collect = false; > + /** > * Type used for memory reservations. A reservation is two 64-bit > * values indicating a base address and length in memory that the > * kernel should not use. The high 32 bits are ignored on 32-bit > @@ -736,6 +762,12 @@ class device_tree > */ > std::unordered_map node_paths; > /** > + * All of the elements in `node_paths` in the order that they were > + * created. This is used for emitting the `__symbols__` section, where > + * we want to guarantee stable ordering. > + */ > + std::vector> ordered_node_paths; > + /** > * A collection of property values that are references to other nodes. > * These should be expanded to the full path of their targets. > */ > @@ -847,10 +879,20 @@ class device_tree > * node must have their values replaced by either the node path or > * phandle value. The phandle parameter holds the next phandle to be > * assigned, should the need arise. It will be incremented upon each > - * assignment of a phandle. > + * assignment of a phandle. Garbage collection of unreferenced nodes > + * marked for "delete if unreferenced" will also occur here. > */ > void resolve_cross_references(uint32_t &phandle); > /** > + * Garbage collects nodes that have been marked /omit-if-no-ref/ and do not > + * have any references to them from nodes that are similarly marked. This > + * is a fairly expensive operation. The return value indicates whether the > + * tree has been dirtied as a result of this operation, so that the caller > + * may take appropriate measures to bring the device tree into a consistent > + * state as needed. > + */ > + bool garbage_collect_marked_nodes(); > + /** > * Parses a dts file in the given buffer and adds the roots to the parsed > * set. The `read_header` argument indicates whether the header has > * already been read. Some dts files place the header in an include, > @@ -931,6 +973,14 @@ class device_tree > inline bool is_valid() > { > return valid; > + } > + /** > + * Mark this tree as needing garbage collection, because an /omit-if-no-ref/ > + * node has been encountered. > + */ > + void set_needs_garbage_collection() > + { > + garbage_collect = true; > } > /** > * Sets the format for writing phandle properties. > > Modified: stable/12/usr.bin/dtc/input_buffer.cc > ============================================================================== > --- stable/12/usr.bin/dtc/input_buffer.cc Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/input_buffer.cc Thu Apr 4 17:26:35 2019 (r345880) > @@ -126,7 +126,7 @@ mmap_input_buffer::~mmap_input_buffer() > { > if (buffer != 0) > { > - munmap((void*)buffer, size); > + munmap(const_cast(buffer), size); > } > } > > > Modified: stable/12/usr.bin/dtc/util.hh > ============================================================================== > --- stable/12/usr.bin/dtc/util.hh Thu Apr 4 17:24:57 2019 (r345879) > +++ stable/12/usr.bin/dtc/util.hh Thu Apr 4 17:26:35 2019 (r345880) > @@ -47,6 +47,38 @@ > #endif > #endif > > +#ifdef MISSING_DIGITTOINT > +namespace > +{ > + /** > + * Glibc doesn't have a definition of digittoint, so provide our own. > + */ > + inline int digittoint(int c) > + { > + switch (c) > + { > + default: > + case '0': return 0; > + case '1': return 1; > + case '2': return 2; > + case '3': return 3; > + case '4': return 4; > + case '5': return 5; > + case '6': return 6; > + case '7': return 7; > + case '8': return 8; > + case '9': return 9; > + case 'a': return 10; > + case 'b': return 11; > + case 'c': return 12; > + case 'd': return 13; > + case 'e': return 14; > + case 'f': return 15; > + } > + } > +} > +#endif > + > namespace dtc { > > /** > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-12@freebsd.org Fri Apr 5 01:22:31 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923F51564398; Fri, 5 Apr 2019 01:22:31 +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) server-signature RSA-PSS (4096 bits) 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 342B86F503; Fri, 5 Apr 2019 01:22:31 +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 0F67B5F57; Fri, 5 Apr 2019 01:22:31 +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 x351MU0E088526; Fri, 5 Apr 2019 01:22:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x351MUD2088523; Fri, 5 Apr 2019 01:22:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904050122.x351MUD2088523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 5 Apr 2019 01:22:30 +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: r345899 - in stable/12: libexec/rc libexec/rc/rc.d tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12: libexec/rc libexec/rc/rc.d tools/build/mk X-SVN-Commit-Revision: 345899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 342B86F503 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 01:22:31 -0000 Author: cy Date: Fri Apr 5 01:22:30 2019 New Revision: 345899 URL: https://svnweb.freebsd.org/changeset/base/345899 Log: MFC r345400-345401,345403,345412,345437: Add rc.d support for ippool(8). I've been using ippool at my site for approximately two years. It's about time this was committed. PR: 218433 Added: stable/12/libexec/rc/rc.d/ippool - copied, changed from r345400, head/libexec/rc/rc.d/ippool Modified: stable/12/libexec/rc/rc.conf stable/12/libexec/rc/rc.d/Makefile stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Thu Apr 4 23:40:30 2019 (r345898) +++ stable/12/libexec/rc/rc.conf Fri Apr 5 01:22:30 2019 (r345899) @@ -196,6 +196,10 @@ ipfilter_program="/sbin/ipf" # where the ipfilter prog ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see # /usr/src/contrib/ipfilter/rules for examples ipfilter_flags="" # additional flags for ipfilter +ippool_enable="NO" # Set to YES to enable ip filter pools +ippool_program="/sbin/ippool" # where the ippool program lives +ippool_rules="/etc/ippool.tables" # rules definition file for ippool +ippool_flags="" # additional flags for ippool ipnat_enable="NO" # Set to YES to enable ipnat functionality ipnat_program="/sbin/ipnat" # where the ipnat program lives ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat Modified: stable/12/libexec/rc/rc.d/Makefile ============================================================================== --- stable/12/libexec/rc/rc.d/Makefile Thu Apr 4 23:40:30 2019 (r345898) +++ stable/12/libexec/rc/rc.d/Makefile Fri Apr 5 01:22:30 2019 (r345899) @@ -215,7 +215,8 @@ CONFS+= inetd CONFS+= ipfilter \ ipfs \ ipmon \ - ipnat + ipnat \ + ippool .endif .if ${MK_IPFW} != "no" Copied and modified: stable/12/libexec/rc/rc.d/ippool (from r345400, head/libexec/rc/rc.d/ippool) ============================================================================== --- head/libexec/rc/rc.d/ippool Fri Mar 22 01:30:51 2019 (r345400, copy source) +++ stable/12/libexec/rc/rc.d/ippool Fri Apr 5 01:22:30 2019 (r345899) @@ -14,26 +14,23 @@ name="ippool" desc="user interface to the IPFilter pools" rcvar="ippool_enable" load_rc_config $name -start_cmd="ippool_start" +start_precmd="ippool_start_precmd" stop_cmd="${ippool_program} -F" reload_cmd="ippool_reload" extra_commands="reload" required_files="${ippool_rules}" required_modules="ipl:ipfilter" -ippool_start() +ippool_start_precmd() { - if [ -r "${ippool_rules}" ]; then - echo "Loading IP Pools." - ${ippool_program} -f ${ippool_rules} ${ippool_flags} - fi + rc_flags="-f ${ippool_rules} ${rc_flags}" } ippool_reload() { echo "Reloading IP Pools." - ${ippool_program} -F - ippool_start + ${stop_cmd} + ${start_cmd} } Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Apr 4 23:40:30 2019 (r345898) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Fri Apr 5 01:22:30 2019 (r345899) @@ -3128,6 +3128,7 @@ OLD_FILES+=etc/rc.d/ipfilter OLD_FILES+=etc/rc.d/ipfs OLD_FILES+=etc/rc.d/ipmon OLD_FILES+=etc/rc.d/ipnat +OLD_FILES+=etc/rc.d/ippool OLD_FILES+=rescue/ipf OLD_FILES+=sbin/ipf OLD_FILES+=sbin/ipfs From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:06:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2991571CEB; Fri, 5 Apr 2019 11:06: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) server-signature RSA-PSS (4096 bits) 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 ADBA589728; Fri, 5 Apr 2019 11:06: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 86DFDC3BE; Fri, 5 Apr 2019 11:06: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 x35B6FFG096157; Fri, 5 Apr 2019 11:06:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35B6Fhg096156; Fri, 5 Apr 2019 11:06:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051106.x35B6Fhg096156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:06: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: r345908 - 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: 345908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADBA589728 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:06:16 -0000 Author: hselasky Date: Fri Apr 5 11:06:15 2019 New Revision: 345908 URL: https://svnweb.freebsd.org/changeset/base/345908 Log: MFC r345090: Implement dma_set_mask_and_coherent() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Apr 5 11:05:55 2019 (r345907) +++ stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Apr 5 11:06:15 2019 (r345908) @@ -119,6 +119,17 @@ dma_set_coherent_mask(struct device *dev, u64 mask) return 0; } +static inline int +dma_set_mask_and_coherent(struct device *dev, u64 mask) +{ + int r; + + r = dma_set_mask(dev, mask); + if (r == 0) + dma_set_coherent_mask(dev, mask); + return (r); +} + static inline void * dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:07:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD96F1571D62; Fri, 5 Apr 2019 11:07: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) server-signature RSA-PSS (4096 bits) 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 508D389875; Fri, 5 Apr 2019 11:07: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 2B415C3BF; Fri, 5 Apr 2019 11:07: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 x35B7F7Z096270; Fri, 5 Apr 2019 11:07:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35B7FqV096269; Fri, 5 Apr 2019 11:07:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051107.x35B7FqV096269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:07: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: r345909 - 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: 345909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 508D389875 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:07:16 -0000 Author: hselasky Date: Fri Apr 5 11:07:15 2019 New Revision: 345909 URL: https://svnweb.freebsd.org/changeset/base/345909 Log: MFC r345091: Implement dev_err_once() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/device.h Fri Apr 5 11:06:15 2019 (r345908) +++ stable/12/sys/compat/linuxkpi/common/include/linux/device.h Fri Apr 5 11:07:15 2019 (r345909) @@ -183,6 +183,14 @@ show_class_attr_string(struct class *class, #define dev_printk(lvl, dev, fmt, ...) \ device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_err_once(dev, ...) do { \ + static bool __dev_err_once; \ + if (!__dev_err_once) { \ + __dev_err_once = 1; \ + dev_err(dev, __VA_ARGS__); \ + } \ +} while (0) + #define dev_err_ratelimited(dev, ...) do { \ static linux_ratelimit_t __ratelimited; \ if (linux_ratelimited(&__ratelimited)) \ From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:08:51 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0713F1571EEB; Fri, 5 Apr 2019 11:08:51 +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) server-signature RSA-PSS (4096 bits) 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 9EFB189C02; Fri, 5 Apr 2019 11:08: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 7B35AC3C2; Fri, 5 Apr 2019 11:08: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 x35B8oiJ096500; Fri, 5 Apr 2019 11:08:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35B8olu096499; Fri, 5 Apr 2019 11:08:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051108.x35B8olu096499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:08:50 +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: r345912 - 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: 345912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9EFB189C02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:08:51 -0000 Author: hselasky Date: Fri Apr 5 11:08:50 2019 New Revision: 345912 URL: https://svnweb.freebsd.org/changeset/base/345912 Log: MFC r345092: Properly define the DMA attribute values in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-attrs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-attrs.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/dma-attrs.h Fri Apr 5 11:08:35 2019 (r345911) +++ stable/12/sys/compat/linuxkpi/common/include/linux/dma-attrs.h Fri Apr 5 11:08:50 2019 (r345912) @@ -31,9 +31,16 @@ #ifndef _LINUX_DMA_ATTR_H_ #define _LINUX_DMA_ATTR_H_ -enum dma_attr { DMA_ATTR_WRITE_BARRIER, DMA_ATTR_WEAK_ORDERING, DMA_ATTR_MAX, }; - -#define __DMA_ATTRS_LONGS BITS_TO_LONGS(DMA_ATTR_MAX) +#define DMA_ATTR_WRITE_BARRIER (1 << 0) +#define DMA_ATTR_WEAK_ORDERING (1 << 1) +#define DMA_ATTR_WRITE_COMBINE (1 << 2) +#define DMA_ATTR_NON_CONSISTENT (1 << 3) +#define DMA_ATTR_NO_KERNEL_MAPPING (1 << 4) +#define DMA_ATTR_SKIP_CPU_SYNC (1 << 5) +#define DMA_ATTR_FORCE_CONTIGUOUS (1 << 6) +#define DMA_ATTR_ALLOC_SINGLE_PAGES (1 << 7) +#define DMA_ATTR_NO_WARN (1 << 8) +#define DMA_ATTR_PRIVILEGED (1 << 9) struct dma_attrs { unsigned long flags; From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:10:10 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A331571FB7; Fri, 5 Apr 2019 11:10: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) server-signature RSA-PSS (4096 bits) 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 EDDF489D97; Fri, 5 Apr 2019 11:10: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 C7CCDC3C6; Fri, 5 Apr 2019 11:10: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 x35BA9hZ096658; Fri, 5 Apr 2019 11:10:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BA9Ah096657; Fri, 5 Apr 2019 11:10:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051110.x35BA9Ah096657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:10:09 +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: r345913 - 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: 345913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDDF489D97 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:10:10 -0000 Author: hselasky Date: Fri Apr 5 11:10:09 2019 New Revision: 345913 URL: https://svnweb.freebsd.org/changeset/base/345913 Log: MFC r345093: Implement BITS_PER_TYPE() function macro in the LinuxKPI. Fix some style while at it. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Fri Apr 5 11:08:50 2019 (r345912) +++ stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Fri Apr 5 11:10:09 2019 (r345913) @@ -51,10 +51,11 @@ #define BITMAP_LAST_WORD_MASK(n) (~0UL >> (BITS_PER_LONG - (n))) #define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) #define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1))) -#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l))) #define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l))) -#define BITS_PER_BYTE 8 +#define BITS_PER_BYTE 8 +#define BITS_PER_TYPE(t) (sizeof(t) * BITS_PER_BYTE) #define hweight8(x) bitcount((uint8_t)(x)) #define hweight16(x) bitcount16(x) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:11:21 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C638815722D4; Fri, 5 Apr 2019 11:11: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) server-signature RSA-PSS (4096 bits) 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 65C138A18A; Fri, 5 Apr 2019 11:11: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 40328C3FC; Fri, 5 Apr 2019 11:11: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 x35BBLoF000718; Fri, 5 Apr 2019 11:11:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BBLJY000717; Fri, 5 Apr 2019 11:11:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051111.x35BBLJY000717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:11: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: r345915 - 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: 345915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65C138A18A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:11:22 -0000 Author: hselasky Date: Fri Apr 5 11:11:20 2019 New Revision: 345915 URL: https://svnweb.freebsd.org/changeset/base/345915 Log: MFC r345094: Implement DEFINE_STATIC_SRCU() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Fri Apr 5 11:10:27 2019 (r345914) +++ stable/12/sys/compat/linuxkpi/common/include/linux/srcu.h Fri Apr 5 11:11:20 2019 (r345915) @@ -34,6 +34,9 @@ struct srcu_struct { #define srcu_dereference(ptr,srcu) ((__typeof(*(ptr)) *)(ptr)) +#define DEFINE_STATIC_SRCU(name) \ + static struct srcu_struct name = {} + /* prototypes */ extern int srcu_read_lock(struct srcu_struct *); From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:14:28 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB3615725A0; Fri, 5 Apr 2019 11:14: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) server-signature RSA-PSS (4096 bits) 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 010288A8C5; Fri, 5 Apr 2019 11:14: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 CFB24C569; Fri, 5 Apr 2019 11:14: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 x35BERMN001751; Fri, 5 Apr 2019 11:14:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BER9Q001750; Fri, 5 Apr 2019 11:14:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051114.x35BER9Q001750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:14:27 +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: r345918 - 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: 345918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 010288A8C5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:14:28 -0000 Author: hselasky Date: Fri Apr 5 11:14:27 2019 New Revision: 345918 URL: https://svnweb.freebsd.org/changeset/base/345918 Log: MFC r345095 and r345110: Implement ida_free() and ida_alloc_max() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/idr.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Fri Apr 5 11:14:01 2019 (r345917) +++ stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Fri Apr 5 11:14:27 2019 (r345918) @@ -119,11 +119,25 @@ int ida_simple_get(struct ida *ida, unsigned int start gfp_t gfp_mask); void ida_simple_remove(struct ida *ida, unsigned int id); +static inline void +ida_free(struct ida *ida, int id) +{ + + ida_remove(ida, id); +} + static inline int ida_get_new(struct ida *ida, int *p_id) { return (ida_get_new_above(ida, 0, p_id)); +} + +static inline int +ida_alloc_max(struct ida *ida, unsigned int max, gfp_t gfp) +{ + + return (ida_simple_get(ida, 0, max, gfp)); } static inline bool From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:15:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D0241572712; Fri, 5 Apr 2019 11:15:49 +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) server-signature RSA-PSS (4096 bits) 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 00B7D8AA53; Fri, 5 Apr 2019 11:15:49 +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 CE6B4C56A; Fri, 5 Apr 2019 11:15: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 x35BFmjA001886; Fri, 5 Apr 2019 11:15:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BFmbu001885; Fri, 5 Apr 2019 11:15:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051115.x35BFmbu001885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:15:48 +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: r345919 - 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: 345919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00B7D8AA53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:15:49 -0000 Author: hselasky Date: Fri Apr 5 11:15:48 2019 New Revision: 345919 URL: https://svnweb.freebsd.org/changeset/base/345919 Log: MFC r345096: Implement dma_map_page_attrs() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Apr 5 11:14:27 2019 (r345918) +++ stable/12/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Apr 5 11:15:48 2019 (r345919) @@ -185,6 +185,14 @@ dma_unmap_single_attrs(struct device *dev, dma_addr_t { } +static inline dma_addr_t +dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, + size_t size, enum dma_data_direction dir, unsigned long attrs) +{ + + return (VM_PAGE_TO_PHYS(page) + offset); +} + static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:17:13 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A23891572AF4; Fri, 5 Apr 2019 11:17:13 +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) server-signature RSA-PSS (4096 bits) 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 461188AE44; Fri, 5 Apr 2019 11:17:13 +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 20FB7C56D; Fri, 5 Apr 2019 11:17:13 +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 x35BHC9g002062; Fri, 5 Apr 2019 11:17:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BHCYp002061; Fri, 5 Apr 2019 11:17:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051117.x35BHCYp002061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:17: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: r345921 - 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: 345921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 461188AE44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:17:13 -0000 Author: hselasky Date: Fri Apr 5 11:17:12 2019 New Revision: 345921 URL: https://svnweb.freebsd.org/changeset/base/345921 Log: MFC r345097: Implement list_for_each_entry_from_reverse() and list_bulk_move_tail() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/list.h Fri Apr 5 11:16:06 2019 (r345920) +++ stable/12/sys/compat/linuxkpi/common/include/linux/list.h Fri Apr 5 11:17:12 2019 (r345921) @@ -228,6 +228,10 @@ list_del_init(struct list_head *entry) #define list_for_each_prev(p, h) for (p = (h)->prev; p != (h); p = (p)->prev) +#define list_for_each_entry_from_reverse(p, h, field) \ + for (; &p->field != (h); \ + p = list_prev_entry(p, field)) + static inline void list_add(struct list_head *new, struct list_head *head) { @@ -256,6 +260,18 @@ list_move_tail(struct list_head *entry, struct list_he list_del(entry); list_add_tail(entry, head); +} + +static inline void +list_bulk_move_tail(struct list_head *head, struct list_head *first, + struct list_head *last) +{ + first->prev->next = last->next; + last->next->prev = first->prev; + head->prev->next = first; + first->prev = head->prev; + last->next = head; + head->prev = last; } static inline void From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:19:09 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 637C61572C20; Fri, 5 Apr 2019 11:19: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) server-signature RSA-PSS (4096 bits) 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 D62D58B0E9; Fri, 5 Apr 2019 11:19:08 +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 AB612C56F; Fri, 5 Apr 2019 11:19: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 x35BJ8fV002258; Fri, 5 Apr 2019 11:19:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BJ84O002256; Fri, 5 Apr 2019 11:19:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051119.x35BJ84O002256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:19: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: r345923 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 345923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D62D58B0E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:19:09 -0000 Author: hselasky Date: Fri Apr 5 11:19:07 2019 New Revision: 345923 URL: https://svnweb.freebsd.org/changeset/base/345923 Log: MFC r345098: Implement current_exiting() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h stable/12/sys/compat/linuxkpi/common/src/linux_current.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:17:27 2019 (r345922) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:19:07 2019 (r345923) @@ -143,6 +143,11 @@ linux_schedule_save_interrupt_value(struct task_struct task->bsd_interrupt_value = value; } +bool linux_task_exiting(struct task_struct *task); + +#define current_exiting() \ + linux_task_exiting(current) + static inline int linux_schedule_get_interrupt_value(struct task_struct *task) { Modified: stable/12/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_current.c Fri Apr 5 11:17:27 2019 (r345922) +++ stable/12/sys/compat/linuxkpi/common/src/linux_current.c Fri Apr 5 11:19:07 2019 (r345923) @@ -215,6 +215,22 @@ linux_get_pid_task(pid_t pid) return (NULL); } +bool +linux_task_exiting(struct task_struct *task) +{ + struct proc *p; + bool ret; + + ret = false; + p = pfind(task->pid); + if (p != NULL) { + if ((p->p_flag & P_WEXIT) != 0) + ret = true; + PROC_UNLOCK(p); + } + return (ret); +} + static void linux_current_init(void *arg __unused) { From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:20:45 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B94221572E43; Fri, 5 Apr 2019 11:20:45 +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) server-signature RSA-PSS (4096 bits) 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 5EEA48B411; Fri, 5 Apr 2019 11:20:45 +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 3EF0AC587; Fri, 5 Apr 2019 11:20:45 +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 x35BKjNx002500; Fri, 5 Apr 2019 11:20:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BKjAL002495; Fri, 5 Apr 2019 11:20:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051120.x35BKjAL002495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:20:45 +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: r345925 - 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: 345925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EEA48B411 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:20:45 -0000 Author: hselasky Date: Fri Apr 5 11:20:44 2019 New Revision: 345925 URL: https://svnweb.freebsd.org/changeset/base/345925 Log: MFC r345099: Implement get_task_comm() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:19:23 2019 (r345924) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:20:44 2019 (r345925) @@ -183,4 +183,12 @@ local_clock(void) return ((uint64_t)ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec); } +static inline const char * +get_task_comm(char *buf, struct task_struct *task) +{ + + buf[0] = 0; /* buffer is too small */ + return (task->comm); +} + #endif /* _LINUX_SCHED_H_ */ From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:24:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429F415731F1; Fri, 5 Apr 2019 11:24: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) server-signature RSA-PSS (4096 bits) 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 DB5B88BA33; Fri, 5 Apr 2019 11:24: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 19B5AC72A; Fri, 5 Apr 2019 11:24: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 x35BOEVI007734; Fri, 5 Apr 2019 11:24:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BOE15007733; Fri, 5 Apr 2019 11:24:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051124.x35BOE15007733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:24: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: r345928 - in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 345928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DB5B88BA33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:24:16 -0000 Author: hselasky Date: Fri Apr 5 11:24:14 2019 New Revision: 345928 URL: https://svnweb.freebsd.org/changeset/base/345928 Log: MFC r345101: Implement si_meminfo() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm.h stable/12/sys/compat/linuxkpi/common/src/linux_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mm.h Fri Apr 5 11:24:05 2019 (r345927) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mm.h Fri Apr 5 11:24:14 2019 (r345928) @@ -134,6 +134,12 @@ struct vm_operations_struct { int (*access) (struct vm_area_struct *, unsigned long, void *, int, int); }; +struct sysinfo { + uint64_t totalram; + uint64_t totalhigh; + uint32_t mem_unit; +}; + /* * Compute log2 of the power of two rounded up count of pages * needed for size bytes. @@ -268,5 +274,6 @@ vmalloc_to_page(const void *addr) } extern int is_vmalloc_addr(const void *addr); +void si_meminfo(struct sysinfo *si); #endif /* _LINUX_MM_H_ */ Modified: stable/12/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_page.c Fri Apr 5 11:24:05 2019 (r345927) +++ stable/12/sys/compat/linuxkpi/common/src/linux_page.c Fri Apr 5 11:24:14 2019 (r345928) @@ -63,6 +63,14 @@ __FBSDID("$FreeBSD$"); #include #include +void +si_meminfo(struct sysinfo *si) +{ + si->totalram = physmem; + si->totalhigh = 0; + si->mem_unit = PAGE_SIZE; +} + void * linux_page_address(struct page *page) { From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:26:19 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EB5D15732DB; Fri, 5 Apr 2019 11:26:19 +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) server-signature RSA-PSS (4096 bits) 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 430898BC15; Fri, 5 Apr 2019 11:26:19 +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 1A313C72C; Fri, 5 Apr 2019 11:26:19 +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 x35BQIqF007892; Fri, 5 Apr 2019 11:26:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BQIUi007891; Fri, 5 Apr 2019 11:26:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051126.x35BQIUi007891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:26:18 +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: r345929 - 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: 345929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 430898BC15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:26:19 -0000 Author: hselasky Date: Fri Apr 5 11:26:18 2019 New Revision: 345929 URL: https://svnweb.freebsd.org/changeset/base/345929 Log: MFC r345104: Implement more malloc function macros in the LinuxKPI. Fix arguments for currently unused kvmalloc(). Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Fri Apr 5 11:24:14 2019 (r345928) +++ stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Fri Apr 5 11:26:18 2019 (r345929) @@ -42,7 +42,9 @@ MALLOC_DECLARE(M_KMALLOC); -#define kvmalloc(size) kmalloc(size, 0) +#define kvmalloc(size, flags) kmalloc(size, flags) +#define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) +#define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc(size, (flags) | __GFP_ZERO) #define kfree_const(ptr) kfree(ptr) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:27:49 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D75C1573429; Fri, 5 Apr 2019 11:27:49 +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) server-signature RSA-PSS (4096 bits) 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 34ECF8BF8B; Fri, 5 Apr 2019 11:27:49 +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 0FCDDC731; Fri, 5 Apr 2019 11:27:49 +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 x35BRmAf008116; Fri, 5 Apr 2019 11:27:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BRm4d008115; Fri, 5 Apr 2019 11:27:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051127.x35BRm4d008115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:27:48 +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: r345932 - 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: 345932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34ECF8BF8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:27:49 -0000 Author: hselasky Date: Fri Apr 5 11:27:48 2019 New Revision: 345932 URL: https://svnweb.freebsd.org/changeset/base/345932 Log: MFC r345105: Honor SYSCTL function return values when creating sysfs nodes in the LinuxKPI. Return proper error code upon failure. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Fri Apr 5 11:27:35 2019 (r345931) +++ stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h Fri Apr 5 11:27:48 2019 (r345932) @@ -132,10 +132,14 @@ out: static inline int sysfs_create_file(struct kobject *kobj, const struct attribute *attr) { + struct sysctl_oid *oid; - SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO, + oid = SYSCTL_ADD_OID(NULL, SYSCTL_CHILDREN(kobj->oidp), OID_AUTO, attr->name, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_MPSAFE, kobj, (uintptr_t)attr, sysctl_handle_attr, "A", ""); + if (!oid) { + return (-ENOMEM); + } return (0); } @@ -176,9 +180,14 @@ sysfs_create_group(struct kobject *kobj, const struct static inline int sysfs_create_dir(struct kobject *kobj) { + struct sysctl_oid *oid; - kobj->oidp = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->parent->oidp), + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(kobj->parent->oidp), OID_AUTO, kobj->name, CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, kobj->name); + if (!oid) { + return (-ENOMEM); + } + kobj->oidp = oid; return (0); } From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:28:51 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05B0D15734C1; Fri, 5 Apr 2019 11:28:51 +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) server-signature RSA-PSS (4096 bits) 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 9E1848C105; Fri, 5 Apr 2019 11:28: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 783CDC733; Fri, 5 Apr 2019 11:28: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 x35BSo64008238; Fri, 5 Apr 2019 11:28:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BSoaI008237; Fri, 5 Apr 2019 11:28:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051128.x35BSoaI008237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:28:50 +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: r345933 - 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: 345933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E1848C105 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:28:51 -0000 Author: hselasky Date: Fri Apr 5 11:28:50 2019 New Revision: 345933 URL: https://svnweb.freebsd.org/changeset/base/345933 Log: MFC r345106: Define some RCU debug macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h Fri Apr 5 11:27:48 2019 (r345932) +++ stable/12/sys/compat/linuxkpi/common/include/linux/rcupdate.h Fri Apr 5 11:28:50 2019 (r345933) @@ -100,4 +100,10 @@ extern void linux_rcu_read_lock(void); extern void linux_rcu_read_unlock(void); extern void linux_synchronize_rcu(void); +/* Empty implementation for !DEBUG */ +#define init_rcu_head(...) +#define destroy_rcu_head(...) +#define init_rcu_head_on_stack(...) +#define destroy_rcu_head_on_stack(...) + #endif /* _LINUX_RCUPDATE_H_ */ From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:30:14 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64DED15735DA; Fri, 5 Apr 2019 11:30: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) server-signature RSA-PSS (4096 bits) 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 0A1848C38C; Fri, 5 Apr 2019 11:30: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 D8495C739; Fri, 5 Apr 2019 11:30:13 +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 x35BUDAG008442; Fri, 5 Apr 2019 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BUDpg008441; Fri, 5 Apr 2019 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051130.x35BUDpg008441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:30: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: r345935 - 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: 345935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A1848C38C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:30:14 -0000 Author: hselasky Date: Fri Apr 5 11:30:13 2019 New Revision: 345935 URL: https://svnweb.freebsd.org/changeset/base/345935 Log: MFC r345107: Implement pr_info_ratelimited() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/printk.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/printk.h Fri Apr 5 11:29:05 2019 (r345934) +++ stable/12/sys/compat/linuxkpi/common/include/linux/printk.h Fri Apr 5 11:30:13 2019 (r345935) @@ -121,4 +121,7 @@ print_hex_dump_bytes(const char *prefix_str, const int #define pr_err_ratelimited(fmt, ...) \ printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#define pr_info_ratelimited(fmt, ...) \ + printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) + #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:31:38 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD501573808; Fri, 5 Apr 2019 11:31:38 +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) server-signature RSA-PSS (4096 bits) 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 9CA638C7CE; Fri, 5 Apr 2019 11:31:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7832FC894; Fri, 5 Apr 2019 11:31:37 +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 x35BVb5E010256; Fri, 5 Apr 2019 11:31:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BVbYH010255; Fri, 5 Apr 2019 11:31:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051131.x35BVbYH010255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:31: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: r345937 - 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: 345937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CA638C7CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:31:38 -0000 Author: hselasky Date: Fri Apr 5 11:31:37 2019 New Revision: 345937 URL: https://svnweb.freebsd.org/changeset/base/345937 Log: MFC r345108: Define SG_CHAIN and SG_END in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Fri Apr 5 11:30:27 2019 (r345936) +++ stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Fri Apr 5 11:31:37 2019 (r345937) @@ -69,6 +69,8 @@ struct sg_page_iter { #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) #define SG_MAGIC 0x87654321UL +#define SG_CHAIN SG_PAGE_LINK_CHAIN +#define SG_END SG_PAGE_LINK_LAST #define sg_is_chain(sg) ((sg)->page_link & SG_PAGE_LINK_CHAIN) #define sg_is_last(sg) ((sg)->page_link & SG_PAGE_LINK_LAST) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:33:12 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA5B1573979; Fri, 5 Apr 2019 11: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) server-signature RSA-PSS (4096 bits) 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 E58698CC23; Fri, 5 Apr 2019 11:33:11 +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 C148FC8DB; Fri, 5 Apr 2019 11:33:11 +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 x35BXBm2013467; Fri, 5 Apr 2019 11:33:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BXBql013466; Fri, 5 Apr 2019 11:33:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051133.x35BXBql013466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:33:11 +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: r345940 - 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: 345940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E58698CC23 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:33:12 -0000 Author: hselasky Date: Fri Apr 5 11:33:11 2019 New Revision: 345940 URL: https://svnweb.freebsd.org/changeset/base/345940 Log: MFC r345109: Implement sg_virt() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Fri Apr 5 11:32:57 2019 (r345939) +++ stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Fri Apr 5 11:33:11 2019 (r345940) @@ -137,6 +137,13 @@ sg_phys(struct scatterlist *sg) return (VM_PAGE_TO_PHYS(sg_page(sg)) + sg->offset); } +static inline void * +sg_virt(struct scatterlist *sg) +{ + + return ((void *)((unsigned long)page_address(sg_page(sg)) + sg->offset)); +} + static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, struct scatterlist *sgl) From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:35:03 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F5C11573A8B; Fri, 5 Apr 2019 11:35: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) server-signature RSA-PSS (4096 bits) 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 E4CC48CEEA; Fri, 5 Apr 2019 11:35:02 +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 AD96AC8DD; Fri, 5 Apr 2019 11:35:02 +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 x35BZ2Sv013668; Fri, 5 Apr 2019 11:35:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BZ2C8013667; Fri, 5 Apr 2019 11:35:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051135.x35BZ2C8013667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:35:02 +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: r345942 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 345942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4CC48CEEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:35:03 -0000 Author: hselasky Date: Fri Apr 5 11:35:02 2019 New Revision: 345942 URL: https://svnweb.freebsd.org/changeset/base/345942 Log: MFC r345499: Change all kernel C-type macros into static inline functions. The current kernel C-type macros might obscurely hide the fact that the input argument might be used multiple times. This breaks code like: isalpha(*ptr++) Use static inline functions instead of macros to fix this. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D19694 Sponsored by: Mellanox Technologies Modified: stable/12/sys/sys/ctype.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/ctype.h ============================================================================== --- stable/12/sys/sys/ctype.h Fri Apr 5 11:34:13 2019 (r345941) +++ stable/12/sys/sys/ctype.h Fri Apr 5 11:35:02 2019 (r345942) @@ -41,19 +41,65 @@ #ifdef _KERNEL -#define isspace(c) ((c) == ' ' || ((c) >= '\t' && (c) <= '\r')) -#define isascii(c) (((c) & ~0x7f) == 0) -#define isupper(c) ((c) >= 'A' && (c) <= 'Z') -#define islower(c) ((c) >= 'a' && (c) <= 'z') -#define isalpha(c) (isupper(c) || islower(c)) -#define isdigit(c) ((c) >= '0' && (c) <= '9') -#define isxdigit(c) (isdigit(c) \ - || ((c) >= 'A' && (c) <= 'F') \ - || ((c) >= 'a' && (c) <= 'f')) -#define isprint(c) ((c) >= ' ' && (c) <= '~') +static __inline int +isspace(int c) +{ + return (c == ' ' || (c >= '\t' && c <= '\r')); +} -#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z'))) -#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) +static __inline int +isascii(int c) +{ + return ((c & ~0x7f) == 0); +} + +static __inline int +isupper(int c) +{ + return (c >= 'A' && c <= 'Z'); +} + +static __inline int +islower(int c) +{ + return (c >= 'a' && c <= 'z'); +} + +static __inline int +isalpha(int c) +{ + return (isupper(c) || islower(c)); +} + +static __inline int +isdigit(int c) +{ + return (c >= '0' && c <= '9'); +} + +static __inline int +isxdigit(int c) +{ + return (isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); +} + +static __inline int +isprint(int c) +{ + return (c >= ' ' && c <= '~'); +} + +static __inline int +toupper(int c) +{ + return (c - 0x20 * ((c >= 'a') && (c <= 'z'))); +} + +static __inline int +tolower(int c) +{ + return (c + 0x20 * ((c >= 'A') && (c <= 'Z'))); +} #endif #endif /* !_SYS_CTYPE_H_ */ From owner-svn-src-stable-12@freebsd.org Fri Apr 5 11:38:35 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E7E61573D24; Fri, 5 Apr 2019 11:38: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) server-signature RSA-PSS (4096 bits) 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 20C8F8D3C0; Fri, 5 Apr 2019 11:38: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 EF4B9C8E1; Fri, 5 Apr 2019 11:38:34 +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 x35BcYBq013986; Fri, 5 Apr 2019 11:38:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35BcYE5013985; Fri, 5 Apr 2019 11:38:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904051138.x35BcYE5013985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Apr 2019 11:38: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: r345945 - stable/12/sys/dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/controller X-SVN-Commit-Revision: 345945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20C8F8D3C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 11:38:35 -0000 Author: hselasky Date: Fri Apr 5 11:38:34 2019 New Revision: 345945 URL: https://svnweb.freebsd.org/changeset/base/345945 Log: MFC r345633: Add new USB PCI ID. Submitted by: Dmitry Luhtionov Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/12/sys/dev/usb/controller/xhci_pci.c Fri Apr 5 11:37:17 2019 (r345944) +++ stable/12/sys/dev/usb/controller/xhci_pci.c Fri Apr 5 11:38:34 2019 (r345945) @@ -149,6 +149,8 @@ xhci_pci_match(device_t self) return ("Intel Lewisburg USB 3.0 controller"); case 0xa2af8086: return ("Intel Union Point USB 3.0 controller"); + case 0x36d88086: + return ("Intel Cannon Lake USB 3.1 controller"); case 0xa01b177d: return ("Cavium ThunderX USB 3.0 controller"); From owner-svn-src-stable-12@freebsd.org Fri Apr 5 16:09:24 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E64915315AB; Fri, 5 Apr 2019 16:09:24 +0000 (UTC) (envelope-from dim@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) server-signature RSA-PSS (4096 bits) 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 2428197E95; Fri, 5 Apr 2019 16:09:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1A5FF68F; Fri, 5 Apr 2019 16:09:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35G9NrQ080060; Fri, 5 Apr 2019 16:09:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35G9N20080059; Fri, 5 Apr 2019 16:09:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201904051609.x35G9N20080059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 5 Apr 2019 16:09:23 +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: r345952 - in stable: 11/contrib/llvm/tools/clang/lib/CodeGen 12/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/tools/clang/lib/CodeGen 12/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Commit-Revision: 345952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2428197E95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 16:09:24 -0000 Author: dim Date: Fri Apr 5 16:09:23 2019 New Revision: 345952 URL: https://svnweb.freebsd.org/changeset/base/345952 Log: MFC r345806: Pull in r357362 from upstream clang trunk (by David Chisnall): [objc-gnustep] Use .init_array not .ctors when requested. This doesn't make a difference most of the time but FreeBSD/ARM doesn't run anything in the .ctors array. This should help with updating the libobjc2 port for armv7. Requested by: theraven Upstream PR: https://github.com/gnustep/libobjc2/issues/83 Modified: stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp ============================================================================== --- stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Fri Apr 5 15:53:27 2019 (r345951) +++ stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Fri Apr 5 16:09:23 2019 (r345952) @@ -1508,7 +1508,12 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { if (CGM.getTriple().isOSBinFormatCOFF()) InitVar->setSection(".CRT$XCLz"); else - InitVar->setSection(".ctors"); + { + if (CGM.getCodeGenOpts().UseInitArray) + InitVar->setSection(".init_array"); + else + InitVar->setSection(".ctors"); + } InitVar->setVisibility(llvm::GlobalValue::HiddenVisibility); InitVar->setComdat(TheModule.getOrInsertComdat(".objc_ctor")); CGM.addUsedGlobal(InitVar); From owner-svn-src-stable-12@freebsd.org Fri Apr 5 16:12:32 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7185153194B; Fri, 5 Apr 2019 16:12:32 +0000 (UTC) (envelope-from dim@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) server-signature RSA-PSS (4096 bits) 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 4BA1F6848C; Fri, 5 Apr 2019 16:12:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E947F848; Fri, 5 Apr 2019 16:12:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35GCW3N085290; Fri, 5 Apr 2019 16:12:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35GCWYN085289; Fri, 5 Apr 2019 16:12:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201904051612.x35GCWYN085289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 5 Apr 2019 16:12: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: r345953 - stable/12/usr.bin/top X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/usr.bin/top X-SVN-Commit-Revision: 345953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BA1F6848C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 16:12:32 -0000 Author: dim Date: Fri Apr 5 16:12:31 2019 New Revision: 345953 URL: https://svnweb.freebsd.org/changeset/base/345953 Log: MFC r345807: Fix regression in top(1) after r344381, causing informational messages to no longer be displayed. This was because the reimplementation of setup_buffer() did not copy the previous contents into any reallocated buffer. Reported by: James Wright PR: 236947 Modified: stable/12/usr.bin/top/display.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/top/display.c ============================================================================== --- stable/12/usr.bin/top/display.c Fri Apr 5 16:09:23 2019 (r345952) +++ stable/12/usr.bin/top/display.c Fri Apr 5 16:12:31 2019 (r345953) @@ -1347,7 +1347,8 @@ i_uptime(struct timeval *bt, time_t *tod) static char * setup_buffer(char *buffer, int addlen) { - size_t len; + size_t len, old_len; + char *new_buffer; setup_buffer_bufsiz = screen_width; if (setup_buffer_bufsiz < SETUPBUFFER_MIN_SCREENWIDTH) @@ -1355,13 +1356,18 @@ setup_buffer(char *buffer, int addlen) setup_buffer_bufsiz = SETUPBUFFER_MIN_SCREENWIDTH; } - free(buffer); len = setup_buffer_bufsiz + addlen + SETUPBUFFER_REQUIRED_ADDBUFSIZ; - buffer = calloc(len, sizeof(char)); - if (buffer == NULL) + new_buffer = calloc(len, sizeof(char)); + if (new_buffer == NULL) { errx(4, "can't allocate sufficient memory"); } + if (buffer != NULL) + { + old_len = strlen(buffer); + memcpy(new_buffer, buffer, old_len < len - 1 ? old_len : len - 1); + free(buffer); + } - return buffer; + return new_buffer; } From owner-svn-src-stable-12@freebsd.org Fri Apr 5 18:17:12 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5C2F1554EB5; Fri, 5 Apr 2019 18:17:12 +0000 (UTC) (envelope-from ygy@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) server-signature RSA-PSS (4096 bits) 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 491096DDD3; Fri, 5 Apr 2019 18:17:12 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1B19818D10; Fri, 5 Apr 2019 18:17:12 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35IHBqP048905; Fri, 5 Apr 2019 18:17:11 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35IHB7n048904; Fri, 5 Apr 2019 18:17:11 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201904051817.x35IHB7n048904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Fri, 5 Apr 2019 18:17:11 +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: r345961 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 345961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 491096DDD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 18:17:12 -0000 Author: ygy (doc committer) Date: Fri Apr 5 18:17:11 2019 New Revision: 345961 URL: https://svnweb.freebsd.org/changeset/base/345961 Log: MFC r345816: Correct SMC definition in asmc(4) man page. PR: 236954 Submitted by: fbsdbugs4@sentry.org Modified: stable/12/share/man/man4/asmc.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/asmc.4 ============================================================================== --- stable/12/share/man/man4/asmc.4 Fri Apr 5 18:09:22 2019 (r345960) +++ stable/12/share/man/man4/asmc.4 Fri Apr 5 18:17:11 2019 (r345961) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2009 +.Dd April 2, 2019 .Dt ASMC 4 .Os .Sh NAME .Nm asmc -.Nd device driver for the Apple System Management Console (SMC) +.Nd device driver for the Apple System Management Controller (SMC) .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: @@ -47,7 +47,7 @@ asmc_load="YES" .Sh DESCRIPTION The .Nm -driver controls the Apple System Management Console (SMC for short) +driver controls the Apple System Management Controller (SMC for short) found on Intel Apple systems. .Pp The SMC is known to be found on the following systems: From owner-svn-src-stable-12@freebsd.org Fri Apr 5 23:34:47 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B82971564045; Fri, 5 Apr 2019 23:34:47 +0000 (UTC) (envelope-from sjg@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) server-signature RSA-PSS (4096 bits) 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 5FB848477C; Fri, 5 Apr 2019 23:34:47 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 385BC1C3CF; Fri, 5 Apr 2019 23:34:47 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35NYl16025761; Fri, 5 Apr 2019 23:34:47 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35NYkXL025757; Fri, 5 Apr 2019 23:34:46 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201904052334.x35NYkXL025757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 5 Apr 2019 23:34:46 +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: r345972 - in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nandfs fs/nfsclient kern ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nandfs fs/nfsclient kern ufs/ufs X-SVN-Commit-Revision: 345972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FB848477C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2019 23:34:48 -0000 Author: sjg Date: Fri Apr 5 23:34:46 2019 New Revision: 345972 URL: https://svnweb.freebsd.org/changeset/base/345972 Log: Add _PC_ACL_* to vop_stdpathconf This avoid EINVAL from tmpfs etc. Merge of r345024 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D19512 Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/12/sys/fs/nandfs/nandfs_vnops.c stable/12/sys/fs/nfsclient/nfs_clvnops.c stable/12/sys/kern/vfs_default.c stable/12/sys/ufs/ufs/ufs_vnops.c Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Apr 5 22:45:43 2019 (r345971) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Apr 5 23:34:46 2019 (r345972) @@ -755,10 +755,6 @@ zfsctl_common_pathconf(ap) *ap->a_retval = (int)SPA_MINBLOCKSIZE; return (0); - case _PC_ACL_EXTENDED: - *ap->a_retval = 0; - return (0); - case _PC_ACL_NFS4: *ap->a_retval = 1; return (0); Modified: stable/12/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/12/sys/fs/nandfs/nandfs_vnops.c Fri Apr 5 22:45:43 2019 (r345971) +++ stable/12/sys/fs/nandfs/nandfs_vnops.c Fri Apr 5 23:34:46 2019 (r345972) @@ -2258,9 +2258,6 @@ nandfs_pathconf(struct vop_pathconf_args *ap) case _PC_NO_TRUNC: *ap->a_retval = 1; break; - case _PC_ACL_EXTENDED: - *ap->a_retval = 0; - break; case _PC_ALLOC_SIZE_MIN: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize; break; Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 5 22:45:43 2019 (r345971) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 5 23:34:46 2019 (r345972) @@ -3485,9 +3485,6 @@ nfs_pathconf(struct vop_pathconf_args *ap) case _PC_NO_TRUNC: *ap->a_retval = pc.pc_notrunc; break; - case _PC_ACL_EXTENDED: - *ap->a_retval = 0; - break; case _PC_ACL_NFS4: if (NFS_ISV4(vp) && nfsrv_useacl != 0 && attrflag != 0 && NFSISSET_ATTRBIT(&nfsva.na_suppattr, NFSATTRBIT_ACL)) @@ -3500,9 +3497,6 @@ nfs_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = ACL_MAX_ENTRIES; else *ap->a_retval = 3; - break; - case _PC_MAC_PRESENT: - *ap->a_retval = 0; break; case _PC_PRIO_IO: *ap->a_retval = 0; Modified: stable/12/sys/kern/vfs_default.c ============================================================================== --- stable/12/sys/kern/vfs_default.c Fri Apr 5 22:45:43 2019 (r345971) +++ stable/12/sys/kern/vfs_default.c Fri Apr 5 23:34:46 2019 (r345972) @@ -482,6 +482,13 @@ vop_stdpathconf(ap) case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; return (0); + case _PC_ACL_EXTENDED: + case _PC_ACL_NFS4: + case _PC_CAP_PRESENT: + case _PC_INF_PRESENT: + case _PC_MAC_PRESENT: + *ap->a_retval = 0; + return (0); default: return (EINVAL); } Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Fri Apr 5 22:45:43 2019 (r345971) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Fri Apr 5 23:34:46 2019 (r345972) @@ -2421,28 +2421,20 @@ ufs_pathconf(ap) case _PC_NO_TRUNC: *ap->a_retval = 1; break; - case _PC_ACL_EXTENDED: #ifdef UFS_ACL + case _PC_ACL_EXTENDED: if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS) *ap->a_retval = 1; else *ap->a_retval = 0; -#else - *ap->a_retval = 0; -#endif break; - case _PC_ACL_NFS4: -#ifdef UFS_ACL if (ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) *ap->a_retval = 1; else *ap->a_retval = 0; -#else - *ap->a_retval = 0; -#endif break; - +#endif case _PC_ACL_PATH_MAX: #ifdef UFS_ACL if (ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) @@ -2453,16 +2445,14 @@ ufs_pathconf(ap) *ap->a_retval = 3; #endif break; - case _PC_MAC_PRESENT: #ifdef MAC + case _PC_MAC_PRESENT: if (ap->a_vp->v_mount->mnt_flag & MNT_MULTILABEL) *ap->a_retval = 1; else *ap->a_retval = 0; -#else - *ap->a_retval = 0; -#endif break; +#endif case _PC_MIN_HOLE_SIZE: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; break;