From owner-svn-src-head@freebsd.org Sun Aug 23 04:16:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E18713B0896; Sun, 23 Aug 2020 04:16:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZ24j5d2Tz4Dvr; Sun, 23 Aug 2020 04:16:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A51B3216A3; Sun, 23 Aug 2020 04:16:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07N4GLXN004603; Sun, 23 Aug 2020 04:16:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07N4GK1F004599; Sun, 23 Aug 2020 04:16:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <202008230416.07N4GK1F004599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 23 Aug 2020 04:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364497 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 364497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 04:16:21 -0000 Author: np Date: Sun Aug 23 04:16:20 2020 New Revision: 364497 URL: https://svnweb.freebsd.org/changeset/base/364497 Log: cxgbe(4): Use large clusters for TOE rx queues when TOE+TLS is enabled. Rx is more efficient within the chip when the receive buffer size matches the TLS PDU size. MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26127 Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sat Aug 22 22:56:50 2020 (r364496) +++ head/sys/dev/cxgbe/common/common.h Sun Aug 23 04:16:20 2020 (r364497) @@ -246,6 +246,8 @@ struct tp_params { uint32_t vlan_pri_map; uint32_t ingress_config; + uint32_t max_rx_pdu; + uint32_t max_tx_pdu; uint64_t hash_filter_mask; __be16 err_vec_mask; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Aug 22 22:56:50 2020 (r364496) +++ head/sys/dev/cxgbe/common/t4_hw.c Sun Aug 23 04:16:20 2020 (r364497) @@ -9614,7 +9614,7 @@ static void read_filter_mode_and_ingress_config(struct int t4_init_tp_params(struct adapter *adap, bool sleep_ok) { int chan; - u32 v; + u32 tx_len, rx_len, r, v; struct tp_params *tpp = &adap->params.tp; v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); @@ -9640,6 +9640,21 @@ int t4_init_tp_params(struct adapter *adap, bool sleep htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC)); } } + + rx_len = t4_read_reg(adap, A_TP_PMM_RX_PAGE_SIZE); + tx_len = t4_read_reg(adap, A_TP_PMM_TX_PAGE_SIZE); + + r = t4_read_reg(adap, A_TP_PARA_REG2); + rx_len = min(rx_len, G_MAXRXDATA(r)); + tx_len = min(tx_len, G_MAXRXDATA(r)); + + r = t4_read_reg(adap, A_TP_PARA_REG7); + v = min(G_PMMAXXFERLEN0(r), G_PMMAXXFERLEN1(r)); + rx_len = min(rx_len, v); + tx_len = min(tx_len, v); + + tpp->max_tx_pdu = tx_len; + tpp->max_rx_pdu = rx_len; return 0; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Aug 22 22:56:50 2020 (r364496) +++ head/sys/dev/cxgbe/t4_main.c Sun Aug 23 04:16:20 2020 (r364497) @@ -736,6 +736,7 @@ static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD +static int sysctl_tls(SYSCTL_HANDLER_ARGS); static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); static int sysctl_tp_dack_timer(SYSCTL_HANDLER_ARGS); @@ -6607,8 +6608,9 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RW, &sc->tt.rx_coalesce, 0, "receive coalescing"); sc->tt.tls = 0; - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tls", CTLFLAG_RW, - &sc->tt.tls, 0, "Inline TLS allowed"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls", CTLTYPE_INT | + CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tls, "I", + "Inline TLS allowed"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, @@ -9699,6 +9701,37 @@ sysctl_cpus(SYSCTL_HANDLER_ARGS) } #ifdef TCP_OFFLOAD +static int +sysctl_tls(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int i, j, v, rc; + struct vi_info *vi; + + v = sc->tt.tls; + rc = sysctl_handle_int(oidp, &v, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (v != 0 && !(sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS)) + return (ENOTSUP); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4stls"); + if (rc) + return (rc); + sc->tt.tls = !!v; + for_each_port(sc, i) { + for_each_vi(sc->port[i], j, vi) { + if (vi->flags & VI_INIT_DONE) + t4_update_fl_bufsize(vi->ifp); + } + } + end_synchronized_op(sc, 0); + + return (0); + +} + static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Aug 22 22:56:50 2020 (r364496) +++ head/sys/dev/cxgbe/t4_sge.c Sun Aug 23 04:16:20 2020 (r364497) @@ -1032,14 +1032,19 @@ t4_teardown_adapter_queues(struct adapter *sc) return (0); } -/* Maximum payload that can be delivered with a single iq descriptor */ +/* Maximum payload that could arrive with a single iq descriptor. */ static inline int -mtu_to_max_payload(struct adapter *sc, int mtu) +max_rx_payload(struct adapter *sc, struct ifnet *ifp, const bool ofld) { + int maxp; /* large enough even when hw VLAN extraction is disabled */ - return (sc->params.sge.fl_pktshift + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN + mtu); + maxp = sc->params.sge.fl_pktshift + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + ifp->if_mtu; + if (ofld && sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS && + maxp < sc->params.tp.max_rx_pdu) + maxp = sc->params.tp.max_rx_pdu; + return (maxp); } int @@ -1065,7 +1070,7 @@ t4_setup_vi_queues(struct vi_info *vi) struct ifnet *ifp = vi->ifp; struct sysctl_oid *oid = device_get_sysctl_tree(vi->dev); struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - int maxp, mtu = ifp->if_mtu; + int maxp; /* Interrupt vector to start from (when using multiple vectors) */ intr_idx = vi->first_intr; @@ -1109,7 +1114,7 @@ t4_setup_vi_queues(struct vi_info *vi) * Allocate rx queues first because a default iqid is required when * creating a tx queue. */ - maxp = mtu_to_max_payload(sc, mtu); + maxp = max_rx_payload(sc, ifp, false); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queues"); for_each_rxq(vi, i, rxq) { @@ -1131,6 +1136,7 @@ t4_setup_vi_queues(struct vi_info *vi) intr_idx = saved_idx + max(vi->nrxq, vi->nnmrxq); #endif #ifdef TCP_OFFLOAD + maxp = max_rx_payload(sc, ifp, true); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queues for offloaded TCP connections"); for_each_ofld_rxq(vi, i, ofld_rxq) { @@ -2144,9 +2150,9 @@ t4_update_fl_bufsize(struct ifnet *ifp) struct sge_ofld_rxq *ofld_rxq; #endif struct sge_fl *fl; - int i, maxp, mtu = ifp->if_mtu; + int i, maxp; - maxp = mtu_to_max_payload(sc, mtu); + maxp = max_rx_payload(sc, ifp, false); for_each_rxq(vi, i, rxq) { fl = &rxq->fl; @@ -2156,6 +2162,7 @@ t4_update_fl_bufsize(struct ifnet *ifp) FL_UNLOCK(fl); } #ifdef TCP_OFFLOAD + maxp = max_rx_payload(sc, ifp, true); for_each_ofld_rxq(vi, i, ofld_rxq) { fl = &ofld_rxq->fl; From owner-svn-src-head@freebsd.org Sun Aug 23 11:05:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CFEF3B9ADA; Sun, 23 Aug 2020 11:05:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZC8l0jrSz4YFZ; Sun, 23 Aug 2020 11:05:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC50925EE7; Sun, 23 Aug 2020 11:05:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NB5QuA055997; Sun, 23 Aug 2020 11:05:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NB5QO0055996; Sun, 23 Aug 2020 11:05:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008231105.07NB5QO0055996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 11:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364499 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 11:05:27 -0000 Author: mjg Date: Sun Aug 23 11:05:26 2020 New Revision: 364499 URL: https://svnweb.freebsd.org/changeset/base/364499 Log: vfs: mark freevnode as noinline Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 23 06:56:28 2020 (r364498) +++ head/sys/kern/vfs_subr.c Sun Aug 23 11:05:26 2020 (r364499) @@ -1756,7 +1756,7 @@ getnewvnode_drop_reserve(void) } } -static void +static void __noinline freevnode(struct vnode *vp) { struct bufobj *bo; From owner-svn-src-head@freebsd.org Sun Aug 23 11:07:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 264BD3B9DD9; Sun, 23 Aug 2020 11:07:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZCBX0HB0z4Y2g; Sun, 23 Aug 2020 11:07:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E12F425EE9; Sun, 23 Aug 2020 11:06:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NB6xxW056111; Sun, 23 Aug 2020 11:06:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NB6xUu056110; Sun, 23 Aug 2020 11:06:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008231106.07NB6xUu056110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 11:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364500 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 364500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 11:07:00 -0000 Author: mjg Date: Sun Aug 23 11:06:59 2020 New Revision: 364500 URL: https://svnweb.freebsd.org/changeset/base/364500 Log: libc: hide alphasort_thunk behind I_AM_SCANDIR_B Should unbreak gcc build as reported by tinderbox: lib/libc/gen/scandir.c:59:12: warning: 'alphasort_thunk' declared 'static' but never defined [-Wunused-function] Modified: head/lib/libc/gen/scandir.c Modified: head/lib/libc/gen/scandir.c ============================================================================== --- head/lib/libc/gen/scandir.c Sun Aug 23 11:05:26 2020 (r364499) +++ head/lib/libc/gen/scandir.c Sun Aug 23 11:06:59 2020 (r364500) @@ -56,7 +56,9 @@ void qsort_b(void *, size_t, size_t, void *); #define SELECT(x) select(x) #endif +#ifndef I_AM_SCANDIR_B static int alphasort_thunk(void *thunk, const void *p1, const void *p2); +#endif int #ifdef I_AM_SCANDIR_B From owner-svn-src-head@freebsd.org Sun Aug 23 19:30:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10B833C5A93; Sun, 23 Aug 2020 19:30:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZQM26khzz427g; Sun, 23 Aug 2020 19:30:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA741C44E; Sun, 23 Aug 2020 19:30:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NJU6bi062850; Sun, 23 Aug 2020 19:30:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NJU6Ug062849; Sun, 23 Aug 2020 19:30:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008231930.07NJU6Ug062849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 23 Aug 2020 19:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364509 - head/sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/drivers/ubt X-SVN-Commit-Revision: 364509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 19:30:07 -0000 Author: markj Date: Sun Aug 23 19:30:06 2020 New Revision: 364509 URL: https://svnweb.freebsd.org/changeset/base/364509 Log: ng_ubt: Add a device ID. PR: 248838 Submitted by: Andrey Zholos MFC after: 1 week Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Sun Aug 23 19:28:09 2020 (r364508) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Sun Aug 23 19:30:06 2020 (r364509) @@ -508,6 +508,7 @@ static const STRUCT_USB_HOST_ID ubt_devs[] = { USB_VPI(USB_VENDOR_LITEON, 0x2003, 0) }, { USB_VPI(USB_VENDOR_FOXCONN, 0xe042, 0) }, { USB_VPI(USB_VENDOR_DELL, 0x8197, 0) }, + { USB_VPI(USB_VENDOR_BELKIN, 0x065a, 0) }, }; /* From owner-svn-src-head@freebsd.org Sun Aug 23 19:43:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F9E53C6B23; Sun, 23 Aug 2020 19:43:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZQfs2PRKz49FD; Sun, 23 Aug 2020 19:43:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E80C98F; Sun, 23 Aug 2020 19:43:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NJhmRC087125; Sun, 23 Aug 2020 19:43:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NJhmcX087123; Sun, 23 Aug 2020 19:43:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008231943.07NJhmcX087123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 19:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364513 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 364513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 19:43:51 -0000 Author: kib Date: Sun Aug 23 19:43:47 2020 New Revision: 364513 URL: https://svnweb.freebsd.org/changeset/base/364513 Log: kern_sharedpage.c: Add exec_sysvec_init_secondary() helper. It allows a sysent to share existing usermode data in shared page with other sysent, assuming ABI differences are not in the layout of the page. Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/kern/kern_sharedpage.c head/sys/sys/sysent.h Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Sun Aug 23 19:42:48 2020 (r364512) +++ head/sys/kern/kern_sharedpage.c Sun Aug 23 19:43:47 2020 (r364513) @@ -288,3 +288,21 @@ exec_sysvec_init(void *param) #endif } } + +void +exec_sysvec_init_secondary(struct sysentvec *sv, struct sysentvec *sv2) +{ + MPASS((sv2->sv_flags & SV_ABI_MASK) == (sv->sv_flags & SV_ABI_MASK)); + MPASS((sv2->sv_flags & SV_TIMEKEEP) == (sv->sv_flags & SV_TIMEKEEP)); + MPASS((sv2->sv_flags & SV_SHP) != 0 && (sv->sv_flags & SV_SHP) != 0); + + sv2->sv_shared_page_obj = sv->sv_shared_page_obj; + sv2->sv_sigcode_base = sv2->sv_shared_page_base + + (sv->sv_sigcode_base - sv->sv_shared_page_base); + if ((sv2->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) + return; + if ((sv2->sv_flags & SV_TIMEKEEP) != 0) { + sv2->sv_timekeep_base = sv2->sv_shared_page_base + + (sv->sv_timekeep_base - sv->sv_shared_page_base); + } +} Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sun Aug 23 19:42:48 2020 (r364512) +++ head/sys/sys/sysent.h Sun Aug 23 19:43:47 2020 (r364513) @@ -321,6 +321,7 @@ int shared_page_alloc(int size, int align); int shared_page_fill(int size, int align, const void *data); void shared_page_write(int base, int size, const void *data); void exec_sysvec_init(void *param); +void exec_sysvec_init_secondary(struct sysentvec *sv, struct sysentvec *sv2); void exec_inittk(void); #define INIT_SYSENTVEC(name, sv) \ From owner-svn-src-head@freebsd.org Sun Aug 23 19:47:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9AE63C6F71; Sun, 23 Aug 2020 19:47:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZQl80tQpz4DbC; Sun, 23 Aug 2020 19:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 776D4C1FA; Sun, 23 Aug 2020 19:47:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NJlSdt092842; Sun, 23 Aug 2020 19:47:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NJlS9u092840; Sun, 23 Aug 2020 19:47:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008231947.07NJlS9u092840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 19:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364517 - in head: sys/sys usr.bin/elfctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: sys/sys usr.bin/elfctl X-SVN-Commit-Revision: 364517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 19:47:35 -0000 Author: kib Date: Sun Aug 23 19:47:27 2020 New Revision: 364517 URL: https://svnweb.freebsd.org/changeset/base/364517 Log: Reserve FreeBSD ELF feature control bit LA48 to control VA layout on amd64. Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/sys/elf_common.h head/usr.bin/elfctl/elfctl.c Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun Aug 23 19:47:10 2020 (r364516) +++ head/sys/sys/elf_common.h Sun Aug 23 19:47:27 2020 (r364517) @@ -796,6 +796,7 @@ typedef struct { #define NT_FREEBSD_FCTL_PROTMAX_DISABLE 0x00000002 #define NT_FREEBSD_FCTL_STKGAP_DISABLE 0x00000004 #define NT_FREEBSD_FCTL_WXNEEDED 0x00000008 +#define NT_FREEBSD_FCTL_LA48 0x00000010 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ Modified: head/usr.bin/elfctl/elfctl.c ============================================================================== --- head/usr.bin/elfctl/elfctl.c Sun Aug 23 19:47:10 2020 (r364516) +++ head/usr.bin/elfctl/elfctl.c Sun Aug 23 19:47:27 2020 (r364517) @@ -67,6 +67,7 @@ static struct ControlFeatures featurelist[] = { "Disable implicit PROT_MAX" }, { "stackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" }, { "wxneeded", NT_FREEBSD_FCTL_WXNEEDED, "Requires W+X mappings" }, + { "la48", NT_FREEBSD_FCTL_LA48, "amd64: Limit user VA to 48bit" }, }; static struct option long_opts[] = { From owner-svn-src-head@freebsd.org Sun Aug 23 20:05:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF1BE3C8AF0; Sun, 23 Aug 2020 20:05:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZR7l63Jtz4PhF; Sun, 23 Aug 2020 20:05:23 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (c-73-92-37-32.hsd1.ca.comcast.net [73.92.37.32]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id 07NK5FcX021848 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 23 Aug 2020 13:05:15 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r364465 - in head/sys: conf net net/route To: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202008212134.07LLYq3K071532@repo.freebsd.org> <51571598049078@mail.yandex.ru> From: Julian Elischer Message-ID: <89fc3874-eead-7756-d53e-c4dbb64adece@freebsd.org> Date: Sun, 23 Aug 2020 13:05:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <51571598049078@mail.yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4BZR7l63Jtz4PhF X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:36236, ipnet:204.109.60.0/22, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:05:24 -0000 On 8/21/20 3:32 PM, Alexander V. Chernikov wrote: > 21.08.2020, 23:21, "Julian Elischer" : >> On 8/21/20 2:34 PM, Alexander V. Chernikov wrote: >>>  Author: melifaro >>>  Date: Fri Aug 21 21:34:52 2020 >>>  New Revision: 364465 >>>  URL: https://svnweb.freebsd.org/changeset/base/364465 >>> >>>  Log: >>>     Make net.fibs growable. >>> >>>     Allow to dynamically grow the amount of fibs in each vnet. >>> >>>     This change alters current behavior. Currently, if one defines >>>      ROUTETABLES > 1 in the kernel config, each vnet will be created >>>      with the number of fibs defined in the kernel config. >>>      After this commit vnets will be created with fibs=1. >>> >>>     Dynamic net.fibs is not compatible with net.add_addr_allfibs. >>>      The plan is to deprecate the latter and make >>>      net.add_addr_allfibs=0 default behaviour. >> For a while, setting it to 1 should be very noisy. > You mean that kernel should print warning when creating VNET && original net.fibs value is > 1 ? doing what you will soon be unable to do should warn you that you need to get ready to change your software to do it another way. From owner-svn-src-head@freebsd.org Sun Aug 23 20:05:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A6163C8CBA; Sun, 23 Aug 2020 20:05:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZR800QjSz4Pj3; Sun, 23 Aug 2020 20:05:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E56F4CD8D; Sun, 23 Aug 2020 20:05:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NK5ZnF009201; Sun, 23 Aug 2020 20:05:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NK5Zi0009200; Sun, 23 Aug 2020 20:05:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232005.07NK5Zi0009200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364520 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 364520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:05:36 -0000 Author: kib Date: Sun Aug 23 20:05:35 2020 New Revision: 364520 URL: https://svnweb.freebsd.org/changeset/base/364520 Log: Style. Modified: head/sys/arm64/arm64/elf32_machdep.c Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Sun Aug 23 19:59:38 2020 (r364519) +++ head/sys/arm64/arm64/elf32_machdep.c Sun Aug 23 20:05:35 2020 (r364520) @@ -66,7 +66,7 @@ extern int sz_aarch32_sigcode; static int freebsd32_fetch_syscall_args(struct thread *td); static void freebsd32_setregs(struct thread *td, struct image_params *imgp, - u_long stack); + u_long stack); static void freebsd32_set_syscall_retval(struct thread *, int); static boolean_t elf32_arm_abi_supported(struct image_params *); From owner-svn-src-head@freebsd.org Sun Aug 23 20:06:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 919873C8BD0; Sun, 23 Aug 2020 20:06:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZR9X3NJnz4PxP; Sun, 23 Aug 2020 20:06:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5776BC763; Sun, 23 Aug 2020 20:06:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NK6u9i009319; Sun, 23 Aug 2020 20:06:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NK6tjk009313; Sun, 23 Aug 2020 20:06:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232006.07NK6tjk009313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364521 - in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sys X-SVN-Commit-Revision: 364521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:06:56 -0000 Author: kib Date: Sun Aug 23 20:06:55 2020 New Revision: 364521 URL: https://svnweb.freebsd.org/changeset/base/364521 Log: Pass pointers to info parsed from notes, to brandinfo->header_supported filter. Currently, we parse notes for the values of ELF FreeBSD feature flags and osrel. Knowing these values, or knowing that image does not carry the note if pointers are NULL, is useful to decide which ABI variant (brand) we want to activate for the image. Right now this is only a plumbing change Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/arm/arm/elf_machdep.c head/sys/arm64/arm64/elf32_machdep.c head/sys/kern/imgact_elf.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/sys/imgact_elf.h Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sun Aug 23 20:05:35 2020 (r364520) +++ head/sys/arm/arm/elf_machdep.c Sun Aug 23 20:06:55 2020 (r364521) @@ -56,7 +56,8 @@ __FBSDID("$FreeBSD$"); #include "opt_global.h" /* for OPT_KDTRACE_HOOKS */ #include "opt_stack.h" /* for OPT_STACK */ -static boolean_t elf32_arm_abi_supported(struct image_params *); +static boolean_t elf32_arm_abi_supported(struct image_params *, int32_t *, + uint32_t *); u_long elf_hwcap; u_long elf_hwcap2; @@ -121,7 +122,8 @@ SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, &freebsd_brand_info); static boolean_t -elf32_arm_abi_supported(struct image_params *imgp) +elf32_arm_abi_supported(struct image_params *imgp, int32_t *osrel __unused, + uint32_t *fctl0 __unused) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Sun Aug 23 20:05:35 2020 (r364520) +++ head/sys/arm64/arm64/elf32_machdep.c Sun Aug 23 20:06:55 2020 (r364521) @@ -69,7 +69,8 @@ static void freebsd32_setregs(struct thread *td, struc u_long stack); static void freebsd32_set_syscall_retval(struct thread *, int); -static boolean_t elf32_arm_abi_supported(struct image_params *); +static boolean_t elf32_arm_abi_supported(struct image_params *, int32_t *, + uint32_t *); extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); @@ -126,7 +127,8 @@ SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)elf32_insert_brand_entry, &freebsd32_brand_info); static boolean_t -elf32_arm_abi_supported(struct image_params *imgp) +elf32_arm_abi_supported(struct image_params *imgp, int32_t *osrel __unused, + uint32_t *fctl0 __unused) { const Elf32_Ehdr *hdr; Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Aug 23 20:05:35 2020 (r364520) +++ head/sys/kern/imgact_elf.c Sun Aug 23 20:06:55 2020 (r364521) @@ -97,7 +97,8 @@ static bool __elfN(freebsd_trans_osrel)(const Elf_Note int32_t *osrel); static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, - Elf_Brandnote *checknote, int32_t *osrel, uint32_t *fctl0); + Elf_Brandnote *checknote, int32_t *osrel, boolean_t *has_fctl0, + uint32_t *fctl0); static vm_prot_t __elfN(trans_prot)(Elf_Word); static Elf_Word __elfN(untrans_prot)(vm_prot_t); @@ -309,7 +310,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi, *bi_m; - boolean_t ret; + boolean_t ret, has_fctl0; int i, interp_name_len; interp_name_len = interp != NULL ? strlen(interp) + 1 : 0; @@ -331,11 +332,16 @@ __elfN(get_brandinfo)(struct image_params *imgp, const continue; if (hdr->e_machine == bi->machine && (bi->flags & (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { + has_fctl0 = false; + *fctl0 = 0; + *osrel = 0; ret = __elfN(check_note)(imgp, bi->brand_note, osrel, - fctl0); + &has_fctl0, fctl0); /* Give brand a chance to veto check_note's guess */ - if (ret && bi->header_supported) - ret = bi->header_supported(imgp); + if (ret && bi->header_supported) { + ret = bi->header_supported(imgp, osrel, + has_fctl0 ? fctl0 : NULL); + } /* * If note checker claimed the binary, but the * interpreter path in the image does not @@ -374,7 +380,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const bi->compat_3_brand) == 0))) { /* Looks good, but give brand a chance to veto */ if (bi->header_supported == NULL || - bi->header_supported(imgp)) { + bi->header_supported(imgp, NULL, NULL)) { /* * Again, prefer strictly matching * interpreter path. @@ -402,7 +408,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const bi->header_supported == NULL) continue; if (hdr->e_machine == bi->machine) { - ret = bi->header_supported(imgp); + ret = bi->header_supported(imgp, NULL, NULL); if (ret) return (bi); } @@ -422,7 +428,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const strlen(bi->interp_path) + 1 == interp_name_len && strncmp(interp, bi->interp_path, interp_name_len) == 0 && (bi->header_supported == NULL || - bi->header_supported(imgp))) + bi->header_supported(imgp, NULL, NULL))) return (bi); } } @@ -436,7 +442,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const if (hdr->e_machine == bi->machine && __elfN(fallback_brand) == bi->brand && (bi->header_supported == NULL || - bi->header_supported(imgp))) + bi->header_supported(imgp, NULL, NULL))) return (bi); } return (NULL); @@ -2657,6 +2663,7 @@ static Elf_Note fctl_note = { }; struct fctl_cb_arg { + boolean_t *has_fctl0; uint32_t *fctl0; }; @@ -2671,6 +2678,7 @@ note_fctl_cb(const Elf_Note *note, void *arg0, boolean p = (uintptr_t)(note + 1); p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); desc = (const Elf32_Word *)p; + *arg->has_fctl0 = TRUE; *arg->fctl0 = desc[0]; return (TRUE); } @@ -2683,7 +2691,7 @@ note_fctl_cb(const Elf_Note *note, void *arg0, boolean */ static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *brandnote, - int32_t *osrel, uint32_t *fctl0) + int32_t *osrel, boolean_t *has_fctl0, uint32_t *fctl0) { const Elf_Phdr *phdr; const Elf_Ehdr *hdr; @@ -2695,6 +2703,7 @@ __elfN(check_note)(struct image_params *imgp, Elf_Bran phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); b_arg.brandnote = brandnote; b_arg.osrel = osrel; + f_arg.has_fctl0 = has_fctl0; f_arg.fctl0 = fctl0; for (i = 0; i < hdr->e_phnum; i++) { Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Sun Aug 23 20:05:35 2020 (r364520) +++ head/sys/powerpc/powerpc/elf64_machdep.c Sun Aug 23 20:06:55 2020 (r364521) @@ -135,8 +135,10 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { }; INIT_SYSENTVEC(elf64_sysvec_v2, &elf64_freebsd_sysvec_v2); -static boolean_t ppc64_elfv1_header_match(struct image_params *params); -static boolean_t ppc64_elfv2_header_match(struct image_params *params); +static boolean_t ppc64_elfv1_header_match(struct image_params *params, + int32_t *, uint32_t *); +static boolean_t ppc64_elfv2_header_match(struct image_params *params, + int32_t *, uint32_t *); static Elf64_Brandinfo freebsd_brand_info_elfv1 = { .brand = ELFOSABI_FREEBSD, @@ -192,7 +194,8 @@ SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, void elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase); static boolean_t -ppc64_elfv1_header_match(struct image_params *params) +ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, + uint32_t *fctl0 __unused) { const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; int abi = (hdr->e_flags & 3); @@ -201,7 +204,8 @@ ppc64_elfv1_header_match(struct image_params *params) } static boolean_t -ppc64_elfv2_header_match(struct image_params *params) +ppc64_elfv2_header_match(struct image_params *params, int32_t *osrel __unused, + uint32_t *fctl0 __unused) { const Elf64_Ehdr *hdr = (const Elf64_Ehdr *)params->image_header; int abi = (hdr->e_flags & 3); Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Sun Aug 23 20:05:35 2020 (r364520) +++ head/sys/sys/imgact_elf.h Sun Aug 23 20:06:55 2020 (r364521) @@ -87,7 +87,8 @@ typedef struct { const char *interp_newpath; int flags; Elf_Brandnote *brand_note; - boolean_t (*header_supported)(struct image_params *); + boolean_t (*header_supported)(struct image_params *, + int32_t *, uint32_t *); #define BI_CAN_EXEC_DYN 0x0001 #define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */ #define BI_BRAND_NOTE_MANDATORY 0x0004 /* Must have note.ABI-tag section. */ From owner-svn-src-head@freebsd.org Sun Aug 23 20:08:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 106DB3C8F23; Sun, 23 Aug 2020 20:08:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRBs6ksSz4Q8Q; Sun, 23 Aug 2020 20:08:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB678CD8E; Sun, 23 Aug 2020 20:08:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NK85on009441; Sun, 23 Aug 2020 20:08:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NK859v009440; Sun, 23 Aug 2020 20:08:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232008.07NK859v009440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364522 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 364522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:08:06 -0000 Author: kib Date: Sun Aug 23 20:08:05 2020 New Revision: 364522 URL: https://svnweb.freebsd.org/changeset/base/364522 Log: Add definition for CR4.LA57 bit. Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sun Aug 23 20:06:55 2020 (r364521) +++ head/sys/x86/include/specialreg.h Sun Aug 23 20:08:05 2020 (r364522) @@ -72,6 +72,7 @@ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ #define CR4_UMIP 0x00000800 /* User Mode Instruction Prevention */ +#define CR4_LA57 0x00001000 /* Enable 5-level paging */ #define CR4_VMXE 0x00002000 /* enable VMX operation (Intel-specific) */ #define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ #define CR4_PCIDE 0x00020000 /* Enable Context ID */ From owner-svn-src-head@freebsd.org Sun Aug 23 20:19:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A75853C91E7; Sun, 23 Aug 2020 20:19:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRRZ3ztnz4RLQ; Sun, 23 Aug 2020 20:19:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53058CFA1; Sun, 23 Aug 2020 20:19:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKJ6E3016128; Sun, 23 Aug 2020 20:19:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKJ53S016121; Sun, 23 Aug 2020 20:19:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232019.07NKJ53S016121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364527 - in head/sys: amd64/amd64 amd64/include amd64/linux amd64/vmm/amd amd64/vmm/intel cddl/dev/dtrace/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include amd64/linux amd64/vmm/amd amd64/vmm/intel cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 364527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:19:06 -0000 Author: kib Date: Sun Aug 23 20:19:04 2020 New Revision: 364527 URL: https://svnweb.freebsd.org/changeset/base/364527 Log: amd64 pmap: LA57 AKA 5-level paging Since LA57 was moved to the main SDM document with revision 072, it seems that we should have a support for it, and silicons are coming. This patch makes pmap support both LA48 and LA57 hardware. The selection of page table level is done at startup, kernel always receives control from loader with 4-level paging. It is not clear how UEFI spec would adapt LA57, for instance it could hand out control in LA57 mode sometimes. To switch from LA48 to LA57 requires turning off long mode, requesting LA57 in CR4, then re-entering long mode. This is somewhat delicate and done in pmap_bootstrap_la57(). AP startup in LA57 mode is much easier, we only need to toggle a bit in CR4 and load right value in CR3. I decided to not change kernel map for now. Single PML5 entry is created that points to the existing kernel_pml4 (KML4Phys) page, and a pml5 entry to create our recursive mapping for vtopte()/vtopde(). This decision is motivated by the fact that we cannot overcommit for KVA, so large space there is unusable until machines start providing wider physical memory addressing. Another reason is that I do not want to break our fragile autotuning, so the KVA expansion is not included into this first step. Nice side effect is that minidumps are compatible. On the other hand, (very) large address space is definitely immediately useful for some userspace applications. For userspace, numbering of pte entries (or page table pages) is always done for 5-level structures even if we operate in 4-level mode. The pmap_is_la57() function is added to report the mode of the specified pmap, this is done not to allow simultaneous 4-/5-levels (which is not allowed by hw), but to accomodate for EPT which has separate level control and in principle might not allow 5-leve EPT despite x86 paging supports it. Anyway, it does not seems critical to have 5-level EPT support now. Tested by: pho (LA48 hardware) Reviewed by: alc Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/locore.S head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/mpboot.S head/sys/amd64/amd64/pmap.c head/sys/amd64/include/md_var.h head/sys/amd64/include/param.h head/sys/amd64/include/pmap.h head/sys/amd64/include/proc.h head/sys/amd64/include/vmparam.h head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/elf_machdep.c Sun Aug 23 20:19:04 2020 (r364527) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct sysentvec elf64_freebsd_sysvec = { +struct sysentvec elf64_freebsd_sysvec_la48 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, .sv_errsize = 0, @@ -64,9 +64,9 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = VM_MAXUSER_ADDRESS, - .sv_usrstack = USRSTACK, - .sv_psstrings = PS_STRINGS, + .sv_maxuser = VM_MAXUSER_ADDRESS_LA48, + .sv_usrstack = USRSTACK_LA48, + .sv_psstrings = PS_STRINGS_LA48, .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), .sv_copyout_strings = exec_copyout_strings, @@ -78,15 +78,65 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, - .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_base = SHAREDPAGE_LA48, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, .sv_stackgap = elf64_stackgap, }; -INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); +struct sysentvec elf64_freebsd_sysvec_la57 = { + .sv_size = SYS_MAXSYSCALL, + .sv_table = sysent, + .sv_errsize = 0, + .sv_errtbl = NULL, + .sv_transtrap = NULL, + .sv_fixup = __elfN(freebsd_fixup), + .sv_sendsig = sendsig, + .sv_sigcode = sigcode, + .sv_szsigcode = &szsigcode, + .sv_name = "FreeBSD ELF64", + .sv_coredump = __elfN(coredump), + .sv_imgact_try = NULL, + .sv_minsigstksz = MINSIGSTKSZ, + .sv_minuser = VM_MIN_ADDRESS, + .sv_maxuser = VM_MAXUSER_ADDRESS_LA57, + .sv_usrstack = USRSTACK_LA57, + .sv_psstrings = PS_STRINGS_LA57, + .sv_stackprot = VM_PROT_ALL, + .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), + .sv_copyout_strings = exec_copyout_strings, + .sv_setregs = exec_setregs, + .sv_fixlimit = NULL, + .sv_maxssiz = NULL, + .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP | + SV_TIMEKEEP, + .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_fetch_syscall_args = cpu_fetch_syscall_args, + .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE_LA57, + .sv_shared_page_len = PAGE_SIZE, + .sv_schedtail = NULL, + .sv_thread_detach = NULL, + .sv_trap = NULL, + .sv_stackgap = elf64_stackgap, +}; + +static void +amd64_init_sysvecs(void *arg) +{ + amd64_lower_shared_page(&elf64_freebsd_sysvec_la48); + if (la57) { + exec_sysvec_init(&elf64_freebsd_sysvec_la57); + exec_sysvec_init_secondary(&elf64_freebsd_sysvec_la57, + &elf64_freebsd_sysvec_la48); + } else { + exec_sysvec_init(&elf64_freebsd_sysvec_la48); + } +} +SYSINIT(elf64_sysvec, SI_SUB_EXEC, SI_ORDER_ANY, amd64_init_sysvecs, NULL); + void amd64_lower_shared_page(struct sysentvec *sv) { @@ -98,29 +148,57 @@ amd64_lower_shared_page(struct sysentvec *sv) } } -/* - * Do this fixup before INIT_SYSENTVEC (SI_ORDER_ANY) because the latter - * uses the value of sv_shared_page_base. - */ -SYSINIT(elf64_sysvec_fixup, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t) amd64_lower_shared_page, - &elf64_freebsd_sysvec); +static boolean_t +freebsd_brand_info_la57_img_compat(struct image_params *imgp, + int32_t *osrel __unused, uint32_t *fctl0) +{ + if ((imgp->proc->p_md.md_flags & P_MD_LA57) != 0) + return (TRUE); + if (fctl0 == NULL || (*fctl0 & NT_FREEBSD_FCTL_LA48) != 0) + return (FALSE); + if ((imgp->proc->p_md.md_flags & P_MD_LA48) != 0) + return (FALSE); + return (TRUE); +} -static Elf64_Brandinfo freebsd_brand_info = { +static Elf64_Brandinfo freebsd_brand_info_la48 = { .brand = ELFOSABI_FREEBSD, .machine = EM_X86_64, .compat_3_brand = "FreeBSD", .emul_path = NULL, .interp_path = "/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, + .sysvec = &elf64_freebsd_sysvec_la48, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE, }; +static Elf64_Brandinfo freebsd_brand_info_la57 = { + .brand = ELFOSABI_FREEBSD, + .machine = EM_X86_64, + .compat_3_brand = "FreeBSD", + .emul_path = NULL, + .interp_path = "/libexec/ld-elf.so.1", + .sysvec = &elf64_freebsd_sysvec_la57, + .interp_newpath = NULL, + .brand_note = &elf64_freebsd_brandnote, + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE, + .header_supported = freebsd_brand_info_la57_img_compat, +}; + +static void +sysinit_register_elf64_brand_entries(void *arg __unused) +{ + /* + * _57 must go first so it can either claim the image or hand + * it to _48. + */ + if (la57) + elf64_insert_brand_entry(&freebsd_brand_info_la57); + elf64_insert_brand_entry(&freebsd_brand_info_la48); +} SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_info); + sysinit_register_elf64_brand_entries, NULL); static Elf64_Brandinfo freebsd_brand_oinfo = { .brand = ELFOSABI_FREEBSD, @@ -128,15 +206,14 @@ static Elf64_Brandinfo freebsd_brand_oinfo = { .compat_3_brand = "FreeBSD", .emul_path = NULL, .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, + .sysvec = &elf64_freebsd_sysvec_la48, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_oinfo); + (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); static Elf64_Brandinfo kfreebsd_brand_info = { .brand = ELFOSABI_FREEBSD, @@ -144,15 +221,14 @@ static Elf64_Brandinfo kfreebsd_brand_info = { .compat_3_brand = "FreeBSD", .emul_path = NULL, .interp_path = "/lib/ld-kfreebsd-x86-64.so.1", - .sysvec = &elf64_freebsd_sysvec, + .sysvec = &elf64_freebsd_sysvec_la48, .interp_newpath = NULL, .brand_note = &elf64_kfreebsd_brandnote, .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE_MANDATORY }; SYSINIT(kelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &kfreebsd_brand_info); + (sysinit_cfunc_t)elf64_insert_brand_entry, &kfreebsd_brand_info); void elf64_dump_thread(struct thread *td, void *dst, size_t *off) Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/genassym.c Sun Aug 23 20:19:04 2020 (r364527) @@ -99,11 +99,10 @@ ASSYM(TDP_KTHREAD, TDP_KTHREAD); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); ASSYM(NPDEPG, NPDEPG); -ASSYM(addr_PTmap, addr_PTmap); -ASSYM(addr_PDmap, addr_PDmap); -ASSYM(addr_PDPmap, addr_PDPmap); -ASSYM(addr_PML4map, addr_PML4map); -ASSYM(addr_PML4pml4e, addr_PML4pml4e); +ASSYM(addr_P4Tmap, addr_P4Tmap); +ASSYM(addr_P4Dmap, addr_P4Dmap); +ASSYM(addr_P5Tmap, addr_P5Tmap); +ASSYM(addr_P5Dmap, addr_P5Dmap); ASSYM(PDESIZE, sizeof(pd_entry_t)); ASSYM(PTESIZE, sizeof(pt_entry_t)); ASSYM(PAGE_SHIFT, PAGE_SHIFT); Modified: head/sys/amd64/amd64/locore.S ============================================================================== --- head/sys/amd64/amd64/locore.S Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/locore.S Sun Aug 23 20:19:04 2020 (r364527) @@ -36,13 +36,8 @@ /* * Compiled KERNBASE location */ - .globl kernbase,loc_PTmap,loc_PDmap,loc_PDPmap,loc_PML4map,loc_PML4pml4e,dmapbase,dmapend + .globl kernbase, loc_PTmap, loc_PDmap, loc_PDPmap, dmapbase, dmapend .set kernbase,KERNBASE - .set loc_PTmap,addr_PTmap - .set loc_PDmap,addr_PDmap - .set loc_PDPmap,addr_PDPmap - .set loc_PML4map,addr_PML4map - .set loc_PML4pml4e,addr_PML4pml4e .set dmapbase,DMAP_MIN_ADDRESS .set dmapend,DMAP_MAX_ADDRESS @@ -81,6 +76,62 @@ NON_GPROF_ENTRY(btext) call mi_startup /* autoconfiguration, mountroot etc */ 0: hlt jmp 0b + +/* la57_trampoline(%rdi pml5) */ +NON_GPROF_ENTRY(la57_trampoline) + movq %rsp,%r11 + movq %rbx,%r10 + leaq la57_trampoline_end(%rip),%rsp + + movq %cr0,%rdx + lgdtq la57_trampoline_gdt_desc(%rip) + + pushq $(2<<3) + leaq l1(%rip),%rax + leaq l2(%rip),%rbx + + pushq %rax + lretq + .code32 + +l1: movl $(3<<3),%eax + movl %eax,%ss + + movl %edx,%eax + andl $~CR0_PG,%eax + movl %eax,%cr0 + + movl %cr4,%eax + orl $CR4_LA57,%eax + movl %eax,%cr4 + + movl %edi,%cr3 + movl %edx,%cr0 + + pushl $(1<<3) + pushl %ebx + lretl + .code64 + +l2: movq %r11,%rsp + movq %r10,%rbx + retq + .p2align 4,0 +NON_GPROF_ENTRY(la57_trampoline_gdt_desc) + .word la57_trampoline_end - la57_trampoline_gdt + .long 0 /* filled by pmap_bootstrap_la57 */ + .p2align 4,0 +NON_GPROF_ENTRY(la57_trampoline_gdt) + .long 0x00000000 /* null desc */ + .long 0x00000000 + .long 0x00000000 /* 64bit code */ + .long 0x00209800 + .long 0x0000ffff /* 32bit code */ + .long 0x00cf9b00 + .long 0x0000ffff /* universal data */ + .long 0x00cf9300 + .dcb.l 16,0 +NON_GPROF_ENTRY(la57_trampoline_end) .bss ALIGN_DATA /* just to be sure */ Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/mp_machdep.c Sun Aug 23 20:19:04 2020 (r364527) @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); #define GiB(v) (v ## ULL << 30) -#define AP_BOOTPT_SZ (PAGE_SIZE * 3) +#define AP_BOOTPT_SZ (PAGE_SIZE * 4) /* Temporary variables for init_secondary() */ char *doublefault_stack; @@ -104,6 +104,8 @@ char *mce_stack; char *nmi_stack; char *dbg_stack; +extern u_int mptramp_la57; + /* * Local data and functions. */ @@ -240,6 +242,8 @@ cpu_mp_start(void) assign_cpu_ids(); + mptramp_la57 = la57; + /* Start each Application Processor */ init_ops.start_all_aps(); @@ -395,9 +399,9 @@ mp_realloc_pcpu(int cpuid, int domain) int native_start_all_aps(void) { - u_int64_t *pt4, *pt3, *pt2; + u_int64_t *pt5, *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; - int apic_id, cpu, domain, i; + int apic_id, cpu, domain, i, xo; u_char mpbiosreason; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); @@ -406,18 +410,38 @@ native_start_all_aps(void) bcopy(mptramp_start, (void *)PHYS_TO_DMAP(boot_address), bootMP_size); /* Locate the page tables, they'll be below the trampoline */ - pt4 = (uint64_t *)PHYS_TO_DMAP(mptramp_pagetables); + if (la57) { + pt5 = (uint64_t *)PHYS_TO_DMAP(mptramp_pagetables); + xo = 1; + } else { + xo = 0; + } + pt4 = (uint64_t *)PHYS_TO_DMAP(mptramp_pagetables + xo * PAGE_SIZE); pt3 = pt4 + (PAGE_SIZE) / sizeof(u_int64_t); pt2 = pt3 + (PAGE_SIZE) / sizeof(u_int64_t); /* Create the initial 1GB replicated page tables */ for (i = 0; i < 512; i++) { - /* Each slot of the level 4 pages points to the same level 3 page */ - pt4[i] = (u_int64_t)(uintptr_t)(mptramp_pagetables + PAGE_SIZE); + if (la57) { + pt5[i] = (u_int64_t)(uintptr_t)(mptramp_pagetables + + PAGE_SIZE); + pt5[i] |= PG_V | PG_RW | PG_U; + } + + /* + * Each slot of the level 4 pages points to the same + * level 3 page. + */ + pt4[i] = (u_int64_t)(uintptr_t)(mptramp_pagetables + + (xo + 1) * PAGE_SIZE); pt4[i] |= PG_V | PG_RW | PG_U; - /* Each slot of the level 3 pages points to the same level 2 page */ - pt3[i] = (u_int64_t)(uintptr_t)(mptramp_pagetables + (2 * PAGE_SIZE)); + /* + * Each slot of the level 3 pages points to the same + * level 2 page. + */ + pt3[i] = (u_int64_t)(uintptr_t)(mptramp_pagetables + + ((xo + 2) * PAGE_SIZE)); pt3[i] |= PG_V | PG_RW | PG_U; /* The level 2 page slots are mapped with 2MB pages for 1GB. */ Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/mpboot.S Sun Aug 23 20:19:04 2020 (r364527) @@ -90,10 +90,16 @@ protmode: mov $bootdata-gdt, %eax mov %ax, %ds - /* Turn on the PAE bit for when paging is enabled */ + /* + * Turn on the PAE bit and optionally the LA57 bit for when paging + * is later enabled. + */ mov %cr4, %eax orl $CR4_PAE, %eax - mov %eax, %cr4 + cmpb $0, mptramp_la57-mptramp_start(%ebx) + je 1f + orl $CR4_LA57, %eax +1: mov %eax, %cr4 /* * Enable EFER.LME so that we get long mode when all the prereqs are @@ -132,9 +138,9 @@ protmode: /* * At this point paging is enabled, and we are in "compatibility" mode. * We do another far jump to reload %cs with the 64 bit selector. - * %cr3 points to a 4-level page table page. + * %cr3 points to a 4- or 5-level page table. * We cannot yet jump all the way to the kernel because we can only - * specify a 32 bit linear address. So, yet another trampoline. + * specify a 32 bit linear address. So, we use yet another trampoline. * * The following instruction is: * ljmp $kernelcode-gdt, $tramp_64-mptramp_start @@ -209,6 +215,11 @@ gdtend: mptramp_pagetables: .long 0 + /* 5-level paging ? */ + .globl mptramp_la57 +mptramp_la57: + .long 0 + /* * The pseudo descriptor for lgdt to use. */ @@ -251,8 +262,12 @@ entry_64: * Load a real %cr3 that has all the direct map stuff and switches * off the 1GB replicated mirror. Load a stack pointer and jump * into AP startup code in C. - */ + */ + cmpl $0, la57 + jne 2f movq KPML4phys, %rax - movq %rax, %cr3 + jmp 3f +2: movq KPML5phys, %rax +3: movq %rax, %cr3 movq bootSTK, %rsp jmp init_secondary Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Aug 23 20:14:57 2020 (r364526) +++ head/sys/amd64/amd64/pmap.c Sun Aug 23 20:19:04 2020 (r364527) @@ -398,6 +398,19 @@ static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pg_ps_enabled, 0, "Are large page mappings enabled?"); +int __read_frequently la57 = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, la57, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &la57, 0, + "5-level paging for host is enabled"); + +static bool +pmap_is_la57(pmap_t pmap) +{ + if (pmap->pm_type == PT_X86) + return (la57); + return (false); /* XXXKIB handle EPT */ +} + #define PAT_INDEX_SIZE 8 static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ @@ -405,7 +418,10 @@ static u_int64_t KPTphys; /* phys addr of kernel level static u_int64_t KPDphys; /* phys addr of kernel level 2 */ u_int64_t KPDPphys; /* phys addr of kernel level 3 */ u_int64_t KPML4phys; /* phys addr of kernel level 4 */ +u_int64_t KPML5phys; /* phys addr of kernel level 5, + if supported */ +static pml4_entry_t *kernel_pml4; static u_int64_t DMPDphys; /* phys addr of direct mapped level 2 */ static u_int64_t DMPDPphys; /* phys addr of direct mapped level 3 */ static int ndmpdpphys; /* number of DMPDPphys pages */ @@ -1257,7 +1273,7 @@ static void pmap_update_pde(pmap_t pmap, vm_offset_t v static void pmap_update_pde_invalidate(pmap_t, vm_offset_t va, pd_entry_t pde); static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, - struct rwlock **lockp); + struct rwlock **lockp, vm_offset_t va); static pd_entry_t *pmap_alloc_pde(pmap_t pmap, vm_offset_t va, vm_page_t *pdpgp, struct rwlock **lockp); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, @@ -1271,22 +1287,87 @@ static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry /* Inline functions */ /********************/ -/* Return a non-clipped PD index for a given VA */ +/* + * Return a non-clipped indexes for a given VA, which are page table + * pages indexes at the corresponding level. + */ static __inline vm_pindex_t pmap_pde_pindex(vm_offset_t va) { return (va >> PDRSHIFT); } +static __inline vm_pindex_t +pmap_pdpe_pindex(vm_offset_t va) +{ + return (NUPDE + (va >> PDPSHIFT)); +} +static __inline vm_pindex_t +pmap_pml4e_pindex(vm_offset_t va) +{ + return (NUPDE + NUPDPE + (va >> PML4SHIFT)); +} + +static __inline vm_pindex_t +pmap_pml5e_pindex(vm_offset_t va) +{ + return (NUPDE + NUPDPE + NUPML4E + (va >> PML5SHIFT)); +} + +static __inline pml4_entry_t * +pmap_pml5e(pmap_t pmap, vm_offset_t va) +{ + + MPASS(pmap_is_la57(pmap)); + return (&pmap->pm_pmltop[pmap_pml5e_index(va)]); +} + +static __inline pml4_entry_t * +pmap_pml5e_u(pmap_t pmap, vm_offset_t va) +{ + + MPASS(pmap_is_la57(pmap)); + return (&pmap->pm_pmltopu[pmap_pml5e_index(va)]); +} + +static __inline pml4_entry_t * +pmap_pml5e_to_pml4e(pml5_entry_t *pml5e, vm_offset_t va) +{ + pml4_entry_t *pml4e; + + /* XXX MPASS(pmap_is_la57(pmap); */ + pml4e = (pml4_entry_t *)PHYS_TO_DMAP(*pml5e & PG_FRAME); + return (&pml4e[pmap_pml4e_index(va)]); +} + /* Return a pointer to the PML4 slot that corresponds to a VA */ static __inline pml4_entry_t * pmap_pml4e(pmap_t pmap, vm_offset_t va) { + pml5_entry_t *pml5e; + pml4_entry_t *pml4e; + pt_entry_t PG_V; - return (&pmap->pm_pml4[pmap_pml4e_index(va)]); + if (pmap_is_la57(pmap)) { + pml5e = pmap_pml5e(pmap, va); + PG_V = pmap_valid_bit(pmap); + if ((*pml5e & PG_V) == 0) + return (NULL); + pml4e = (pml4_entry_t *)PHYS_TO_DMAP(*pml5e & PG_FRAME); + } else { + pml4e = pmap->pm_pmltop; + } + return (&pml4e[pmap_pml4e_index(va)]); } +static __inline pml4_entry_t * +pmap_pml4e_u(pmap_t pmap, vm_offset_t va) +{ + MPASS(!pmap_is_la57(pmap)); + return (&pmap->pm_pmltopu[pmap_pml4e_index(va)]); +} + /* Return a pointer to the PDP slot that corresponds to a VA */ static __inline pdp_entry_t * pmap_pml4e_to_pdpe(pml4_entry_t *pml4e, vm_offset_t va) @@ -1306,7 +1387,7 @@ pmap_pdpe(pmap_t pmap, vm_offset_t va) PG_V = pmap_valid_bit(pmap); pml4e = pmap_pml4e(pmap, va); - if ((*pml4e & PG_V) == 0) + if (pml4e == NULL || (*pml4e & PG_V) == 0) return (NULL); return (pmap_pml4e_to_pdpe(pml4e, va)); } @@ -1387,21 +1468,37 @@ pmap_resident_count_dec(pmap_t pmap, int count) PMAP_INLINE pt_entry_t * vtopte(vm_offset_t va) { - u_int64_t mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + NPML4EPGSHIFT)) - 1); + u_int64_t mask; KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopte on a uva/gpa 0x%0lx", va)); - return (PTmap + ((va >> PAGE_SHIFT) & mask)); + if (la57) { + mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1); + return (P5Tmap + ((va >> PAGE_SHIFT) & mask)); + } else { + mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT)) - 1); + return (P4Tmap + ((va >> PAGE_SHIFT) & mask)); + } } static __inline pd_entry_t * vtopde(vm_offset_t va) { - u_int64_t mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + NPML4EPGSHIFT)) - 1); + u_int64_t mask; KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopde on a uva/gpa 0x%0lx", va)); - return (PDmap + ((va >> PDRSHIFT) & mask)); + if (la57) { + mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT + NPML5EPGSHIFT)) - 1); + return (P5Dmap + ((va >> PDRSHIFT) & mask)); + } else { + mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + + NPML4EPGSHIFT)) - 1); + return (P4Dmap + ((va >> PDRSHIFT) & mask)); + } } static u_int64_t @@ -1658,6 +1755,8 @@ create_pagetables(vm_paddr_t *firstaddr) p4_p[KPML4BASE + i] = KPDPphys + ptoa(i); p4_p[KPML4BASE + i] |= X86_PG_RW | X86_PG_V; } + + kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); } /* @@ -1730,7 +1829,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * later unmapped (using pmap_remove()) and freed. */ PMAP_LOCK_INIT(kernel_pmap); - kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); + kernel_pmap->pm_pmltop = kernel_pml4; kernel_pmap->pm_cr3 = KPML4phys; kernel_pmap->pm_ucr3 = PMAP_NO_CR3; CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ @@ -1891,6 +1990,148 @@ pmap_init_pat(void) load_cr4(cr4); } +extern const char la57_trampoline[], la57_trampoline_gdt_desc[], + la57_trampoline_gdt[], la57_trampoline_end[]; + +static void +pmap_bootstrap_la57(void *arg __unused) +{ + char *v_code; + pml5_entry_t *v_pml5; + pml4_entry_t *v_pml4; + pdp_entry_t *v_pdp; + pd_entry_t *v_pd; + pt_entry_t *v_pt; + vm_page_t m_code, m_pml4, m_pdp, m_pd, m_pt, m_pml5; + void (*la57_tramp)(uint64_t pml5); + struct region_descriptor r_gdt; + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_LA57) == 0) + return; + if (!TUNABLE_INT_FETCH("vm.pmap.la57", &la57)) + la57 = 1; + if (!la57) + return; + + r_gdt.rd_limit = NGDT * sizeof(struct user_segment_descriptor) - 1; + r_gdt.rd_base = (long)__pcpu[0].pc_gdt; + + m_code = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_code->flags & PG_ZERO) == 0) + pmap_zero_page(m_code); + v_code = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_code)); + m_pml5 = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_pml5->flags & PG_ZERO) == 0) + pmap_zero_page(m_pml5); + KPML5phys = VM_PAGE_TO_PHYS(m_pml5); + v_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(KPML5phys); + m_pml4 = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_pml4->flags & PG_ZERO) == 0) + pmap_zero_page(m_pml4); + v_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pml4)); + m_pdp = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_pdp->flags & PG_ZERO) == 0) + pmap_zero_page(m_pdp); + v_pdp = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pdp)); + m_pd = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_pd->flags & PG_ZERO) == 0) + pmap_zero_page(m_pd); + v_pd = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pd)); + m_pt = vm_page_alloc_contig(NULL, 0, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if ((m_pt->flags & PG_ZERO) == 0) + pmap_zero_page(m_pt); + v_pt = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pt)); + + /* + * Map m_code 1:1, it appears below 4G in KVA due to physical + * address being below 4G. Since kernel KVA is in upper half, + * the pml4e should be zero and free for temporary use. + */ + kernel_pmap->pm_pmltop[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + v_pdp[pmap_pdpe_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_pd) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + v_pd[pmap_pde_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_pt) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + v_pt[pmap_pte_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_code) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + + /* + * Add pml5 entry at top of KVA pointing to existing pml4 table, + * entering all existing kernel mappings into level 5 table. + */ + v_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | + X86_PG_RW | X86_PG_A | X86_PG_M | pg_g; + + /* + * Add pml5 entry for 1:1 trampoline mapping after LA57 is turned on. + */ + v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_pml4) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + v_pml4[pmap_pml4e_index(VM_PAGE_TO_PHYS(m_code))] = + VM_PAGE_TO_PHYS(m_pdp) | X86_PG_V | X86_PG_RW | X86_PG_A | + X86_PG_M; + + /* + * Copy and call the 48->57 trampoline, hope we return there, alive. + */ + bcopy(la57_trampoline, v_code, la57_trampoline_end - la57_trampoline); + *(u_long *)(v_code + 2 + (la57_trampoline_gdt_desc - la57_trampoline)) = + la57_trampoline_gdt - la57_trampoline + VM_PAGE_TO_PHYS(m_code); + la57_tramp = (void (*)(uint64_t))VM_PAGE_TO_PHYS(m_code); + la57_tramp(KPML5phys); + + /* + * gdt was necessary reset, switch back to our gdt. + */ + lgdt(&r_gdt); + wrmsr(MSR_GSBASE, (uint64_t)&__pcpu[0]); + load_ds(_udatasel); + load_es(_udatasel); + load_fs(_ufssel); + ssdtosyssd(&gdt_segs[GPROC0_SEL], + (struct system_segment_descriptor *)&__pcpu[0].pc_gdt[GPROC0_SEL]); + ltr(GSEL(GPROC0_SEL, SEL_KPL)); + + /* + * Now unmap the trampoline, and free the pages. + * Clear pml5 entry used for 1:1 trampoline mapping. + */ + pte_clear(&v_pml5[pmap_pml5e_index(VM_PAGE_TO_PHYS(m_code))]); + invlpg((vm_offset_t)v_code); + vm_page_free(m_code); + vm_page_free(m_pdp); + vm_page_free(m_pd); + vm_page_free(m_pt); + + /* + * Recursively map PML5 to itself in order to get PTmap and + * PDmap. + */ + v_pml5[PML5PML5I] = KPML5phys | X86_PG_RW | X86_PG_V | pg_nx; + + kernel_pmap->pm_cr3 = KPML5phys; + kernel_pmap->pm_pmltop = v_pml5; +} +SYSINIT(la57, SI_SUB_KMEM, SI_ORDER_ANY, pmap_bootstrap_la57, NULL); + /* * Initialize a vm_page's machine-dependent fields. */ @@ -2190,7 +2431,8 @@ pmap_init(void) } for (i = 0; i < lm_ents; i++) { m = pmap_large_map_getptp_unlocked(); - kernel_pmap->pm_pml4[LMSPML4I + i] = X86_PG_V | + /* XXXKIB la57 */ + kernel_pml4[LMSPML4I + i] = X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | pg_nx | VM_PAGE_TO_PHYS(m); } @@ -3566,44 +3808,57 @@ pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) { + pml5_entry_t *pml5; + pml4_entry_t *pml4; + pdp_entry_t *pdp; + pd_entry_t *pd; + vm_page_t pdpg, pdppg, pml4pg; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* * unmap the page table page */ - if (m->pindex >= NUPDE + NUPDPE) { + if (m->pindex >= NUPDE + NUPDPE + NUPML4E) { + /* PML4 page */ + MPASS(pmap_is_la57(pmap)); + pml5 = pmap_pml5e(pmap, va); + *pml5 = 0; + if (pmap->pm_pmltopu != NULL && va <= VM_MAXUSER_ADDRESS) { + pml5 = pmap_pml5e_u(pmap, va); + *pml5 = 0; + } + } else if (m->pindex >= NUPDE + NUPDPE) { /* PDP page */ - pml4_entry_t *pml4; pml4 = pmap_pml4e(pmap, va); *pml4 = 0; - if (pmap->pm_pml4u != NULL && va <= VM_MAXUSER_ADDRESS) { - pml4 = &pmap->pm_pml4u[pmap_pml4e_index(va)]; + if (!pmap_is_la57(pmap) && pmap->pm_pmltopu != NULL && + va <= VM_MAXUSER_ADDRESS) { + pml4 = pmap_pml4e_u(pmap, va); *pml4 = 0; } } else if (m->pindex >= NUPDE) { /* PD page */ - pdp_entry_t *pdp; pdp = pmap_pdpe(pmap, va); *pdp = 0; } else { /* PTE page */ - pd_entry_t *pd; pd = pmap_pde(pmap, va); *pd = 0; } pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { /* We just released a PT, unhold the matching PD */ - vm_page_t pdpg; - pdpg = PHYS_TO_VM_PAGE(*pmap_pdpe(pmap, va) & PG_FRAME); pmap_unwire_ptp(pmap, va, pdpg, free); } else if (m->pindex < NUPDE + NUPDPE) { /* We just released a PD, unhold the matching PDP */ - vm_page_t pdppg; - pdppg = PHYS_TO_VM_PAGE(*pmap_pml4e(pmap, va) & PG_FRAME); pmap_unwire_ptp(pmap, va, pdppg, free); + } else if (m->pindex < NUPDE + NUPDPE + NUPML4E && pmap_is_la57(pmap)) { + /* We just released a PDP, unhold the matching PML4 */ + pml4pg = PHYS_TO_VM_PAGE(*pmap_pml5e(pmap, va) & PG_FRAME); + pmap_unwire_ptp(pmap, va, pml4pg, free); } /* @@ -3659,9 +3914,9 @@ pmap_pinit0(pmap_t pmap) int i; PMAP_LOCK_INIT(pmap); - pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); - pmap->pm_pml4u = NULL; - pmap->pm_cr3 = KPML4phys; + pmap->pm_pmltop = kernel_pmap->pm_pmltop; + pmap->pm_pmltopu = NULL; + pmap->pm_cr3 = kernel_pmap->pm_cr3; /* hack to keep pmap_pti_pcid_invalidate() alive */ pmap->pm_ucr3 = PMAP_NO_CR3; pmap->pm_root.rt_root = 0; @@ -3714,20 +3969,61 @@ pmap_pinit_pml4(vm_page_t pml4pg) /* install large map entries if configured */ for (i = 0; i < lm_ents; i++) - pm_pml4[LMSPML4I + i] = kernel_pmap->pm_pml4[LMSPML4I + i]; + pm_pml4[LMSPML4I + i] = kernel_pmap->pm_pmltop[LMSPML4I + i]; } +void +pmap_pinit_pml5(vm_page_t pml5pg) +{ + pml5_entry_t *pm_pml5; + + pm_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pg)); + + /* + * Add pml5 entry at top of KVA pointing to existing pml4 table, + * entering all existing kernel mappings into level 5 table. + */ + pm_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | + X86_PG_RW | X86_PG_A | X86_PG_M | pg_g | + pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, FALSE); + + /* + * Install self-referential address mapping entry. + */ + pm_pml5[PML5PML5I] = VM_PAGE_TO_PHYS(pml5pg) | + X86_PG_RW | X86_PG_V | X86_PG_M | X86_PG_A | + pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, FALSE); +} + static void -pmap_pinit_pml4_pti(vm_page_t pml4pg) +pmap_pinit_pml4_pti(vm_page_t pml4pgu) { - pml4_entry_t *pm_pml4; + pml4_entry_t *pm_pml4u; int i; - pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pg)); + pm_pml4u = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pgu)); for (i = 0; i < NPML4EPG; i++) - pm_pml4[i] = pti_pml4[i]; + pm_pml4u[i] = pti_pml4[i]; } +static void +pmap_pinit_pml5_pti(vm_page_t pml5pgu) +{ + pml5_entry_t *pm_pml5u; + + pm_pml5u = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pgu)); + + /* + * Add pml5 entry at top of KVA pointing to existing pml4 pti + * table, entering all kernel mappings needed for usermode + * into level 5 table. + */ + pm_pml5u[pmap_pml5e_index(UPT_MAX_ADDRESS)] = + pmap_kextract((vm_offset_t)pti_pml4) | + X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M | pg_g | + pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, FALSE); +} + /* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. @@ -3735,29 +4031,30 @@ pmap_pinit_pml4_pti(vm_page_t pml4pg) int pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) { - vm_page_t pml4pg, pml4pgu; - vm_paddr_t pml4phys; + vm_page_t pmltop_pg, pmltop_pgu; + vm_paddr_t pmltop_phys; int i; /* * allocate the page directory page */ - pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + pmltop_pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); - pml4phys = VM_PAGE_TO_PHYS(pml4pg); - pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pml4phys); + pmltop_phys = VM_PAGE_TO_PHYS(pmltop_pg); + pmap->pm_pmltop = (pml5_entry_t *)PHYS_TO_DMAP(pmltop_phys); + CPU_FOREACH(i) { pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; pmap->pm_pcids[i].pm_gen = 0; } pmap->pm_cr3 = PMAP_NO_CR3; /* initialize to an invalid value */ pmap->pm_ucr3 = PMAP_NO_CR3; - pmap->pm_pml4u = NULL; + pmap->pm_pmltopu = NULL; pmap->pm_type = pm_type; - if ((pml4pg->flags & PG_ZERO) == 0) - pagezero(pmap->pm_pml4); + if ((pmltop_pg->flags & PG_ZERO) == 0) + pagezero(pmap->pm_pmltop); /* * Do not install the host kernel mappings in the nested page @@ -3766,15 +4063,21 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i * Install minimal kernel mappings in PTI case. */ if (pm_type == PT_X86) { - pmap->pm_cr3 = pml4phys; - pmap_pinit_pml4(pml4pg); + pmap->pm_cr3 = pmltop_phys; + if (pmap_is_la57(pmap)) + pmap_pinit_pml5(pmltop_pg); + else + pmap_pinit_pml4(pmltop_pg); if ((curproc->p_md.md_flags & P_MD_KPTI) != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 23 20:32:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 580B83C9659; Sun, 23 Aug 2020 20:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRkk1dVzz4S5r; Sun, 23 Aug 2020 20:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 027EACE79; Sun, 23 Aug 2020 20:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKWDhp028081; Sun, 23 Aug 2020 20:32:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKWDWZ028079; Sun, 23 Aug 2020 20:32:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232032.07NKWDWZ028079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364530 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/include X-SVN-Commit-Revision: 364530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:32:14 -0000 Author: kib Date: Sun Aug 23 20:32:13 2020 New Revision: 364530 URL: https://svnweb.freebsd.org/changeset/base/364530 Log: Add amd64 procctl(2) ops to manage forced LA48/LA57 VA after exec. Tested by: pho (LA48 hardware) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/x86/include/procctl.h Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun Aug 23 20:25:10 2020 (r364529) +++ head/sys/amd64/amd64/vm_machdep.c Sun Aug 23 20:32:13 2020 (r364530) @@ -377,23 +377,69 @@ cpu_exec_vmspace_reuse(struct proc *p, vm_map_t map) } static void -cpu_procctl_kpti(struct proc *p, int com, int *val) +cpu_procctl_kpti_ctl(struct proc *p, int val) { - if (com == PROC_KPTI_CTL) { - if (pti && *val == PROC_KPTI_CTL_ENABLE_ON_EXEC) - p->p_md.md_flags |= P_MD_KPTI; - if (*val == PROC_KPTI_CTL_DISABLE_ON_EXEC) - p->p_md.md_flags &= ~P_MD_KPTI; - } else /* PROC_KPTI_STATUS */ { - *val = (p->p_md.md_flags & P_MD_KPTI) != 0 ? - PROC_KPTI_CTL_ENABLE_ON_EXEC: - PROC_KPTI_CTL_DISABLE_ON_EXEC; - if (vmspace_pmap(p->p_vmspace)->pm_ucr3 != PMAP_NO_CR3) - *val |= PROC_KPTI_STATUS_ACTIVE; + if (pti && val == PROC_KPTI_CTL_ENABLE_ON_EXEC) + p->p_md.md_flags |= P_MD_KPTI; + if (val == PROC_KPTI_CTL_DISABLE_ON_EXEC) + p->p_md.md_flags &= ~P_MD_KPTI; +} + +static void +cpu_procctl_kpti_status(struct proc *p, int *val) +{ + *val = (p->p_md.md_flags & P_MD_KPTI) != 0 ? + PROC_KPTI_CTL_ENABLE_ON_EXEC: + PROC_KPTI_CTL_DISABLE_ON_EXEC; + if (vmspace_pmap(p->p_vmspace)->pm_ucr3 != PMAP_NO_CR3) + *val |= PROC_KPTI_STATUS_ACTIVE; +} + +static int +cpu_procctl_la_ctl(struct proc *p, int val) +{ + int error; + + error = 0; + switch (val) { + case PROC_LA_CTL_LA48_ON_EXEC: + p->p_md.md_flags |= P_MD_LA48; + p->p_md.md_flags &= ~P_MD_LA57; + break; + case PROC_LA_CTL_LA57_ON_EXEC: + if (la57) { + p->p_md.md_flags &= ~P_MD_LA48; + p->p_md.md_flags |= P_MD_LA57; + } else { + error = ENOTSUP; + } + break; + case PROC_LA_CTL_DEFAULT_ON_EXEC: + p->p_md.md_flags &= ~(P_MD_LA48 | P_MD_LA57); + break; } + return (error); } +static void +cpu_procctl_la_status(struct proc *p, int *val) +{ + int res; + + if ((p->p_md.md_flags & P_MD_LA48) != 0) + res = PROC_LA_CTL_LA48_ON_EXEC; + else if ((p->p_md.md_flags & P_MD_LA57) != 0) + res = PROC_LA_CTL_LA57_ON_EXEC; + else + res = PROC_LA_CTL_DEFAULT_ON_EXEC; + if (p->p_sysent->sv_maxuser == VM_MAXUSER_ADDRESS_LA48) + res |= PROC_LA_STATUS_LA48; + else + res |= PROC_LA_STATUS_LA57; + *val = res; +} + int cpu_procctl(struct thread *td, int idtype, id_t id, int com, void *data) { @@ -403,6 +449,8 @@ cpu_procctl(struct thread *td, int idtype, id_t id, in switch (com) { case PROC_KPTI_CTL: case PROC_KPTI_STATUS: + case PROC_LA_CTL: + case PROC_LA_STATUS: if (idtype != P_PID) { error = EINVAL; break; @@ -412,22 +460,45 @@ cpu_procctl(struct thread *td, int idtype, id_t id, in error = priv_check(td, PRIV_IO); if (error != 0) break; + } + if (com == PROC_KPTI_CTL || com == PROC_LA_CTL) { error = copyin(data, &val, sizeof(val)); if (error != 0) break; - if (val != PROC_KPTI_CTL_ENABLE_ON_EXEC && - val != PROC_KPTI_CTL_DISABLE_ON_EXEC) { - error = EINVAL; - break; - } } + if (com == PROC_KPTI_CTL && + val != PROC_KPTI_CTL_ENABLE_ON_EXEC && + val != PROC_KPTI_CTL_DISABLE_ON_EXEC) { + error = EINVAL; + break; + } + if (com == PROC_LA_CTL && + val != PROC_LA_CTL_LA48_ON_EXEC && + val != PROC_LA_CTL_LA57_ON_EXEC && + val != PROC_LA_CTL_DEFAULT_ON_EXEC) { + error = EINVAL; + break; + } error = pget(id, PGET_CANSEE | PGET_NOTWEXIT | PGET_NOTID, &p); - if (error == 0) { - cpu_procctl_kpti(p, com, &val); - PROC_UNLOCK(p); - if (com == PROC_KPTI_STATUS) - error = copyout(&val, data, sizeof(val)); + if (error != 0) + break; + switch (com) { + case PROC_KPTI_CTL: + cpu_procctl_kpti_ctl(p, val); + break; + case PROC_KPTI_STATUS: + cpu_procctl_kpti_status(p, &val); + break; + case PROC_LA_CTL: + error = cpu_procctl_la_ctl(p, val); + break; + case PROC_LA_STATUS: + cpu_procctl_la_status(p, &val); + break; } + PROC_UNLOCK(p); + if (com == PROC_KPTI_STATUS || com == PROC_LA_STATUS) + error = copyout(&val, data, sizeof(val)); break; default: error = EINVAL; Modified: head/sys/x86/include/procctl.h ============================================================================== --- head/sys/x86/include/procctl.h Sun Aug 23 20:25:10 2020 (r364529) +++ head/sys/x86/include/procctl.h Sun Aug 23 20:32:13 2020 (r364530) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2019 The FreeBSD Foundation + * Copyright (c) 2019,2020 The FreeBSD Foundation * * Portions of this software were developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. @@ -35,9 +35,18 @@ #define PROC_KPTI_CTL (PROC_PROCCTL_MD_MIN + 0) #define PROC_KPTI_STATUS (PROC_PROCCTL_MD_MIN + 1) +#define PROC_LA_CTL (PROC_PROCCTL_MD_MIN + 2) +#define PROC_LA_STATUS (PROC_PROCCTL_MD_MIN + 3) #define PROC_KPTI_CTL_ENABLE_ON_EXEC 1 #define PROC_KPTI_CTL_DISABLE_ON_EXEC 2 #define PROC_KPTI_STATUS_ACTIVE 0x80000000 + +#define PROC_LA_CTL_LA48_ON_EXEC 1 +#define PROC_LA_CTL_LA57_ON_EXEC 2 +#define PROC_LA_CTL_DEFAULT_ON_EXEC 3 + +#define PROC_LA_STATUS_LA48 0x01000000 +#define PROC_LA_STATUS_LA57 0x02000000 #endif From owner-svn-src-head@freebsd.org Sun Aug 23 20:37:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CAEB3C9A54; Sun, 23 Aug 2020 20:37:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRrf3Z0Jz4SZH; Sun, 23 Aug 2020 20:37:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C807CD71; Sun, 23 Aug 2020 20:37:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKbMrZ028603; Sun, 23 Aug 2020 20:37:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKbLou028599; Sun, 23 Aug 2020 20:37:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232037.07NKbLou028599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364531 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Commit-Revision: 364531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:37:22 -0000 Author: kib Date: Sun Aug 23 20:37:21 2020 New Revision: 364531 URL: https://svnweb.freebsd.org/changeset/base/364531 Log: Add bhyve support for LA57 guest mode. Noted and reviewed by: grehan Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm_instruction_emul.c head/usr.sbin/bhyve/gdb.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sun Aug 23 20:32:13 2020 (r364530) +++ head/sys/amd64/include/vmm.h Sun Aug 23 20:37:21 2020 (r364531) @@ -522,6 +522,7 @@ enum vm_paging_mode { PAGING_MODE_32, PAGING_MODE_PAE, PAGING_MODE_64, + PAGING_MODE_64_LA57, }; struct vm_guest_paging { Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun Aug 23 20:32:13 2020 (r364530) +++ head/sys/amd64/vmm/intel/vmx.c Sun Aug 23 20:37:21 2020 (r364531) @@ -1940,14 +1940,18 @@ vmx_cpu_mode(void) static enum vm_paging_mode vmx_paging_mode(void) { + uint64_t cr4; if (!(vmcs_read(VMCS_GUEST_CR0) & CR0_PG)) return (PAGING_MODE_FLAT); - if (!(vmcs_read(VMCS_GUEST_CR4) & CR4_PAE)) + cr4 = vmcs_read(VMCS_GUEST_CR4); + if (!(cr4 & CR4_PAE)) return (PAGING_MODE_32); - if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LME) - return (PAGING_MODE_64); - else + if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LME) { + if (!(cr4 & CR4_LA57)) + return (PAGING_MODE_64); + return (PAGING_MODE_64_LA57); + } else return (PAGING_MODE_PAE); } Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Sun Aug 23 20:32:13 2020 (r364530) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Sun Aug 23 20:37:21 2020 (r364531) @@ -2189,8 +2189,12 @@ restart: ptpphys = pte; nlevels = 2; - } else + } else if (paging->paging_mode == PAGING_MODE_64_LA57) { + nlevels = 5; + } else { nlevels = 4; + } + while (--nlevels >= 0) { /* Zero out the lower 12 bits and the upper 12 bits */ ptpphys >>= 12; ptpphys <<= 24; ptpphys >>= 12; Modified: head/usr.sbin/bhyve/gdb.c ============================================================================== --- head/usr.sbin/bhyve/gdb.c Sun Aug 23 20:32:13 2020 (r364530) +++ head/usr.sbin/bhyve/gdb.c Sun Aug 23 20:37:21 2020 (r364531) @@ -251,7 +251,8 @@ guest_paging_info(int vcpu, struct vm_guest_paging *pa else if (!(regs[2] & CR4_PAE)) paging->paging_mode = PAGING_MODE_32; else if (regs[3] & EFER_LME) - paging->paging_mode = PAGING_MODE_64; + paging->paging_mode = (regs[2] & CR4_LA57) ? + PAGING_MODE_64_LA57 : PAGING_MODE_64; else paging->paging_mode = PAGING_MODE_PAE; return (0); From owner-svn-src-head@freebsd.org Sun Aug 23 20:38:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E32523C9C3E; Sun, 23 Aug 2020 20:38:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRsZ5mT6z4SY5; Sun, 23 Aug 2020 20:38:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAEA2D140; Sun, 23 Aug 2020 20:38:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKcAjg028684; Sun, 23 Aug 2020 20:38:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKcAxR028683; Sun, 23 Aug 2020 20:38:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008232038.07NKcAxR028683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 23 Aug 2020 20:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364532 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:38:11 -0000 Author: imp Date: Sun Aug 23 20:38:10 2020 New Revision: 364532 URL: https://svnweb.freebsd.org/changeset/base/364532 Log: Fix another minor style glitch. Pull { to the end of the struct line rather than having them on their own line. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Aug 23 20:37:21 2020 (r364531) +++ head/sys/kern/subr_bus.c Sun Aug 23 20:38:10 2020 (r364532) @@ -392,16 +392,14 @@ static struct cdevsw dev_cdevsw = { .d_name = "devctl", }; -struct dev_event_info -{ +struct dev_event_info { char *dei_data; STAILQ_ENTRY(dev_event_info) dei_link; }; STAILQ_HEAD(devq, dev_event_info); -static struct dev_softc -{ +static struct dev_softc { int inuse; int nonblock; int queued; From owner-svn-src-head@freebsd.org Sun Aug 23 20:40:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E975D3C9C5E; Sun, 23 Aug 2020 20:40:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRwM5xWWz4Sls; Sun, 23 Aug 2020 20:40:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE480D142; Sun, 23 Aug 2020 20:40:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKeZKc030818; Sun, 23 Aug 2020 20:40:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKeZP2030797; Sun, 23 Aug 2020 20:40:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232040.07NKeZP2030797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364533 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 364533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:40:36 -0000 Author: kib Date: Sun Aug 23 20:40:35 2020 New Revision: 364533 URL: https://svnweb.freebsd.org/changeset/base/364533 Log: amd64: Handle 5-level paging for efirt calls. Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/amd64/amd64/efirt_machdep.c Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Sun Aug 23 20:38:10 2020 (r364532) +++ head/sys/amd64/amd64/efirt_machdep.c Sun Aug 23 20:40:35 2020 (r364533) @@ -61,9 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +static pml5_entry_t *efi_pml5; static pml4_entry_t *efi_pml4; static vm_object_t obj_1t1_pt; -static vm_page_t efi_pml4_page; +static vm_page_t efi_pmltop_page; static vm_pindex_t efi_1t1_idx; void @@ -82,7 +83,8 @@ efi_destroy_1t1_map(void) obj_1t1_pt = NULL; efi_pml4 = NULL; - efi_pml4_page = NULL; + efi_pml5 = NULL; + efi_pmltop_page = NULL; } /* @@ -109,22 +111,38 @@ efi_1t1_page(void) static pt_entry_t * efi_1t1_pte(vm_offset_t va) { + pml5_entry_t *pml5e; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t *pde; pt_entry_t *pte; vm_page_t m; - vm_pindex_t pml4_idx, pdp_idx, pd_idx; + vm_pindex_t pml5_idx, pml4_idx, pdp_idx, pd_idx; vm_paddr_t mphys; pml4_idx = pmap_pml4e_index(va); - pml4e = &efi_pml4[pml4_idx]; + if (la57) { + pml5_idx = pmap_pml5e_index(va); + pml5e = &efi_pml5[pml5_idx]; + if (*pml5e == 0) { + m = efi_1t1_page(); + mphys = VM_PAGE_TO_PHYS(m); + *pml5e = mphys | X86_PG_RW | X86_PG_V; + } else { + mphys = *pml5e & PG_FRAME; + } + pml4e = (pml4_entry_t *)PHYS_TO_DMAP(mphys); + pml4e = &pml4e[pml4_idx]; + } else { + pml4e = &efi_pml4[pml4_idx]; + } + if (*pml4e == 0) { m = efi_1t1_page(); mphys = VM_PAGE_TO_PHYS(m); *pml4e = mphys | X86_PG_RW | X86_PG_V; } else { - mphys = *pml4e & ~PAGE_MASK; + mphys = *pml4e & PG_FRAME; } pdpe = (pdp_entry_t *)PHYS_TO_DMAP(mphys); @@ -135,7 +153,7 @@ efi_1t1_pte(vm_offset_t va) mphys = VM_PAGE_TO_PHYS(m); *pdpe = mphys | X86_PG_RW | X86_PG_V; } else { - mphys = *pdpe & ~PAGE_MASK; + mphys = *pdpe & PG_FRAME; } pde = (pd_entry_t *)PHYS_TO_DMAP(mphys); @@ -146,7 +164,7 @@ efi_1t1_pte(vm_offset_t va) mphys = VM_PAGE_TO_PHYS(m); *pde = mphys | X86_PG_RW | X86_PG_V; } else { - mphys = *pde & ~PAGE_MASK; + mphys = *pde & PG_FRAME; } pte = (pt_entry_t *)PHYS_TO_DMAP(mphys); @@ -161,6 +179,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int { struct efi_md *p; pt_entry_t *pte; + void *pml; vm_offset_t va; uint64_t idx; int bits, i, mode; @@ -170,10 +189,16 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int VM_PROT_ALL, 0, NULL); efi_1t1_idx = 0; VM_OBJECT_WLOCK(obj_1t1_pt); - efi_pml4_page = efi_1t1_page(); + efi_pmltop_page = efi_1t1_page(); VM_OBJECT_WUNLOCK(obj_1t1_pt); - efi_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_pml4_page)); - pmap_pinit_pml4(efi_pml4_page); + pml = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_pmltop_page)); + if (la57) { + efi_pml5 = pml; + pmap_pinit_pml5(efi_pmltop_page); + } else { + efi_pml4 = pml; + pmap_pinit_pml4(efi_pmltop_page); + } for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, descsz)) { @@ -279,7 +304,7 @@ efi_arch_enter(void) if (pmap_pcid_enabled && !invpcid_works) PCPU_SET(curpmap, NULL); - load_cr3(VM_PAGE_TO_PHYS(efi_pml4_page) | (pmap_pcid_enabled ? + load_cr3(VM_PAGE_TO_PHYS(efi_pmltop_page) | (pmap_pcid_enabled ? curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0)); /* * If PCID is enabled, the clear CR3_PCID_SAVE bit in the loaded %cr3 From owner-svn-src-head@freebsd.org Sun Aug 23 20:43:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F8EB3C9F18; Sun, 23 Aug 2020 20:43:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZRzc0PRFz4TLZ; Sun, 23 Aug 2020 20:43:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB18AD58D; Sun, 23 Aug 2020 20:43:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKhNHN034720; Sun, 23 Aug 2020 20:43:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKhN2N034718; Sun, 23 Aug 2020 20:43:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232043.07NKhN2N034718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364534 - in head/sys: amd64/acpica amd64/amd64 x86/acpica X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/acpica amd64/amd64 x86/acpica X-SVN-Commit-Revision: 364534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:43:24 -0000 Author: kib Date: Sun Aug 23 20:43:23 2020 New Revision: 364534 URL: https://svnweb.freebsd.org/changeset/base/364534 Log: amd64: Handle 5-level paging on wakeup. We can switch into long mode directly with LA57 enabled. Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/amd64/cpu_switch.S head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Sun Aug 23 20:40:35 2020 (r364533) +++ head/sys/amd64/acpica/acpi_wakecode.S Sun Aug 23 20:43:23 2020 (r364534) @@ -148,10 +148,18 @@ wakeup_32: mov $bootdata32 - bootgdt, %eax mov %ax, %ds - /* Turn on the PAE bit for when paging is enabled */ + /* + * Turn on the PAE bit and optionally the LA57 bit for when paging + * is later enabled. + */ mov %cr4, %eax orl $CR4_PAE, %eax - mov %eax, %cr4 + leal wakeup_pagetables - wakeup_start(%ebx), %ecx + movl (%ecx), %ecx + testl $0x1, %ecx + je 1f + orl $CR4_LA57, %eax +1: mov %eax, %cr4 /* * Enable EFER.LME so that we get long mode when all the prereqs are @@ -174,6 +182,7 @@ wakeup_32: */ leal wakeup_pagetables - wakeup_start(%ebx), %eax movl (%eax), %eax + andl $~0x1, %eax mov %eax, %cr3 /* Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sun Aug 23 20:40:35 2020 (r364533) +++ head/sys/amd64/amd64/cpu_switch.S Sun Aug 23 20:43:23 2020 (r364534) @@ -382,8 +382,11 @@ END(savectx) * Resuming processor state from pcb. */ ENTRY(resumectx) - /* Switch to KPML4phys. */ + /* Switch to KPML5/4phys. */ movq KPML4phys,%rax + movq KPML5phys,%rcx + cmpl $0, la57 + cmovne %rcx, %rax movq %rax,%cr3 /* Force kernel segment registers. */ Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Sun Aug 23 20:40:35 2020 (r364533) +++ head/sys/x86/acpica/acpi_wakeup.c Sun Aug 23 20:43:23 2020 (r364534) @@ -99,7 +99,7 @@ static void acpi_wakeup_cpus(struct acpi_softc *); #endif #ifdef __amd64__ -#define ACPI_WAKEPAGES 4 +#define ACPI_WAKEPAGES 5 #else #define ACPI_WAKEPAGES 1 #endif @@ -414,8 +414,8 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) static void *wakeaddr; void *wakepages[ACPI_WAKEPAGES]; #ifdef __amd64__ - uint64_t *pt4, *pt3, *pt2; - vm_paddr_t pt4pa, pt3pa, pt2pa; + uint64_t *pt5, *pt4, *pt3, *pt2; + vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; int i; #endif @@ -430,6 +430,10 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) sc->acpi_wakephys = vtophys(wakeaddr); #ifdef __amd64__ + if (la57) { + pt5 = wakepages[4]; + pt5pa = vtophys(pt5); + } pt4 = wakepages[1]; pt3 = wakepages[2]; pt2 = wakepages[3]; @@ -448,7 +452,8 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) #ifdef __amd64__ WAKECODE_FIXUP((wakeup_sw64 + 1), uint32_t, sc->acpi_wakephys + wakeup_64); - WAKECODE_FIXUP(wakeup_pagetables, uint32_t, pt4pa); + WAKECODE_FIXUP(wakeup_pagetables, uint32_t, la57 ? (pt5pa | 0x1) : + pt4pa); #endif /* Save pointers to some global data. */ @@ -457,7 +462,12 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); #else /* __amd64__ */ /* Create the initial 1GB replicated page tables */ - for (i = 0; i < 512; i++) { + for (i = 0; i < NPTEPG; i++) { + if (la57) { + pt5[i] = (uint64_t)pt4pa; + pt5[i] |= PG_V | PG_RW | PG_U; + } + /* * Each slot of the level 4 pages points * to the same level 3 page @@ -473,7 +483,7 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) pt3[i] |= PG_V | PG_RW | PG_U; /* The level 2 page slots are mapped with 2MB pages for 1GB. */ - pt2[i] = i * (2 * 1024 * 1024); + pt2[i] = i * NBPDR; pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; } #endif /* !__amd64__ */ From owner-svn-src-head@freebsd.org Sun Aug 23 20:44:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F9633C9FB6; Sun, 23 Aug 2020 20:44:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZS0c0zT2z4TDm; Sun, 23 Aug 2020 20:44:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04CBED39B; Sun, 23 Aug 2020 20:44:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NKiFH8034830; Sun, 23 Aug 2020 20:44:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NKiF4h034829; Sun, 23 Aug 2020 20:44:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008232044.07NKiF4h034829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Aug 2020 20:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364535 - head/usr.bin/proccontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/proccontrol X-SVN-Commit-Revision: 364535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 20:44:16 -0000 Author: kib Date: Sun Aug 23 20:44:15 2020 New Revision: 364535 URL: https://svnweb.freebsd.org/changeset/base/364535 Log: procctl(8): usermode bits to force LA58/LA57 on exec. Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D25273 Modified: head/usr.bin/proccontrol/proccontrol.1 head/usr.bin/proccontrol/proccontrol.c Modified: head/usr.bin/proccontrol/proccontrol.1 ============================================================================== --- head/usr.bin/proccontrol/proccontrol.1 Sun Aug 23 20:43:23 2020 (r364534) +++ head/usr.bin/proccontrol/proccontrol.1 Sun Aug 23 20:44:15 2020 (r364535) @@ -71,6 +71,9 @@ Controls the implicit PROT_MAX application for .Xr mmap 2 . .It Ar kpti Controls the KPTI enable, AMD64 only. +.It Ar la48 +Control limiting usermode process address space to 48 bits of address, +AMD64 only, on machines capable of 57-bit addressing. .El .Pp The Modified: head/usr.bin/proccontrol/proccontrol.c ============================================================================== --- head/usr.bin/proccontrol/proccontrol.c Sun Aug 23 20:43:23 2020 (r364534) +++ head/usr.bin/proccontrol/proccontrol.c Sun Aug 23 20:44:15 2020 (r364535) @@ -48,6 +48,10 @@ enum { #ifdef PROC_KPTI_CTL MODE_KPTI, #endif +#ifdef PROC_LA_CTL + MODE_LA57, + MODE_LA48, +#endif }; static pid_t @@ -69,13 +73,18 @@ str2pid(const char *str) #else #define KPTI_USAGE #endif +#ifdef PROC_LA_CTL +#define LA_USAGE "|la48|la57" +#else +#define LA_USAGE +#endif static void __dead2 usage(void) { fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|" - "stackgap"KPTI_USAGE") [-q] " + "stackgap"KPTI_USAGE LA_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -108,6 +117,12 @@ main(int argc, char *argv[]) else if (strcmp(optarg, "kpti") == 0) mode = MODE_KPTI; #endif +#ifdef PROC_LA_CTL + else if (strcmp(optarg, "la57") == 0) + mode = MODE_LA57; + else if (strcmp(optarg, "la48") == 0) + mode = MODE_LA48; +#endif else usage(); break; @@ -164,6 +179,12 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); break; #endif +#ifdef PROC_LA_CTL + case MODE_LA57: + case MODE_LA48: + error = procctl(P_PID, pid, PROC_LA_STATUS, &arg); + break; +#endif default: usage(); break; @@ -259,6 +280,27 @@ main(int argc, char *argv[]) printf(", not active\n"); break; #endif +#ifdef PROC_LA_CTL + case MODE_LA57: + case MODE_LA48: + switch (arg & ~(PROC_LA_STATUS_LA48 | + PROC_LA_STATUS_LA57)) { + case PROC_LA_CTL_LA48_ON_EXEC: + printf("la48 on exec"); + break; + case PROC_LA_CTL_LA57_ON_EXEC: + printf("la57 on exec"); + break; + case PROC_LA_CTL_DEFAULT_ON_EXEC: + printf("default on exec"); + break; + } + if ((arg & PROC_LA_STATUS_LA48) != 0) + printf(", la48 active\n"); + else if ((arg & PROC_LA_STATUS_LA57) != 0) + printf(", la57 active\n"); + break; +#endif } } else { switch (mode) { @@ -293,6 +335,18 @@ main(int argc, char *argv[]) arg = enable ? PROC_KPTI_CTL_ENABLE_ON_EXEC : PROC_KPTI_CTL_DISABLE_ON_EXEC; error = procctl(P_PID, pid, PROC_KPTI_CTL, &arg); + break; +#endif +#ifdef PROC_LA_CTL + case MODE_LA57: + arg = enable ? PROC_LA_CTL_LA57_ON_EXEC : + PROC_LA_CTL_DEFAULT_ON_EXEC; + error = procctl(P_PID, pid, PROC_LA_CTL, &arg); + break; + case MODE_LA48: + arg = enable ? PROC_LA_CTL_LA48_ON_EXEC : + PROC_LA_CTL_DEFAULT_ON_EXEC; + error = procctl(P_PID, pid, PROC_LA_CTL, &arg); break; #endif default: From owner-svn-src-head@freebsd.org Sun Aug 23 21:04:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 386253CAE75; Sun, 23 Aug 2020 21:04:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZSS40jRqz4W6s; Sun, 23 Aug 2020 21:04:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6987DA86; Sun, 23 Aug 2020 21:04:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NL4ZtJ047482; Sun, 23 Aug 2020 21:04:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NL4ZqD047481; Sun, 23 Aug 2020 21:04:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008232104.07NL4ZqD047481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 21:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364538 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:04:36 -0000 Author: mjg Date: Sun Aug 23 21:04:35 2020 New Revision: 364538 URL: https://svnweb.freebsd.org/changeset/base/364538 Log: vfs: factor away doomed vnode handling into vdropl_final Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 23 21:04:22 2020 (r364537) +++ head/sys/kern/vfs_subr.c Sun Aug 23 21:04:35 2020 (r364538) @@ -3437,6 +3437,33 @@ vdrop_deactivate(struct vnode *vp) vdbatch_enqueue(vp); } +static void __noinline +vdropl_final(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(VN_IS_DOOMED(vp), vp); + /* + * Set the VHOLD_NO_SMR flag. + * + * We may be racing against vhold_smr. If they win we can just pretend + * we never got this far, they will vdrop later. + */ + if (__predict_false(!atomic_cmpset_int(&vp->v_holdcnt, 0, VHOLD_NO_SMR))) { + vn_freevnodes_inc(); + VI_UNLOCK(vp); + /* + * We lost the aforementioned race. Any subsequent access is + * invalid as they might have managed to vdropl on their own. + */ + return; + } + /* + * Don't bump freevnodes as this one is going away. + */ + freevnode(vp); +} + void vdrop(struct vnode *vp) { @@ -3469,25 +3496,7 @@ vdropl(struct vnode *vp) */ return; } - /* - * Set the VHOLD_NO_SMR flag. - * - * We may be racing against vhold_smr. If they win we can just pretend - * we never got this far, they will vdrop later. - */ - if (__predict_false(!atomic_cmpset_int(&vp->v_holdcnt, 0, VHOLD_NO_SMR))) { - vn_freevnodes_inc(); - VI_UNLOCK(vp); - /* - * We lost the aforementioned race. Any subsequent access is - * invalid as they might have managed to vdropl on their own. - */ - return; - } - /* - * Don't bump freevnodes as this one is going away. - */ - freevnode(vp); + vdropl_final(vp); } /* From owner-svn-src-head@freebsd.org Sun Aug 23 21:05:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DB623CAF7E; Sun, 23 Aug 2020 21:05:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZSSg1QVTz4WRJ; Sun, 23 Aug 2020 21:05:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14720DA87; Sun, 23 Aug 2020 21:05:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NL56Yh047578; Sun, 23 Aug 2020 21:05:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NL56l5047577; Sun, 23 Aug 2020 21:05:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008232105.07NL56l5047577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 21:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364539 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:05:07 -0000 Author: mjg Date: Sun Aug 23 21:05:06 2020 New Revision: 364539 URL: https://svnweb.freebsd.org/changeset/base/364539 Log: vfs: support denying access in vaccess_vexec_smr Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 23 21:04:35 2020 (r364538) +++ head/sys/kern/vfs_subr.c Sun Aug 23 21:05:06 2020 (r364539) @@ -5041,8 +5041,6 @@ vn_isdisk(struct vnode *vp) /* * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see * the comment above cache_fplookup for details. - * - * We never deny as priv_check_cred calls are not yet supported, see vaccess. */ int vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred) @@ -5054,20 +5052,32 @@ vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gi if (cred->cr_uid == file_uid) { if (file_mode & S_IXUSR) return (0); - return (EAGAIN); + goto out_error; } /* Otherwise, check the groups (first match) */ if (groupmember(file_gid, cred)) { if (file_mode & S_IXGRP) return (0); - return (EAGAIN); + goto out_error; } /* Otherwise, check everyone else. */ if (file_mode & S_IXOTH) return (0); - return (EAGAIN); +out_error: + /* + * Permission check failed. + * + * vaccess() calls priv_check_cred which in turn can descent into MAC + * modules overriding this result. It's quite unclear what semantics + * are allowed for them to operate, thus for safety we don't call them + * from within the SMR section. This also means if any such modules + * are present, we have to let the regular lookup decide. + */ + if (__predict_false(mac_priv_check_fp_flag || mac_priv_grant_fp_flag)) + return (EAGAIN); + return (EACCES); } /* From owner-svn-src-head@freebsd.org Sun Aug 23 21:05:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 085D63CB198; Sun, 23 Aug 2020 21:05:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZSTH6WnLz4WYL; Sun, 23 Aug 2020 21:05:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C402FDA12; Sun, 23 Aug 2020 21:05:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NL5dNd047652; Sun, 23 Aug 2020 21:05:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NL5dKx047651; Sun, 23 Aug 2020 21:05:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008232105.07NL5dKx047651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 21:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364540 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 364540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:05:40 -0000 Author: mjg Date: Sun Aug 23 21:05:39 2020 New Revision: 364540 URL: https://svnweb.freebsd.org/changeset/base/364540 Log: vfs: convert nameiop into an enum While here change the field size from long to int and move it into the gap next to cn_flags. Shrinks struct componentname from 64 to 56 bytes on amd64. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Aug 23 21:05:06 2020 (r364539) +++ head/sys/kern/vfs_lookup.c Sun Aug 23 21:05:39 2020 (r364540) @@ -484,10 +484,6 @@ namei(struct nameidata *ndp) td = cnp->cn_thread; ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); - KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, - ("namei: nameiop contaminated with flags")); - KASSERT((cnp->cn_flags & OPMASK) == 0, - ("namei: flags contaminated with nameiops")); KASSERT((cnp->cn_flags & NAMEI_INTERNAL_FLAGS) == 0, ("namei: unexpected flags: %" PRIx64 "\n", cnp->cn_flags & NAMEI_INTERNAL_FLAGS)); Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sun Aug 23 21:05:06 2020 (r364539) +++ head/sys/sys/namei.h Sun Aug 23 21:05:39 2020 (r364540) @@ -40,14 +40,16 @@ #include #include +enum nameiop { LOOKUP, CREATE, DELETE, RENAME }; + struct componentname { /* * Arguments to lookup. */ - u_long cn_nameiop; /* namei operation */ u_int64_t cn_flags; /* flags to namei */ struct thread *cn_thread;/* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ + enum nameiop cn_nameiop; /* namei operation */ int cn_lkflags; /* Lock flags LK_EXCLUSIVE or LK_SHARED */ /* * Shared between lookup and commit routines. @@ -115,13 +117,10 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f struct pwd **pwdp); /* - * namei operations + * Flags for namei. + * + * If modifying the list make sure to check whether NDVALIDATE needs updating. */ -#define LOOKUP 0 /* perform name lookup only */ -#define CREATE 1 /* setup for file creation */ -#define DELETE 2 /* setup for file deletion */ -#define RENAME 3 /* setup for file renaming */ -#define OPMASK 3 /* mask for operation */ /* * namei operational modifier flags, stored in ni_cnd.flags */ From owner-svn-src-head@freebsd.org Sun Aug 23 21:06:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EFAD3CB25F; Sun, 23 Aug 2020 21:06:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZSVV2PmHz4WqG; Sun, 23 Aug 2020 21:06:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36375D454; Sun, 23 Aug 2020 21:06:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NL6giR047821; Sun, 23 Aug 2020 21:06:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NL6f4V047820; Sun, 23 Aug 2020 21:06:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008232106.07NL6f4V047820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Aug 2020 21:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364542 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 364542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:06:42 -0000 Author: mjg Date: Sun Aug 23 21:06:41 2020 New Revision: 364542 URL: https://svnweb.freebsd.org/changeset/base/364542 Log: vfs: validate ndp state after the lookup The intent is to remove known-to-be-nops NDFREE calls after many lookups. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Aug 23 21:05:54 2020 (r364541) +++ head/sys/kern/vfs_lookup.c Sun Aug 23 21:06:41 2020 (r364542) @@ -482,6 +482,15 @@ namei(struct nameidata *ndp) cnp = &ndp->ni_cnd; td = cnp->cn_thread; +#ifdef INVARIANTS + /* + * For NDVALIDATE. + * + * While NDINIT may seem like a more natural place to do it, there are + * callers which directly modify flags past invoking init. + */ + cnp->cn_origflags = cnp->cn_flags; +#endif ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); KASSERT((cnp->cn_flags & NAMEI_INTERNAL_FLAGS) == 0, @@ -542,6 +551,8 @@ namei(struct nameidata *ndp) __assert_unreachable(); break; case CACHE_FPL_STATUS_HANDLED: + if (error == 0) + NDVALIDATE(ndp); return (error); case CACHE_FPL_STATUS_PARTIAL: TAILQ_INIT(&ndp->ni_cap_tracker); @@ -584,6 +595,8 @@ namei(struct nameidata *ndp) SDT_PROBE3(vfs, namei, lookup, return, error, (error == 0 ? ndp->ni_vp : NULL), false); pwd_drop(pwd); + if (error == 0) + NDVALIDATE(ndp); return (error); } if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { @@ -1432,6 +1445,68 @@ void ndp->ni_startdir = NULL; } } + +#ifdef INVARIANTS +/* + * Validate the final state of ndp after the lookup. + * + * Historically filesystems were allowed to modify cn_flags. Most notably they + * can add SAVENAME to the request, resulting in HASBUF and pushing subsequent + * clean up to the consumer. In practice this seems to only concern != LOOKUP + * operations. + * + * As a step towards stricter API contract this routine validates the state to + * clean up. Note validation is a work in progress with the intent of becoming + * stricter over time. + */ +#define NDMODIFYINGFLAGS (LOCKLEAF | LOCKPARENT | WANTPARENT | SAVENAME | SAVESTART | HASBUF) +void +NDVALIDATE(struct nameidata *ndp) +{ + struct componentname *cnp; + u_int64_t used, orig; + + cnp = &ndp->ni_cnd; + orig = cnp->cn_origflags; + used = cnp->cn_flags; + switch (cnp->cn_nameiop) { + case LOOKUP: + /* + * For plain lookup we require strict conformance -- nothing + * to clean up if it was not requested by the caller. + */ + orig &= NDMODIFYINGFLAGS; + used &= NDMODIFYINGFLAGS; + if ((orig & (SAVENAME | SAVESTART)) != 0) + orig |= HASBUF; + if (orig != used) { + goto out_mismatch; + } + break; + case CREATE: + case DELETE: + case RENAME: + /* + * Some filesystems set SAVENAME to provoke HASBUF, accomodate + * for it until it gets fixed. + */ + orig &= NDMODIFYINGFLAGS; + orig |= (SAVENAME | HASBUF); + used &= NDMODIFYINGFLAGS; + used |= (SAVENAME | HASBUF); + if (orig != used) { + goto out_mismatch; + } + break; + } + return; +out_mismatch: + panic("%s: mismatched flags for op %d: added %" PRIx64 ", " + "removed %" PRIx64" (%" PRIx64" != %" PRIx64"; stored %" PRIx64" != %" PRIx64")", + __func__, cnp->cn_nameiop, used & ~orig, orig &~ used, + orig, used, cnp->cn_origflags, cnp->cn_flags); +} +#endif /* * Determine if there is a suitable alternate filename under the specified Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sun Aug 23 21:05:54 2020 (r364541) +++ head/sys/sys/namei.h Sun Aug 23 21:06:41 2020 (r364542) @@ -46,6 +46,7 @@ struct componentname { /* * Arguments to lookup. */ + u_int64_t cn_origflags; /* flags to namei */ u_int64_t cn_flags; /* flags to namei */ struct thread *cn_thread;/* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ @@ -250,6 +251,12 @@ void NDFREE(struct nameidata *, const u_int); else \ NDFREE(_ndp, flags); \ } while (0) + +#ifdef INVARIANTS +void NDVALIDATE(struct nameidata *); +#else +#define NDVALIDATE(ndp) do { } while (0) +#endif int namei(struct nameidata *ndp); int lookup(struct nameidata *ndp); From owner-svn-src-head@freebsd.org Sun Aug 23 21:37:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11F833CC0BC; Sun, 23 Aug 2020 21:37:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZT9r6dpQz4ZBd; Sun, 23 Aug 2020 21:37:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F0FE004; Sun, 23 Aug 2020 21:37:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NLbKXO066885; Sun, 23 Aug 2020 21:37:20 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NLbKC6066884; Sun, 23 Aug 2020 21:37:20 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008232137.07NLbKC6066884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 23 Aug 2020 21:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364551 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 364551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:37:21 -0000 Author: bz Date: Sun Aug 23 21:37:20 2020 New Revision: 364551 URL: https://svnweb.freebsd.org/changeset/base/364551 Log: net80211: set_vht_extchan() reverse order to always return best In set_vht_extchan() the checks are performed in the order of VHT20/40/80. That means if a channel has a lower and higheer VHT flag set we would return the lower first. We normally do not set more than one VHT flag so this change is supposed to be a NOP but follows the logical thinking order of returning the best first. Also we nowhere assert a single VHT flag so make sure we'll not be stuck with VHT20 when we could do more. While here add the debugging printfs for VHT160 and VHT80P80 which still need doing once we deal with a driver at that level. Reviewed by: adrian, gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26088 Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Aug 23 21:35:23 2020 (r364550) +++ head/sys/net80211/ieee80211.c Sun Aug 23 21:37:20 2020 (r364551) @@ -1168,23 +1168,17 @@ set_vht_extchan(struct ieee80211_channel *c) { int i; - if (! IEEE80211_IS_CHAN_VHT(c)) { + if (! IEEE80211_IS_CHAN_VHT(c)) return (0); - } - if (IEEE80211_IS_CHAN_VHT20(c)) { - c->ic_vht_ch_freq1 = c->ic_ieee; - return (1); + if (IEEE80211_IS_CHAN_VHT80P80(c)) { + printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n", + __func__, c->ic_ieee, c->ic_flags); } - if (IEEE80211_IS_CHAN_VHT40(c)) { - if (IEEE80211_IS_CHAN_HT40U(c)) - c->ic_vht_ch_freq1 = c->ic_ieee + 2; - else if (IEEE80211_IS_CHAN_HT40D(c)) - c->ic_vht_ch_freq1 = c->ic_ieee - 2; - else - return (0); - return (1); + if (IEEE80211_IS_CHAN_VHT160(c)) { + printf("%s: TODO VHT160 channel (ieee=%d, flags=0x%08x)\n", + __func__, c->ic_ieee, c->ic_flags); } if (IEEE80211_IS_CHAN_VHT80(c)) { @@ -1206,6 +1200,21 @@ set_vht_extchan(struct ieee80211_channel *c) } } return (0); + } + + if (IEEE80211_IS_CHAN_VHT40(c)) { + if (IEEE80211_IS_CHAN_HT40U(c)) + c->ic_vht_ch_freq1 = c->ic_ieee + 2; + else if (IEEE80211_IS_CHAN_HT40D(c)) + c->ic_vht_ch_freq1 = c->ic_ieee - 2; + else + return (0); + return (1); + } + + if (IEEE80211_IS_CHAN_VHT20(c)) { + c->ic_vht_ch_freq1 = c->ic_ieee; + return (1); } printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", From owner-svn-src-head@freebsd.org Sun Aug 23 21:42:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17E8C3CC513; Sun, 23 Aug 2020 21:42:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZTHg6wDtz4Znp; Sun, 23 Aug 2020 21:42:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7DBDE02A; Sun, 23 Aug 2020 21:42:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NLgNTe073019; Sun, 23 Aug 2020 21:42:23 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NLgNKi073018; Sun, 23 Aug 2020 21:42:23 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008232142.07NLgNKi073018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 23 Aug 2020 21:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364553 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 364553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:42:24 -0000 Author: bz Date: Sun Aug 23 21:42:23 2020 New Revision: 364553 URL: https://svnweb.freebsd.org/changeset/base/364553 Log: net80211: improve media information for VHT5GHZ Improve ieee80211_media_setup(), media2mode(), and ieee80211_rate2media() for VHT5GHZ at least. Reviewed by: adrian, gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26089 Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Aug 23 21:38:48 2020 (r364552) +++ head/sys/net80211/ieee80211.c Sun Aug 23 21:42:23 2020 (r364553) @@ -1920,12 +1920,18 @@ ieee80211_media_setup(struct ieee80211com *ic, /* * Add VHT media. + * XXX-BZ skip "VHT_2GHZ" for now. */ - for (; mode <= IEEE80211_MODE_VHT_5GHZ; mode++) { + for (mode = IEEE80211_MODE_VHT_5GHZ; mode <= IEEE80211_MODE_VHT_5GHZ; + mode++) { if (isclr(ic->ic_modecaps, mode)) continue; addmedia(media, caps, addsta, mode, IFM_AUTO); addmedia(media, caps, addsta, mode, IFM_IEEE80211_VHT); + } + if (isset(ic->ic_modecaps, IEEE80211_MODE_VHT_5GHZ)) { + addmedia(media, caps, addsta, + IEEE80211_MODE_AUTO, IFM_IEEE80211_VHT); /* XXX TODO: VHT maxrate */ } @@ -2044,6 +2050,12 @@ media2mode(const struct ifmedia_entry *ime, uint32_t f case IFM_IEEE80211_11NG: *mode = IEEE80211_MODE_11NG; break; + case IFM_IEEE80211_VHT2G: + *mode = IEEE80211_MODE_VHT_2GHZ; + break; + case IFM_IEEE80211_VHT5G: + *mode = IEEE80211_MODE_VHT_5GHZ; + break; case IFM_AUTO: *mode = IEEE80211_MODE_AUTO; break; @@ -2387,12 +2399,36 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate { 75, IFM_IEEE80211_MCS }, { 76, IFM_IEEE80211_MCS }, }; + static const struct ratemedia vhtrates[] = { + { 0, IFM_IEEE80211_VHT }, + { 1, IFM_IEEE80211_VHT }, + { 2, IFM_IEEE80211_VHT }, + { 3, IFM_IEEE80211_VHT }, + { 4, IFM_IEEE80211_VHT }, + { 5, IFM_IEEE80211_VHT }, + { 6, IFM_IEEE80211_VHT }, + { 7, IFM_IEEE80211_VHT }, + { 8, IFM_IEEE80211_VHT }, /* Optional. */ + { 9, IFM_IEEE80211_VHT }, /* Optional. */ +#if 0 + /* Some QCA and BRCM seem to support this; offspec. */ + { 10, IFM_IEEE80211_VHT }, + { 11, IFM_IEEE80211_VHT }, +#endif + }; int m; /* - * Check 11n rates first for match as an MCS. + * Check 11ac/11n rates first for match as an MCS. */ - if (mode == IEEE80211_MODE_11NA) { + if (mode == IEEE80211_MODE_VHT_5GHZ) { + if (rate & IFM_IEEE80211_VHT) { + rate &= ~IFM_IEEE80211_VHT; + m = findmedia(vhtrates, nitems(vhtrates), rate); + if (m != IFM_AUTO) + return (m | IFM_IEEE80211_VHT); + } + } else if (mode == IEEE80211_MODE_11NA) { if (rate & IEEE80211_RATE_MCS) { rate &= ~IEEE80211_RATE_MCS; m = findmedia(htrates, nitems(htrates), rate); From owner-svn-src-head@freebsd.org Sun Aug 23 23:56:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B158D3A8204; Sun, 23 Aug 2020 23:56: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZXGy4CMjz3YfZ; Sun, 23 Aug 2020 23:56:58 +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 736F4F99B; Sun, 23 Aug 2020 23:56:58 +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 07NNuwaP055657; Sun, 23 Aug 2020 23:56:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NNuwjY055655; Sun, 23 Aug 2020 23:56:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008232356.07NNuwjY055655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 23 Aug 2020 23:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364600 - in head/secure/caroot: blacklisted trusted X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/secure/caroot: blacklisted trusted X-SVN-Commit-Revision: 364600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 23:56:58 -0000 Author: kevans Date: Sun Aug 23 23:56:57 2020 New Revision: 364600 URL: https://svnweb.freebsd.org/changeset/base/364600 Log: caroot: switch to using echo+shell glob to enumerate certs This solves an issue on stable/12 that causes certs to not get installed. ls is apparently not in PATH during installworld, so TRUSTED_CERTS ends up blank and nothing gets installed. We don't really require anything ls-specific, though, so let's just simplify it. MFC after: 3 days Modified: head/secure/caroot/blacklisted/Makefile head/secure/caroot/trusted/Makefile Modified: head/secure/caroot/blacklisted/Makefile ============================================================================== --- head/secure/caroot/blacklisted/Makefile Sun Aug 23 23:39:51 2020 (r364599) +++ head/secure/caroot/blacklisted/Makefile Sun Aug 23 23:56:57 2020 (r364600) @@ -2,7 +2,7 @@ BINDIR= /usr/share/certs/blacklisted -BLACKLISTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true +BLACKLISTED_CERTS!= echo ${.CURDIR}/*.pem 2> /dev/null || true FILES+= ${BLACKLISTED_CERTS} Modified: head/secure/caroot/trusted/Makefile ============================================================================== --- head/secure/caroot/trusted/Makefile Sun Aug 23 23:39:51 2020 (r364599) +++ head/secure/caroot/trusted/Makefile Sun Aug 23 23:56:57 2020 (r364600) @@ -2,7 +2,7 @@ BINDIR= /usr/share/certs/trusted -TRUSTED_CERTS!= ls ${.CURDIR}/*.pem 2> /dev/null || true +TRUSTED_CERTS!= echo ${.CURDIR}/*.pem 2> /dev/null || true FILES+= ${TRUSTED_CERTS} From owner-svn-src-head@freebsd.org Mon Aug 24 01:51:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38BF33AA6D0; Mon, 24 Aug 2020 01:51:18 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZZpt0hrbz3fBg; Mon, 24 Aug 2020 01:51:18 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFF9410CE0; Mon, 24 Aug 2020 01:51:17 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O1pH15025686; Mon, 24 Aug 2020 01:51:17 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O1pHrW025685; Mon, 24 Aug 2020 01:51:17 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202008240151.07O1pHrW025685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 24 Aug 2020 01:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364602 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 364602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 01:51:18 -0000 Author: chuck Date: Mon Aug 24 01:51:17 2020 New Revision: 364602 URL: https://svnweb.freebsd.org/changeset/base/364602 Log: bhyve: NVMe set nominal health values Some operating systems believe bhyve's emulated NVMe drive is failing based on certain values in the SMART / Health Information log page being zero. Fix is to set the reported temperature and available spare values to reasonable defaults. Submitted by: wanpengqian@gmail.com Reviewed by: grehan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24202 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Mon Aug 24 01:11:29 2020 (r364601) +++ head/usr.sbin/bhyve/pci_nvme.c Mon Aug 24 01:51:17 2020 (r364602) @@ -604,6 +604,11 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) /* Set read/write remainder to round up according to spec */ sc->read_dunits_remainder = 999; sc->write_dunits_remainder = 999; + + /* Set nominal Health values checked by implementations */ + sc->health_log.temperature = 310; + sc->health_log.available_spare = 100; + sc->health_log.available_spare_threshold = 10; } static void From owner-svn-src-head@freebsd.org Mon Aug 24 01:51:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AE953AA953; Mon, 24 Aug 2020 01:51:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZZpy0vwsz3dxl; Mon, 24 Aug 2020 01:51:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0186310C67; Mon, 24 Aug 2020 01:51:22 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O1pLRV025730; Mon, 24 Aug 2020 01:51:21 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O1pLvx025729; Mon, 24 Aug 2020 01:51:21 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <202008240151.07O1pLvx025729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Mon, 24 Aug 2020 01:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364603 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 364603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 01:51:22 -0000 Author: chuck Date: Mon Aug 24 01:51:21 2020 New Revision: 364603 URL: https://svnweb.freebsd.org/changeset/base/364603 Log: bhyve: NVMe queue create must init head/tail The NVMe emulation code did not explicitly initialize queue head and tail pointers on queue creation. As these pointers are part of calloc()'ed memory, this only becomes a problem if the queues are deleted and then recreated. This error can manifest with messages about completions not matching a command. Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Mon Aug 24 01:51:17 2020 (r364602) +++ head/usr.sbin/bhyve/pci_nvme.c Mon Aug 24 01:51:21 2020 (r364603) @@ -932,6 +932,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc NVME_SC_MAXIMUM_QUEUE_SIZE_EXCEEDED); return (1); } + nsq->head = nsq->tail = 0; nsq->cqid = (command->cdw11 >> 16) & 0xffff; if ((nsq->cqid == 0) || (nsq->cqid > sc->num_cqueues)) { @@ -1053,6 +1054,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc NVME_SC_MAXIMUM_QUEUE_SIZE_EXCEEDED); return (1); } + ncq->head = ncq->tail = 0; ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(struct nvme_command) * (size_t)ncq->size); From owner-svn-src-head@freebsd.org Mon Aug 24 08:52:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94CAA3B5C5A; Mon, 24 Aug 2020 08:52:24 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZm8m3W69z4PNH; Mon, 24 Aug 2020 08:52:24 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3a495.dip0.t-ipconnect.de [79.211.164.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 08DEC28DA5; Mon, 24 Aug 2020 08:52:23 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Mon, 24 Aug 2020 10:52:23 +0200 From: Gordon Bergling To: Hiroki Sato Cc: gbe@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364449 - head/bin/ls Message-ID: <20200824085223.GA28970@lion.0xfce3.net> References: <202008210620.07L6KC6M091289@repo.freebsd.org> <20200822.194438.808130473746317382.hrs@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20200822.194438.808130473746317382.hrs@FreeBSD.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 10:14AM up 12 days, 11:45, 3 users, load averages: 3.35, 3.71, 3.85 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 08:52:24 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Hiroki, On Sat, Aug 22, 2020 at 07:44:38PM +0900, Hiroki Sato wrote: > Hi, >=20 > Gordon Bergling wrote > in <202008210620.07L6KC6M091289@repo.freebsd.org>: >=20 > gb> Author: gbe (doc committer) > gb> Date: Fri Aug 21 06:20:11 2020 > gb> New Revision: 364449 > gb> URL: https://svnweb.freebsd.org/changeset/base/364449 > gb> > gb> Log: > gb> ls(1): Update POSIX conformance from 2001 to 2008 > gb> > gb> - Update the options that are non-existing in POSIX from 2001 to 20= 08 > gb> - Update POSIX conformance in the STANDARDS section from 2001 to 20= 08 >=20 > Generally speaking, conformance with POSIX.1-2001 (SUSv3) and > POSIX.1-2008 (SUSv4) are independent, so a simple replacement by > s/2001/2008/ removes the former information. If we want to describe > -2008, please add it instead of replacing the prior version numbers. >=20 > -- Hiroki thanks for your feedback. I can only define POSIX.1-200{1,8} or -susv4. So = what do you think about the following STANDARDS section? For the options that are non-existing I could correct them to -2001 and men= tion also -susv4. STANDARDS With the exception of options -g, -n and -o, the ls utility conforms to IEEE Std 1003.1-2001 (=E2=80=9CPOSIX.1=E2=80=9D) and Version=C2=A04 of= the Single UNIX Specification (=E2=80=9CSUSv4=E2=80=9D). The options -B, -D, -G, -I, = -T, -U, -W, -Z, -b, -h, -w, -y and -, are compatible extensions not defined in IEEE Std 1003.1-2001 (=E2=80=9CPOSIX.1=E2=80=9D). --Gordon --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAl9Df8ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09z5yggAv22HrFPDGBKQRzMBbosxVlw8xAz3XcR+X4ZWoSEiLKvGPu6nC6CTskPe qOqbyxonrnSOCc5t+W/5Gpzft+118+43E9iWTEEikWL3NIxsk3JGjpcWy/Ra0Gvr 6X6A06KbjtgRzHJDSp/V0pw2DhqzZMLIHDei694u2uWsGuRv1yZMJY+U0BQM66mn ryZG0FWBygukr0/wlUnm/fmxJKj8Agu+cPLCi1e0kpolOa2bP/6axnzc+uL8yeqp eyECrKM+R3RwtabMWjuCY/IZYBZnEm46M4cglZjHw4Cwv6NOz/6EA2KpQMNuFoFE sGxoAFdbhwJ6AIvrQaP28d8HvlJHxg== =w4S+ -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-head@freebsd.org Mon Aug 24 08:55:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7E4D3B65AE; Mon, 24 Aug 2020 08:55:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmCr4qYZz4Pvc; Mon, 24 Aug 2020 08:55:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8868C1608D; Mon, 24 Aug 2020 08:55:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O8t47B090510; Mon, 24 Aug 2020 08:55:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O8t45T090509; Mon, 24 Aug 2020 08:55:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008240855.07O8t45T090509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 24 Aug 2020 08:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364631 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 08:55:04 -0000 Author: mjg Date: Mon Aug 24 08:55:04 2020 New Revision: 364631 URL: https://svnweb.freebsd.org/changeset/base/364631 Log: cache: populate v_cache_dd for non-VDIR entries It makes v_cache_dd into a little bit of a misnomer and it may be addressed later. Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 08:41:22 2020 (r364630) +++ head/sys/kern/vfs_cache.c Mon Aug 24 08:55:04 2020 (r364631) @@ -2003,24 +2003,22 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } if (vp != NULL) { - if (vp->v_type == VDIR) { - if (flag != NCF_ISDOTDOT) { - /* - * For this case, the cache entry maps both the - * directory name in it and the name ".." for the - * directory's parent. - */ - vn_seqc_write_begin(vp); - if ((ndd = vp->v_cache_dd) != NULL) { - if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) - cache_zap_locked(ndd); - else - ndd = NULL; - } - vp->v_cache_dd = ncp; - vn_seqc_write_end(vp); + if (flag != NCF_ISDOTDOT) { + /* + * For this case, the cache entry maps both the + * directory name in it and the name ".." for the + * directory's parent. + */ + vn_seqc_write_begin(vp); + if ((ndd = vp->v_cache_dd) != NULL) { + if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) + cache_zap_locked(ndd); + else + ndd = NULL; } - } else { + vp->v_cache_dd = ncp; + vn_seqc_write_end(vp); + } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { vn_seqc_write_begin(vp); vp->v_cache_dd = NULL; From owner-svn-src-head@freebsd.org Mon Aug 24 08:55:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F9083B678B; Mon, 24 Aug 2020 08:55:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmDr3l8Pz4Pqv; Mon, 24 Aug 2020 08:55:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63EF915DB9; Mon, 24 Aug 2020 08:55:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O8tuQt090591; Mon, 24 Aug 2020 08:55:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O8tup1090590; Mon, 24 Aug 2020 08:55:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008240855.07O8tup1090590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 24 Aug 2020 08:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364632 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 08:55:56 -0000 Author: mjg Date: Mon Aug 24 08:55:55 2020 New Revision: 364632 URL: https://svnweb.freebsd.org/changeset/base/364632 Log: cache: perform reverse lookup using v_cache_dd if possible Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 08:55:04 2020 (r364631) +++ head/sys/kern/vfs_cache.c Mon Aug 24 08:55:55 2020 (r364632) @@ -2572,6 +2572,19 @@ vn_fullpath_global(struct thread *td, struct vnode *vn return (error); } +static struct namecache * +vn_dd_from_dst(struct vnode *vp) +{ + struct namecache *ncp; + + cache_assert_vnode_locked(vp); + TAILQ_FOREACH(ncp, &vp->v_cache_dst, nc_dst) { + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + return (ncp); + } + return (NULL); +} + int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen) { @@ -2582,9 +2595,13 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char vlp = VP2VNODELOCK(*vp); mtx_lock(vlp); - TAILQ_FOREACH(ncp, &((*vp)->v_cache_dst), nc_dst) { - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) - break; + ncp = (*vp)->v_cache_dd; + if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT) == 0) { + KASSERT(ncp == vn_dd_from_dst(*vp), + ("%s: mismatch for dd entry (%p != %p)", __func__, + ncp, vn_dd_from_dst(*vp))); + } else { + ncp = vn_dd_from_dst(*vp); } if (ncp != NULL) { if (*buflen < ncp->nc_nlen) { From owner-svn-src-head@freebsd.org Mon Aug 24 08:57:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 626EB3B67A8; Mon, 24 Aug 2020 08:57:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmGB2Mqmz4Px3; Mon, 24 Aug 2020 08:57:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35C721612E; Mon, 24 Aug 2020 08:57:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O8v6DU090709; Mon, 24 Aug 2020 08:57:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O8v2v3090692; Mon, 24 Aug 2020 08:57:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008240857.07O8v2v3090692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 24 Aug 2020 08:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364633 - in head/sys: compat/linprocfs compat/linux dev/filemon dev/hwpmc fs/fdescfs fs/procfs kern security/audit sys vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linprocfs compat/linux dev/filemon dev/hwpmc fs/fdescfs fs/procfs kern security/audit sys vm X-SVN-Commit-Revision: 364633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 08:57:06 -0000 Author: mjg Date: Mon Aug 24 08:57:02 2020 New Revision: 364633 URL: https://svnweb.freebsd.org/changeset/base/364633 Log: cache: drop the always curthread argument from reverse lookup routines Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs. Tested by: pho Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_getcwd.c head/sys/dev/filemon/filemon_wrapper.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/procfs/procfs.c head/sys/fs/procfs/procfs_map.c head/sys/kern/kern_exec.c head/sys/kern/kern_proc.c head/sys/kern/kern_sig.c head/sys/kern/sys_process.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_vnops.c head/sys/security/audit/audit_bsm_klib.c head/sys/sys/vnode.h head/sys/vm/vm_object.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/compat/linprocfs/linprocfs.c Mon Aug 24 08:57:02 2020 (r364633) @@ -426,7 +426,7 @@ linprocfs_domtab(PFS_FILL_ARGS) error = namei(&nd); lep = linux_emul_path; if (error == 0) { - if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) + if (vn_fullpath(nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); } @@ -1053,7 +1053,7 @@ linprocfs_doproccwd(PFS_FILL_ARGS) char *freepath = NULL; pwd = pwd_hold(td); - vn_fullpath(td, pwd->pwd_cdir, &fullpath, &freepath); + vn_fullpath(pwd->pwd_cdir, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -1074,7 +1074,7 @@ linprocfs_doprocroot(PFS_FILL_ARGS) pwd = pwd_hold(td); vp = jailed(p->p_ucred) ? pwd->pwd_jdir : pwd->pwd_rdir; - vn_fullpath(td, vp, &fullpath, &freepath); + vn_fullpath(vp, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -1219,7 +1219,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { - vn_fullpath(td, vp, &name, &freename); + vn_fullpath(vp, &name, &freename); vn_lock(vp, LK_SHARED | LK_RETRY); VOP_GETATTR(vp, &vat, td->td_ucred); ino = vat.va_fileid; Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/compat/linux/linux_getcwd.c Mon Aug 24 08:57:02 2020 (r364633) @@ -73,7 +73,7 @@ linux_getcwd(struct thread *td, struct linux_getcwd_ar buflen = LINUX_PATH_MAX; buf = malloc(buflen, M_TEMP, M_WAITOK); - error = vn_getcwd(td, buf, &retbuf, &buflen); + error = vn_getcwd(buf, &retbuf, &buflen); if (error == 0) { error = copyout(retbuf, uap->buf, buflen); if (error == 0) Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Aug 24 08:57:02 2020 (r364633) @@ -186,8 +186,7 @@ _filemon_wrapper_openat(struct thread *td, const char */ if (getvnode(td, fd, cap_rights_init(&rights, CAP_LOOKUP), &fp) == 0) { - vn_fullpath(td, fp->f_vnode, &atpath, - &freepath); + vn_fullpath(fp->f_vnode, &atpath, &freepath); } } if (flags & O_RDWR) { Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Aug 24 08:57:02 2020 (r364633) @@ -832,7 +832,7 @@ pmc_getfilename(struct vnode *v, char **fullpath, char *fullpath = "unknown"; *freepath = NULL; - vn_fullpath(curthread, v, fullpath, freepath); + vn_fullpath(v, fullpath, freepath); } /* Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/fs/fdescfs/fdesc_vnops.c Mon Aug 24 08:57:02 2020 (r364633) @@ -640,7 +640,7 @@ fdesc_readlink(struct vop_readlink_args *va) switch (fp->f_type) { case DTYPE_VNODE: vp = fp->f_vnode; - error = vn_fullpath(td, vp, &fullpath, &freepath); + error = vn_fullpath(vp, &fullpath, &freepath); break; default: fullpath = "anon_inode:[unknown]"; Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/fs/procfs/procfs.c Mon Aug 24 08:57:02 2020 (r364633) @@ -79,7 +79,7 @@ procfs_doprocfile(PFS_FILL_ARGS) textvp = p->p_textvp; vhold(textvp); PROC_UNLOCK(p); - error = vn_fullpath(td, textvp, &fullpath, &freepath); + error = vn_fullpath(textvp, &fullpath, &freepath); vdrop(textvp); if (error == 0) sbuf_printf(sb, "%s", fullpath); Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/fs/procfs/procfs_map.c Mon Aug 24 08:57:02 2020 (r364633) @@ -189,7 +189,7 @@ procfs_doprocmap(PFS_FILL_ARGS) shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { - vn_fullpath(td, vp, &fullpath, &freepath); + vn_fullpath(vp, &fullpath, &freepath); vrele(vp); } } else { Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/kern_exec.c Mon Aug 24 08:57:02 2020 (r364633) @@ -575,8 +575,7 @@ interpret: imgp->execpath = args->fname; else { VOP_UNLOCK(imgp->vp); - if (vn_fullpath(td, imgp->vp, &imgp->execpath, - &imgp->freepath) != 0) + if (vn_fullpath(imgp->vp, &imgp->execpath, &imgp->freepath) != 0) imgp->execpath = args->fname; vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/kern_proc.c Mon Aug 24 08:57:02 2020 (r364633) @@ -2237,7 +2237,7 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER_ARGS) vref(vp); if (*pidp != -1) PROC_UNLOCK(p); - error = vn_fullpath(req->td, vp, &retbuf, &freebuf); + error = vn_fullpath(vp, &retbuf, &freebuf); vrele(vp); if (error) return (error); @@ -2375,8 +2375,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { - vn_fullpath(curthread, vp, &fullpath, - &freepath); + vn_fullpath(vp, &fullpath, &freepath); cred = curthread->td_ucred; vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, cred) == 0) { @@ -2584,8 +2583,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, s kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { - vn_fullpath(curthread, vp, &fullpath, - &freepath); + vn_fullpath(vp, &fullpath, &freepath); kve->kve_vn_type = vntype_to_kinfo(vp->v_type); cred = curthread->td_ucred; vn_lock(vp, LK_SHARED | LK_RETRY); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/kern_sig.c Mon Aug 24 08:57:02 2020 (r364633) @@ -3731,7 +3731,7 @@ coredump(struct thread *td) if (error != 0 || coredump_devctl == 0) goto out; sb = sbuf_new_auto(); - if (vn_fullpath_global(td, p->p_textvp, &fullpath, &freepath) != 0) + if (vn_fullpath_global(p->p_textvp, &fullpath, &freepath) != 0) goto out2; sbuf_printf(sb, "comm=\""); devctl_safe_quote_sb(sb, fullpath); @@ -3746,7 +3746,7 @@ coredump(struct thread *td) if (name[0] != '/') { fullpathsize = MAXPATHLEN; freepath = malloc(fullpathsize, M_TEMP, M_WAITOK); - if (vn_getcwd(td, freepath, &fullpath, &fullpathsize) != 0) { + if (vn_getcwd(freepath, &fullpath, &fullpathsize) != 0) { free(freepath, M_TEMP); goto out2; } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/sys_process.c Mon Aug 24 08:57:02 2020 (r364633) @@ -418,7 +418,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, str if (vp != NULL) { freepath = NULL; fullpath = NULL; - vn_fullpath(td, vp, &fullpath, &freepath); + vn_fullpath(vp, &fullpath, &freepath); vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { pve->pve_fileid = vattr.va_fileid; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/vfs_cache.c Mon Aug 24 08:57:02 2020 (r364633) @@ -475,12 +475,12 @@ STATNODE_COUNTER(shrinking_skipped, "Number of times shrinking was already in progress"); static void cache_zap_locked(struct namecache *ncp); -static int vn_fullpath_hardlink(struct thread *td, struct nameidata *ndp, char **retbuf, +static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, size_t *buflen); -static int vn_fullpath_any(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t *buflen); -static int vn_fullpath_dir(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t *len, bool slash_prefixed, size_t addend); +static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, + char **retbuf, size_t *buflen); +static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, + char **retbuf, size_t *len, bool slash_prefixed, size_t addend); static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); @@ -2463,7 +2463,7 @@ sys___getcwd(struct thread *td, struct __getcwd_args * buflen = MAXPATHLEN; buf = uma_zalloc(namei_zone, M_WAITOK); - error = vn_getcwd(td, buf, &retbuf, &buflen); + error = vn_getcwd(buf, &retbuf, &buflen); if (error == 0) error = copyout(retbuf, uap->buf, buflen); uma_zfree(namei_zone, buf); @@ -2471,13 +2471,13 @@ sys___getcwd(struct thread *td, struct __getcwd_args * } int -vn_getcwd(struct thread *td, char *buf, char **retbuf, size_t *buflen) +vn_getcwd(char *buf, char **retbuf, size_t *buflen) { struct pwd *pwd; int error; - pwd = pwd_hold(td); - error = vn_fullpath_any(td, pwd->pwd_cdir, pwd->pwd_rdir, buf, retbuf, buflen); + pwd = pwd_hold(curthread); + error = vn_fullpath_any(pwd->pwd_cdir, pwd->pwd_rdir, buf, retbuf, buflen); pwd_drop(pwd); #ifdef KTRACE @@ -2501,7 +2501,7 @@ kern___realpathat(struct thread *td, int fd, const cha pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) return (error); - error = vn_fullpath_hardlink(td, &nd, &retbuf, &freebuf, &size); + error = vn_fullpath_hardlink(&nd, &retbuf, &freebuf, &size); if (error == 0) { error = copyout(retbuf, buf, size); free(freebuf, M_TEMP); @@ -2523,23 +2523,22 @@ sys___realpathat(struct thread *td, struct __realpatha * cache (if available) */ int -vn_fullpath(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf) +vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf) { struct pwd *pwd; char *buf; size_t buflen; int error; - if (__predict_false(vn == NULL)) + if (__predict_false(vp == NULL)) return (EINVAL); buflen = MAXPATHLEN; buf = malloc(buflen, M_TEMP, M_WAITOK); - pwd = pwd_hold(td); - error = vn_fullpath_any(td, vn, pwd->pwd_rdir, buf, retbuf, &buflen); + pwd = pwd_hold(curthread); + error = vn_fullpath_any(vp, pwd->pwd_rdir, buf, retbuf, &buflen); pwd_drop(pwd); - - if (!error) + if (error == 0) *freebuf = buf; else free(buf, M_TEMP); @@ -2553,19 +2552,18 @@ vn_fullpath(struct thread *td, struct vnode *vn, char * global root mount point. */ int -vn_fullpath_global(struct thread *td, struct vnode *vn, - char **retbuf, char **freebuf) +vn_fullpath_global(struct vnode *vp, char **retbuf, char **freebuf) { char *buf; size_t buflen; int error; - if (__predict_false(vn == NULL)) + if (__predict_false(vp == NULL)) return (EINVAL); buflen = MAXPATHLEN; buf = malloc(buflen, M_TEMP, M_WAITOK); - error = vn_fullpath_any(td, vn, rootvnode, buf, retbuf, &buflen); - if (!error) + error = vn_fullpath_any(vp, rootvnode, buf, retbuf, &buflen); + if (error == 0) *freebuf = buf; else free(buf, M_TEMP); @@ -2661,8 +2659,8 @@ vn_vptocnp(struct vnode **vp, struct ucred *cred, char * The vnode must be referenced. */ static int -vn_fullpath_dir(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t *len, bool slash_prefixed, size_t addend) +vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, + size_t *len, bool slash_prefixed, size_t addend) { #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; @@ -2727,7 +2725,7 @@ vn_fullpath_dir(struct thread *td, struct vnode *vp, s error, vp, NULL); break; } - error = vn_vptocnp(&vp, td->td_ucred, buf, &buflen); + error = vn_vptocnp(&vp, curthread->td_ucred, buf, &buflen); if (error) break; if (buflen == 0) { @@ -2772,8 +2770,8 @@ vn_fullpath_dir(struct thread *td, struct vnode *vp, s * (in which case resolving fails) */ static int -vn_fullpath_any(struct thread *td, struct vnode *vp, struct vnode *rdir, - char *buf, char **retbuf, size_t *buflen) +vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, + size_t *buflen) { size_t orig_buflen; bool slash_prefixed; @@ -2789,7 +2787,7 @@ vn_fullpath_any(struct thread *td, struct vnode *vp, s if (vp->v_type != VDIR) { *buflen -= 1; buf[*buflen] = '\0'; - error = vn_vptocnp(&vp, td->td_ucred, buf, buflen); + error = vn_vptocnp(&vp, curthread->td_ucred, buf, buflen); if (error) return (error); if (*buflen == 0) { @@ -2801,7 +2799,7 @@ vn_fullpath_any(struct thread *td, struct vnode *vp, s slash_prefixed = true; } - return (vn_fullpath_dir(td, vp, rdir, buf, retbuf, buflen, slash_prefixed, + return (vn_fullpath_dir(vp, rdir, buf, retbuf, buflen, slash_prefixed, orig_buflen - *buflen)); } @@ -2818,8 +2816,8 @@ vn_fullpath_any(struct thread *td, struct vnode *vp, s * from the parent */ static int -vn_fullpath_hardlink(struct thread *td, struct nameidata *ndp, char **retbuf, - char **freebuf, size_t *buflen) +vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, + size_t *buflen) { char *buf, *tmpbuf; struct pwd *pwd; @@ -2838,7 +2836,7 @@ vn_fullpath_hardlink(struct thread *td, struct nameida slash_prefixed = false; buf = malloc(*buflen, M_TEMP, M_WAITOK); - pwd = pwd_hold(td); + pwd = pwd_hold(curthread); addend = 0; vp = ndp->ni_vp; @@ -2883,7 +2881,7 @@ vn_fullpath_hardlink(struct thread *td, struct nameida } vref(vp); - error = vn_fullpath_dir(td, vp, pwd->pwd_rdir, buf, retbuf, buflen, + error = vn_fullpath_dir(vp, pwd->pwd_rdir, buf, retbuf, buflen, slash_prefixed, addend); if (error != 0) goto out_bad; @@ -2969,7 +2967,7 @@ vn_path_to_global_path(struct thread *td, struct vnode /* Construct global filesystem path from vp. */ VOP_UNLOCK(vp); - error = vn_fullpath_global(td, vp, &rpath, &fbuf); + error = vn_fullpath_global(vp, &rpath, &fbuf); if (error != 0) { vrele(vp); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/kern/vfs_vnops.c Mon Aug 24 08:57:02 2020 (r364633) @@ -2513,7 +2513,7 @@ vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_fil kif->kf_un.kf_file.kf_file_type = vntype_to_kinfo(vp->v_type); freepath = NULL; fullpath = "-"; - error = vn_fullpath(curthread, vp, &fullpath, &freepath); + error = vn_fullpath(vp, &fullpath, &freepath); if (error == 0) { strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); } Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/security/audit/audit_bsm_klib.c Mon Aug 24 08:57:02 2020 (r364633) @@ -463,7 +463,7 @@ audit_canon_path_vp(struct thread *td, struct vnode *r * on Darwin. As a result, this may need some additional attention * in the future. */ - error = vn_fullpath_global(td, vp, &rbuf, &fbuf); + error = vn_fullpath_global(vp, &rbuf, &fbuf); if (error) { cpath[0] = '\0'; return; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/sys/vnode.h Mon Aug 24 08:57:02 2020 (r364633) @@ -660,11 +660,9 @@ u_quad_t init_va_filerev(void); int speedup_syncer(void); int vn_vptocnp(struct vnode **vp, struct ucred *cred, char *buf, size_t *buflen); -int vn_getcwd(struct thread *td, char *buf, char **retbuf, size_t *buflen); -int vn_fullpath(struct thread *td, struct vnode *vn, - char **retbuf, char **freebuf); -int vn_fullpath_global(struct thread *td, struct vnode *vn, - char **retbuf, char **freebuf); +int vn_getcwd(char *buf, char **retbuf, size_t *buflen); +int vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf); +int vn_fullpath_global(struct vnode *vp, char **retbuf, char **freebuf); struct vnode * vn_dir_dd_ino(struct vnode *vp); int vn_commname(struct vnode *vn, char *buf, u_int buflen); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Aug 24 08:55:55 2020 (r364632) +++ head/sys/vm/vm_object.c Mon Aug 24 08:57:02 2020 (r364633) @@ -2582,7 +2582,7 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) vref(vp); VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { - vn_fullpath(curthread, vp, &fullpath, &freepath); + vn_fullpath(vp, &fullpath, &freepath); vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { kvo->kvo_vn_fileid = va.va_fileid; From owner-svn-src-head@freebsd.org Mon Aug 24 09:00:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D0D43B6B40; Mon, 24 Aug 2020 09:00:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmLf2mbmz4QxX; Mon, 24 Aug 2020 09:00:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4250016139; Mon, 24 Aug 2020 09:00:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O90wVR093089; Mon, 24 Aug 2020 09:00:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O90w9Y093073; Mon, 24 Aug 2020 09:00:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008240900.07O90w9Y093073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 24 Aug 2020 09:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364637 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:00:58 -0000 Author: mjg Date: Mon Aug 24 09:00:57 2020 New Revision: 364637 URL: https://svnweb.freebsd.org/changeset/base/364637 Log: cache: lockless reverse lookup This enables fully scalable operation for getcwd and significantly improves realpath. For example: PATH_CUSTOM=/usr/src ./getcwd_processes -t 104 before: 1550851 after: 380135380 Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 09:00:07 2020 (r364636) +++ head/sys/kern/vfs_cache.c Mon Aug 24 09:00:57 2020 (r364637) @@ -85,6 +85,10 @@ SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct "struct vnode *"); SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", "char *"); +SDT_PROBE_DEFINE2(vfs, namecache, fullpath_smr, hit, "struct vnode *", + "const char *"); +SDT_PROBE_DEFINE4(vfs, namecache, fullpath_smr, miss, "struct vnode *", + "struct namecache *", "int", "int"); SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *"); SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *", "char *", "struct vnode *"); @@ -298,6 +302,10 @@ static u_int __read_mostly ncsize; /* the size as comp struct nchstats nchstats; /* cache effectiveness statistics */ +static bool __read_frequently cache_fast_revlookup = true; +SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLFLAG_RW, + &cache_fast_revlookup, 0, ""); + static struct mtx __exclusive_cache_line ncneg_shrink_lock; struct neglist { @@ -477,6 +485,8 @@ STATNODE_COUNTER(shrinking_skipped, static void cache_zap_locked(struct namecache *ncp); static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, char **freebuf, size_t *buflen); +static int vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, + char **retbuf, size_t *buflen, bool slash_prefixed, size_t addend); static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, size_t *buflen); static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, @@ -2476,9 +2486,17 @@ vn_getcwd(char *buf, char **retbuf, size_t *buflen) struct pwd *pwd; int error; - pwd = pwd_hold(curthread); - error = vn_fullpath_any(pwd->pwd_cdir, pwd->pwd_rdir, buf, retbuf, buflen); - pwd_drop(pwd); + vfs_smr_enter(); + pwd = pwd_get_smr(); + error = vn_fullpath_any_smr(pwd->pwd_cdir, pwd->pwd_rdir, buf, retbuf, + buflen, false, 0); + VFS_SMR_ASSERT_NOT_ENTERED(); + if (error < 0) { + pwd = pwd_hold(curthread); + error = vn_fullpath_any(pwd->pwd_cdir, pwd->pwd_rdir, buf, + retbuf, buflen); + pwd_drop(pwd); + } #ifdef KTRACE if (KTRPOINT(curthread, KTR_NAMEI) && error == 0) @@ -2535,9 +2553,15 @@ vn_fullpath(struct vnode *vp, char **retbuf, char **fr buflen = MAXPATHLEN; buf = malloc(buflen, M_TEMP, M_WAITOK); - pwd = pwd_hold(curthread); - error = vn_fullpath_any(vp, pwd->pwd_rdir, buf, retbuf, &buflen); - pwd_drop(pwd); + vfs_smr_enter(); + pwd = pwd_get_smr(); + error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, &buflen, false, 0); + VFS_SMR_ASSERT_NOT_ENTERED(); + if (error < 0) { + pwd = pwd_hold(curthread); + error = vn_fullpath_any(vp, pwd->pwd_rdir, buf, retbuf, &buflen); + pwd_drop(pwd); + } if (error == 0) *freebuf = buf; else @@ -2562,7 +2586,12 @@ vn_fullpath_global(struct vnode *vp, char **retbuf, ch return (EINVAL); buflen = MAXPATHLEN; buf = malloc(buflen, M_TEMP, M_WAITOK); - error = vn_fullpath_any(vp, rootvnode, buf, retbuf, &buflen); + vfs_smr_enter(); + error = vn_fullpath_any_smr(vp, rootvnode, buf, retbuf, &buflen, false, 0); + VFS_SMR_ASSERT_NOT_ENTERED(); + if (error < 0) { + error = vn_fullpath_any(vp, rootvnode, buf, retbuf, &buflen); + } if (error == 0) *freebuf = buf; else @@ -2769,7 +2798,145 @@ vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, * - namecache is not mandatory, meaning names are not guaranteed to be added * (in which case resolving fails) */ +static void __inline +cache_rev_failed_impl(int *reason, int line) +{ + + *reason = line; +} +#define cache_rev_failed(var) cache_rev_failed_impl((var), __LINE__) + static int +vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, + char **retbuf, size_t *buflen, bool slash_prefixed, size_t addend) +{ +#ifdef KDTRACE_HOOKS + struct vnode *startvp = vp; +#endif + struct vnode *tvp; + struct mount *mp; + struct namecache *ncp; + size_t orig_buflen; + int reason; + int error; +#ifdef KDTRACE_HOOKS + int i; +#endif + seqc_t vp_seqc, tvp_seqc; + u_char nc_flag; + + VFS_SMR_ASSERT_ENTERED(); + + if (!cache_fast_revlookup) { + vfs_smr_exit(); + return (-1); + } + + orig_buflen = *buflen; + + MPASS(*buflen >= 2); + + if (!slash_prefixed) { + MPASS(*buflen >= 2); + *buflen -= 1; + buf[*buflen] = '\0'; + } + + if (vp == rdir || vp == rootvnode) { + if (!slash_prefixed) { + *buflen -= 1; + buf[*buflen] = '/'; + } + goto out_ok; + } + +#ifdef KDTRACE_HOOKS + i = 0; +#endif + error = -1; + vp_seqc = vn_seqc_read_any(vp); + if (seqc_in_modify(vp_seqc)) { + cache_rev_failed(&reason); + goto out_abort; + } + + for (;;) { +#ifdef KDTRACE_HOOKS + i++; +#endif + if ((vp->v_vflag & VV_ROOT) != 0) { + mp = atomic_load_ptr(&vp->v_mount); + if (mp == NULL) { + cache_rev_failed(&reason); + goto out_abort; + } + tvp = atomic_load_ptr(&mp->mnt_vnodecovered); + tvp_seqc = vn_seqc_read_any(tvp); + if (seqc_in_modify(tvp_seqc)) { + cache_rev_failed(&reason); + goto out_abort; + } + if (!vn_seqc_consistent(vp, vp_seqc)) { + cache_rev_failed(&reason); + goto out_abort; + } + vp = tvp; + vp_seqc = tvp_seqc; + continue; + } + ncp = atomic_load_ptr(&vp->v_cache_dd); + if (ncp == NULL) { + cache_rev_failed(&reason); + goto out_abort; + } + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) != 0) { + cache_rev_failed(&reason); + goto out_abort; + } + if (!cache_ncp_canuse(ncp)) { + cache_rev_failed(&reason); + goto out_abort; + } + if (ncp->nc_nlen >= *buflen) { + cache_rev_failed(&reason); + error = ENOMEM; + goto out_abort; + } + *buflen -= ncp->nc_nlen; + memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); + *buflen -= 1; + buf[*buflen] = '/'; + tvp = ncp->nc_dvp; + tvp_seqc = vn_seqc_read_any(tvp); + if (seqc_in_modify(tvp_seqc)) { + cache_rev_failed(&reason); + goto out_abort; + } + if (!vn_seqc_consistent(vp, vp_seqc)) { + cache_rev_failed(&reason); + goto out_abort; + } + vp = tvp; + vp_seqc = tvp_seqc; + if (vp == rdir || vp == rootvnode) + break; + } +out_ok: + vfs_smr_exit(); + *retbuf = buf + *buflen; + *buflen = orig_buflen - *buflen + addend; + SDT_PROBE2(vfs, namecache, fullpath_smr, hit, startvp, *retbuf); + return (0); + +out_abort: + *buflen = orig_buflen; + SDT_PROBE4(vfs, namecache, fullpath_smr, miss, startvp, ncp, reason, i); + vfs_smr_exit(); + return (error); +} + +static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, size_t *buflen) { @@ -2836,7 +3003,6 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret slash_prefixed = false; buf = malloc(*buflen, M_TEMP, M_WAITOK); - pwd = pwd_hold(curthread); addend = 0; vp = ndp->ni_vp; @@ -2880,18 +3046,25 @@ vn_fullpath_hardlink(struct nameidata *ndp, char **ret vp = ndp->ni_dvp; } - vref(vp); - error = vn_fullpath_dir(vp, pwd->pwd_rdir, buf, retbuf, buflen, + vfs_smr_enter(); + pwd = pwd_get_smr(); + error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, buflen, slash_prefixed, addend); - if (error != 0) - goto out_bad; + VFS_SMR_ASSERT_NOT_ENTERED(); + if (error < 0) { + pwd = pwd_hold(curthread); + vref(vp); + error = vn_fullpath_dir(vp, pwd->pwd_rdir, buf, retbuf, buflen, + slash_prefixed, addend); + pwd_drop(pwd); + if (error != 0) + goto out_bad; + } - pwd_drop(pwd); *freebuf = buf; return (0); out_bad: - pwd_drop(pwd); free(buf, M_TEMP); return (error); } From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1DA53B757D; Mon, 24 Aug 2020 09:20:13 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmms64TPz4SLC; Mon, 24 Aug 2020 09:20:13 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3B2F16171; Mon, 24 Aug 2020 09:20:13 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KD1j003774; Mon, 24 Aug 2020 09:20:13 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9KD6L003773; Mon, 24 Aug 2020 09:20:13 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9KD6L003773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364645 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:14 -0000 Author: arichardson Date: Mon Aug 24 09:20:13 2020 New Revision: 364645 URL: https://svnweb.freebsd.org/changeset/base/364645 Log: Pass the installworld install(1) flags to make buildenv This ensure that running make install inside buildenv correctly includes the METALOG flags when building with -DNO_ROOT. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D26038 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 24 09:19:05 2020 (r364644) +++ head/Makefile.inc1 Mon Aug 24 09:20:13 2020 (r364645) @@ -1178,7 +1178,9 @@ buildenv: .PHONY .if ${BUILDENV_SHELL:M*zsh*} @echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE} .endif - @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} + @cd ${BUILDENV_DIR} && env ${WMAKEENV} \ + INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" \ + MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" BUILDENV=1 ${BUILDENV_SHELL} TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}} toolchain: ${TOOLCHAIN_TGTS} .PHONY From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 127EF3B7617; Mon, 24 Aug 2020 09:20:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmmz0X8Nz4SZ4; Mon, 24 Aug 2020 09:20:19 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B953716172; Mon, 24 Aug 2020 09:20:18 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KIrS003826; Mon, 24 Aug 2020 09:20:18 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9KIP4003825; Mon, 24 Aug 2020 09:20:18 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9KIP4003825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364646 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 364646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:22 -0000 Author: arichardson Date: Mon Aug 24 09:20:18 2020 New Revision: 364646 URL: https://svnweb.freebsd.org/changeset/base/364646 Log: Re-indent crunched_main.c in preparation for D25998 Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunched_main.c Mon Aug 24 09:20:13 2020 (r364645) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Mon Aug 24 09:20:18 2020 (r364646) @@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$"); #include struct stub { - char *name; - int (*f)(); + char *name; + int (*f)(); }; extern char *__progname; @@ -52,65 +52,64 @@ static void crunched_usage(void); int main(int argc, char **argv, char **envp) { - char *slash, *basename; - struct stub *ep; + char *slash, *basename; + struct stub *ep; - if(argv[0] == NULL || *argv[0] == '\0') - crunched_usage(); + if (argv[0] == NULL || *argv[0] == '\0') + crunched_usage(); - slash = strrchr(argv[0], '/'); - basename = slash? slash+1 : argv[0]; + slash = strrchr(argv[0], '/'); + basename = slash ? slash + 1 : argv[0]; - for(ep=entry_points; ep->name != NULL; ep++) - if(!strcmp(basename, ep->name)) break; + for (ep = entry_points; ep->name != NULL; ep++) + if (!strcmp(basename, ep->name)) + break; - if(ep->name) - return ep->f(argc, argv, envp); - else { - fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); - crunched_usage(); - } + if (ep->name) + return ep->f(argc, argv, envp); + else { + fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); + crunched_usage(); + } } - int crunched_main(int argc, char **argv, char **envp) { - char *slash; - struct stub *ep; - int columns, len; + char *slash; + struct stub *ep; + int columns, len; - if(argc <= 1) - crunched_usage(); + if (argc <= 1) + crunched_usage(); - slash = strrchr(argv[1], '/'); - __progname = slash? slash+1 : argv[1]; + slash = strrchr(argv[1], '/'); + __progname = slash ? slash + 1 : argv[1]; - return main(--argc, ++argv, envp); + return main(--argc, ++argv, envp); } - static void crunched_usage() { - int columns, len; - struct stub *ep; + int columns, len; + struct stub *ep; - fprintf(stderr, "usage: %s ..., where is one of:\n", - EXECNAME); - columns = 0; - for(ep=entry_points; ep->name != NULL; ep++) { - len = strlen(ep->name) + 1; - if(columns+len < 80) - columns += len; - else { - fprintf(stderr, "\n"); - columns = len; + fprintf(stderr, + "usage: %s ..., where is one of:\n", EXECNAME); + columns = 0; + for (ep = entry_points; ep->name != NULL; ep++) { + len = strlen(ep->name) + 1; + if (columns + len < 80) + columns += len; + else { + fprintf(stderr, "\n"); + columns = len; + } + fprintf(stderr, " %s", ep->name); } - fprintf(stderr, " %s", ep->name); - } - fprintf(stderr, "\n"); - exit(1); + fprintf(stderr, "\n"); + exit(1); } /* end of crunched_main.c */ From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8910B3B727E; Mon, 24 Aug 2020 09:20:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmn539h8z4SPC; Mon, 24 Aug 2020 09:20:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D16F16431; Mon, 24 Aug 2020 09:20:23 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KNVs003879; Mon, 24 Aug 2020 09:20:23 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9KN8j003878; Mon, 24 Aug 2020 09:20:23 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9KN8j003878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364647 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 364647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:25 -0000 Author: arichardson Date: Mon Aug 24 09:20:23 2020 New Revision: 364647 URL: https://svnweb.freebsd.org/changeset/base/364647 Log: Correctly determine the real executable in crunched binaries This should fix cases like su setting argv[0] to _su for /bin/sh. Previously cheribsdbox (a crunched tool we use in CheriBSD to reduce the size of our minimal disk images to allow loading them onto FPGAs without waiting forever for the transfer) would complain about _su not being compiled in, but now that we also look at AT_EXECPATH it correctly invokes the sh tool. Note: we use use AT_EXECPATH instead of the KERN_PROC_PATHNAME sysctl to get the crunchgen binary name since it seems like KERN_PROC_PATHNAME just returns the last cached path for a given hardlink. When using `su`, instead of invoking /bin/csh this would invoke the last used hardlink to cheribsdbox. This caused weird test failures when running tests due to `id` being executed instead of `echo`: $ id # id is a hardlink to /bin/cheribsdbox $ su postgres -c 'echo 1' # su is also a hardlink uid=1001(postgres) gid=1001(postgres) groups=1001(postgres) Obtained from: CheriBSD Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D25998 Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunched_main.c Mon Aug 24 09:20:18 2020 (r364646) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Mon Aug 24 09:20:23 2020 (r364647) @@ -23,6 +23,38 @@ * Computer Science Department * University of Maryland at College Park */ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ /* * crunched_main.c - main program for crunched binaries, it branches to a * particular subprogram based on the value of argv[0]. Also included @@ -35,6 +67,11 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + +#include #include #include #include @@ -44,30 +81,88 @@ struct stub { int (*f)(); }; -extern char *__progname; +extern const char *__progname; extern struct stub entry_points[]; static void crunched_usage(void); +static struct stub * +find_entry_point(const char *basename) +{ + struct stub *ep = NULL; + + for (ep = entry_points; ep->name != NULL; ep++) + if (!strcmp(basename, ep->name)) + break; + + return (ep); +} + +static const char * +get_basename(const char *exe_path) +{ + const char *slash = strrchr(exe_path, '/'); + return (slash ? slash + 1 : exe_path); +} + int main(int argc, char **argv, char **envp) { - char *slash, *basename; - struct stub *ep; + struct stub *ep = NULL; + const char *basename = NULL; - if (argv[0] == NULL || *argv[0] == '\0') - crunched_usage(); + /* + * Look at __progname first (this will be set if the crunched binary is + * invoked directly). + */ + if (__progname) { + basename = get_basename(__progname); + ep = find_entry_point(basename); + } - slash = strrchr(argv[0], '/'); - basename = slash ? slash + 1 : argv[0]; + /* + * Otherwise try to find entry point based on argv[0] (this works for + * both symlinks as well as hardlinks). However, it does not work when + * su invokes a crunched shell because it sets argv[0] to _su when + * invoking the shell. In that case we look at AT_EXECPATH as a + * fallback. + */ + if (ep == NULL) { + basename = get_basename(argv[0]); + ep = find_entry_point(basename); + } - for (ep = entry_points; ep->name != NULL; ep++) - if (!strcmp(basename, ep->name)) - break; + /* + * If we didn't find the entry point based on __progname or argv[0], + * try AT_EXECPATH to get the actual binary that was executed. + */ + if (ep == NULL) { + char buf[MAXPATHLEN]; + int error = elf_aux_info(AT_EXECPATH, &buf, sizeof(buf)); - if (ep->name) + if (error == 0) { + const char *exe_name = get_basename(buf); + /* + * Keep using argv[0] if AT_EXECPATH is the crunched + * binary so that symlinks to the crunched binary report + * "not compiled in" instead of invoking + * crunched_main(). + */ + if (strcmp(exe_name, EXECNAME) != 0) { + basename = exe_name; + ep = find_entry_point(basename); + } + } else { + warnc(error, "elf_aux_info(AT_EXECPATH) failed"); + } + } + + if (basename == NULL || *basename == '\0') + crunched_usage(); + + if (ep != NULL) { return ep->f(argc, argv, envp); - else { + } else { fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); crunched_usage(); } @@ -76,16 +171,10 @@ main(int argc, char **argv, char **envp) int crunched_main(int argc, char **argv, char **envp) { - char *slash; - struct stub *ep; - int columns, len; - if (argc <= 1) crunched_usage(); - slash = strrchr(argv[1], '/'); - __progname = slash ? slash + 1 : argv[1]; - + __progname = get_basename(argv[1]); return main(--argc, ++argv, envp); } From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 114D43B778C; Mon, 24 Aug 2020 09:20:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmnC5M1lz4SSP; Mon, 24 Aug 2020 09:20:31 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7171116173; Mon, 24 Aug 2020 09:20:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KSLc003933; Mon, 24 Aug 2020 09:20:28 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9KSf3003932; Mon, 24 Aug 2020 09:20:28 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9KSf3003932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364648 - head/usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/makefs/msdos X-SVN-Commit-Revision: 364648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:33 -0000 Author: arichardson Date: Mon Aug 24 09:20:27 2020 New Revision: 364648 URL: https://svnweb.freebsd.org/changeset/base/364648 Log: makefs (msdosfs): Use fprintf instead of debug print for errors The added print was very helpful for debugging failed disk image creation. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D23200 Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Aug 24 09:20:23 2020 (r364647) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Mon Aug 24 09:20:27 2020 (r364648) @@ -467,15 +467,15 @@ msdosfs_wfile(const char *path, struct denode *dep, fs if ((fd = open(path, O_RDONLY)) == -1) { error = errno; - MSDOSFS_DPRINTF(("open %s: %s", path, strerror(error))); + fprintf(stderr, "open %s: %s\n", path, strerror(error)); return error; } if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0)) == MAP_FAILED) { error = errno; - MSDOSFS_DPRINTF(("%s: mmap %s: %s", __func__, node->name, - strerror(error))); + fprintf(stderr, "%s: mmap %s: %s\n", __func__, node->name, + strerror(error)); close(fd); goto out; } From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 830823B7890; Mon, 24 Aug 2020 09:20:41 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmnN3cKJz4SMb; Mon, 24 Aug 2020 09:20:40 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCF0C16176; Mon, 24 Aug 2020 09:20:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KYnY003991; Mon, 24 Aug 2020 09:20:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9KXCi003987; Mon, 24 Aug 2020 09:20:33 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9KXCi003987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364649 - in head: lib/libcompiler_rt lib/libgcc_eh lib/libprocstat stand/userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: lib/libcompiler_rt lib/libgcc_eh lib/libprocstat stand/userboot/userboot X-SVN-Commit-Revision: 364649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:42 -0000 Author: arichardson Date: Mon Aug 24 09:20:33 2020 New Revision: 364649 URL: https://svnweb.freebsd.org/changeset/base/364649 Log: Avoid adding duplicates to SRCS/OBJS/SOBJS/POBJS This is a change in preparation for stopping to use lorder.sh (D26044) and instead assume that we have a linker newer than ~1990. Without lorder.sh duplicates end up being passed to the linker when building .so files and this can result in duplicate symbol definition errors. There is one minor change: libcompiler_rt.a will no longer provide gcc_personality_v0 and instead we now only have it in libgcc_eh.a/libgcc_s.so. This matches GCC's behaviour. Reviewed By: emaste, cem Differential Revision: https://reviews.freebsd.org/D26042 Modified: head/lib/libcompiler_rt/Makefile.inc head/lib/libgcc_eh/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libprocstat/Makefile head/stand/userboot/userboot/Makefile Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Mon Aug 24 09:20:27 2020 (r364648) +++ head/lib/libcompiler_rt/Makefile.inc Mon Aug 24 09:20:33 2020 (r364649) @@ -67,7 +67,6 @@ SRCF+= floatunsisf SRCF+= floatuntidf SRCF+= floatuntisf SRCF+= floatuntixf -SRCF+= gcc_personality_v0 # not in upstream SRCF+= int_util SRCF+= lshrdi3 SRCF+= lshrti3 Modified: head/lib/libgcc_eh/Makefile ============================================================================== --- head/lib/libgcc_eh/Makefile Mon Aug 24 09:20:27 2020 (r364648) +++ head/lib/libgcc_eh/Makefile Mon Aug 24 09:20:33 2020 (r364649) @@ -8,6 +8,7 @@ NO_PIC= MK_SSP= no WARNS?= 2 +SRCS_EXC+= int_util.c .include "Makefile.inc" .if ${.MAKE.LEVEL} > 0 Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Mon Aug 24 09:20:27 2020 (r364648) +++ head/lib/libgcc_eh/Makefile.inc Mon Aug 24 09:20:33 2020 (r364649) @@ -9,7 +9,6 @@ STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBI .PATH: ${COMPILERRTDIR}/lib/builtins .PATH: ${UNWINDSRCDIR} SRCS_EXC+= gcc_personality_v0.c -SRCS_EXC+= int_util.c SRCS_EXC+= Unwind-EHABI.cpp SRCS_EXC+= Unwind-sjlj.c SRCS_EXC+= UnwindLevel1-gcc-ext.c Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Mon Aug 24 09:20:27 2020 (r364648) +++ head/lib/libprocstat/Makefile Mon Aug 24 09:20:33 2020 (r364649) @@ -59,8 +59,6 @@ MLINKS+=libprocstat.3 procstat_close.3 \ CFLAGS+= -DLIBPROCSTAT_ZFS SRCS+= zfs.c OBJS+= zfs/zfs_defs.o -SOBJS+= zfs/zfs_defs.pico -POBJS+= zfs/zfs_defs.po SUBDIR= zfs zfs/zfs_defs.o: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Mon Aug 24 09:20:27 2020 (r364648) +++ head/stand/userboot/userboot/Makefile Mon Aug 24 09:20:33 2020 (r364649) @@ -20,7 +20,6 @@ SRCS+= bootinfo.c SRCS+= bootinfo32.c SRCS+= bootinfo64.c SRCS+= conf.c -SRCS+= console.c SRCS+= copy.c SRCS+= devicename.c SRCS+= elf32_freebsd.c From owner-svn-src-head@freebsd.org Mon Aug 24 09:20:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3AB53B74EF; Mon, 24 Aug 2020 09:20:44 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZmnQ6qbrz4SMg; Mon, 24 Aug 2020 09:20:42 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B95716437; Mon, 24 Aug 2020 09:20:39 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07O9KdSA004045; Mon, 24 Aug 2020 09:20:39 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07O9Kd5H004044; Mon, 24 Aug 2020 09:20:39 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008240920.07O9Kd5H004044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 24 Aug 2020 09:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364650 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 09:20:45 -0000 Author: arichardson Date: Mon Aug 24 09:20:38 2020 New Revision: 364650 URL: https://svnweb.freebsd.org/changeset/base/364650 Log: Also print number of available CPUs on Linux Without this change the buildworld/buildkernel epilogue looks like this: >>> World built in 249 seconds, sysctl: cannot stat /proc/sys/hw/ncpu: No such file or directory ncpu: , make -j72. Reviewed By: emaste, bdrewery Differential Revision: https://reviews.freebsd.org/D26056 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 24 09:20:33 2020 (r364649) +++ head/Makefile.inc1 Mon Aug 24 09:20:38 2020 (r364650) @@ -1136,6 +1136,8 @@ _BUILDWORLD_START!= date '+%s' buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue +_ncpu_cmd=sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown + buildworld_prologue: .PHONY @echo "--------------------------------------------------------------" @echo ">>> World build started on `LC_ALL=C date`" @@ -1147,7 +1149,7 @@ buildworld_epilogue: .PHONY @echo ">>> World build completed on `LC_ALL=C date`" @seconds=$$(($$(date '+%s') - ${_BUILDWORLD_START})); \ echo -n ">>> World built in $$seconds seconds, "; \ - echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make -j/}" + echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" @echo "--------------------------------------------------------------" # @@ -1656,7 +1658,7 @@ buildkernel: .MAKE .PHONY .endfor @seconds=$$(($$(date '+%s') - ${_BUILDKERNEL_START})); \ echo -n ">>> Kernel(s) ${BUILDKERNELS} built in $$seconds seconds, "; \ - echo "ncpu: $$(sysctl -n hw.ncpu)${.MAKE.JOBS:S/^/, make -j/}" + echo "ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" @echo "--------------------------------------------------------------" NO_INSTALLEXTRAKERNELS?= yes From owner-svn-src-head@freebsd.org Mon Aug 24 11:44:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07D523BB41C; Mon, 24 Aug 2020 11:44:21 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZqz86RHnz4ctf; Mon, 24 Aug 2020 11:44:20 +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 C14AA17C77; Mon, 24 Aug 2020 11:44:20 +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 07OBiKlo096407; Mon, 24 Aug 2020 11:44:20 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OBiK0E096406; Mon, 24 Aug 2020 11:44:20 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008241144.07OBiK0E096406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 24 Aug 2020 11:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364655 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 364655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 11:44:21 -0000 Author: vmaffione Date: Mon Aug 24 11:44:20 2020 New Revision: 364655 URL: https://svnweb.freebsd.org/changeset/base/364655 Log: iflib: fix isc_rxd_flush call in netmap_fl_refill() The semantic of the pidx argument of isc_rxd_flush() is the last valid index of in the free list, rather than the next index to be published. However, netmap was still using the old convention. While there, also refactor the netmap_fl_refill() to simplify a little bit and add an assertion. MFC after: 2 weeks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Aug 24 10:46:09 2020 (r364654) +++ head/sys/net/iflib.c Mon Aug 24 11:44:20 2020 (r364655) @@ -757,7 +757,7 @@ iflib_num_tx_descs(if_ctx_t ctx) MODULE_DEPEND(iflib, netmap, 1, 1, 1); -static int netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, uint32_t nm_i, bool init); +static int netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init); /* * device-specific sysctl variables: @@ -828,33 +828,43 @@ iflib_netmap_register(struct netmap_adapter *na, int o } static int -netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, uint32_t nm_i, bool init) +netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring *kring, bool init) { struct netmap_adapter *na = kring->na; u_int const lim = kring->nkr_num_slots - 1; u_int head = kring->rhead; + u_int nm_i = kring->nr_hwcur; struct netmap_ring *ring = kring->ring; bus_dmamap_t *map; struct if_rxd_update iru; if_ctx_t ctx = rxq->ifr_ctx; iflib_fl_t fl = &rxq->ifr_fl[0]; - uint32_t nic_i_first, nic_i; + u_int nic_i_first, nic_i; int i; #if IFLIB_DEBUG_COUNTERS int rf_count = 0; #endif - if (nm_i == head && __predict_true(!init)) + /* + * Netmap requires that we leave (at least) one free slot + * in the ring, so that it can distinguish between an empty + * ring (nr_hwcur == nr_hwtail, i.e. all the buffers owned by the + * user) and a full ring (nr_hwtail == (nr_hwcur - 1) mod N, i.e. + * all the buffers owned by the kernel). + * We thus set head (the refill limit) to nr_hwcur - 1 + * at initialization. The rest of the code will then make sure + * than nr_hwtail never overcomes nr_hwcur. + */ + if (__predict_false(init)) { + head = nm_prev(nm_i, lim); + } else if (nm_i == head) { + /* Nothing to do. We can leave early. */ return (0); + } iru_init(&iru, rxq, 0 /* flid */); map = fl->ifl_sds.ifsd_map; nic_i = netmap_idx_k2n(kring, nm_i); - /* - * IMPORTANT: we must leave one free slot in the ring, - * so move head back by one unit - */ - head = nm_prev(head, lim); DBG_COUNTER_INC(fl_refills); while (nm_i != head) { #if IFLIB_DEBUG_COUNTERS @@ -895,9 +905,13 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring } kring->nr_hwcur = head; + /* The pidx argument of isc_rxd_flush() is the index of the last valid + * slot in the free list ring. We need therefore to decrement nic_i, + * similarly to what happens in iflib_fl_refill() for ifl_pidx. */ bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id, nic_i); + ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id, + nm_prev(nic_i, lim)); DBG_COUNTER_INC(rxd_flush); return (0); @@ -1127,6 +1141,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl nic_i = fl->ifl_cidx; nm_i = netmap_idx_n2k(kring, nic_i); + MPASS(nm_i == kring->nr_hwtail); for (n = 0; avail > 0 && nm_i != hwtail_lim; n++, avail--) { rxd_info_zero(&ri); ri.iri_frags = rxq->ifr_frags; @@ -1165,9 +1180,9 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl * nic_i is the index in the NIC ring, and * nm_i == (nic_i + kring->nkr_hwofs) % ring_size */ - nm_i = kring->nr_hwcur; + netmap_fl_refill(rxq, kring, false); - return (netmap_fl_refill(rxq, kring, nm_i, false)); + return (0); } static void @@ -1239,14 +1254,12 @@ iflib_netmap_rxq_init(if_ctx_t ctx, iflib_rxq_t rxq) struct netmap_adapter *na = NA(ctx->ifc_ifp); struct netmap_kring *kring; struct netmap_slot *slot; - uint32_t nm_i; slot = netmap_reset(na, NR_RX, rxq->ifr_id, 0); if (slot == NULL) return (0); kring = na->rx_rings[rxq->ifr_id]; - nm_i = netmap_idx_n2k(kring, 0); - netmap_fl_refill(rxq, kring, nm_i, true); + netmap_fl_refill(rxq, kring, true); return (1); } From owner-svn-src-head@freebsd.org Mon Aug 24 11:49:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A00053BB716; Mon, 24 Aug 2020 11:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZr5V3lPBz4dCG; Mon, 24 Aug 2020 11:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F4F41809A; Mon, 24 Aug 2020 11:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OBnonW096834; Mon, 24 Aug 2020 11:49:50 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OBnodk096832; Mon, 24 Aug 2020 11:49:50 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202008241149.07OBnodk096832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 24 Aug 2020 11:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364656 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 364656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 11:49:50 -0000 Author: grehan Date: Mon Aug 24 11:49:49 2020 New Revision: 364656 URL: https://svnweb.freebsd.org/changeset/base/364656 Log: cpu_auxmsr: assert caller is preventing CPU migration. Submitted by: Adam Fenn (adam at fenn dot io) Requested by: kib Reviewed by: kib, grehan Approved by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D26166 Modified: head/sys/amd64/amd64/initcpu.c head/sys/i386/i386/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Mon Aug 24 11:44:20 2020 (r364655) +++ head/sys/amd64/amd64/initcpu.c Mon Aug 24 11:49:49 2020 (r364656) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -218,11 +219,14 @@ init_via(void) } /* - * The value for the TSC_AUX MSR and rdtscp/rdpid. + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. */ u_int cpu_auxmsr(void) { + KASSERT((read_rflags() & PSL_I) == 0, ("context switch possible")); return (PCPU_GET(cpuid)); } Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Aug 24 11:44:20 2020 (r364655) +++ head/sys/i386/i386/initcpu.c Mon Aug 24 11:49:49 2020 (r364656) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -628,11 +629,14 @@ init_transmeta(void) #endif /* - * The value for the TSC_AUX MSR and rdtscp/rdpid. + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. */ u_int cpu_auxmsr(void) { + KASSERT((read_eflags() & PSL_I) == 0, ("context switch possible")); return (PCPU_GET(cpuid)); } From owner-svn-src-head@freebsd.org Mon Aug 24 13:15:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BCDC3BF4BF; Mon, 24 Aug 2020 13:15:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZszy0vXNz4mcC; Mon, 24 Aug 2020 13:15:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE16A19299; Mon, 24 Aug 2020 13:15:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07ODF9m5054925; Mon, 24 Aug 2020 13:15:09 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07ODF9BZ054921; Mon, 24 Aug 2020 13:15:09 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008241315.07ODF9BZ054921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 24 Aug 2020 13:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364673 - in head/sys: dev/rtwn dev/usb/wlan net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: dev/rtwn dev/usb/wlan net80211 X-SVN-Commit-Revision: 364673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 13:15:10 -0000 Author: bz Date: Mon Aug 24 13:15:08 2020 New Revision: 364673 URL: https://svnweb.freebsd.org/changeset/base/364673 Log: net80211: enhance getflags*() and ieee80211_add_channel*() For ieee80211_add_channel+*() we are passing in an int flag for ht40 and in some cases another int flag for vht80 where we'd only need two bits really. Convert these variables to a bitflag and fold them together into one. This also allows for VHT160 and VHT80P80 and whatever may come to be considered. Define the various options currently needed. Change the drivers (rtwn and rsu) which actually set this bit to non-0. For convenience the "1" currently used for HT40 is preserved. Enahnce getflags_5ghz() to handle the full set of VHT flags based on the input flags from the the driver. Update the regdomain implementation as well to make use of the new flags and deal with higher [V]HT bandwidths. ieee80211_add_channel() specifically did not take flags so it will not support naything beyond 20Mhz channels. Note: I am not entirely happy with the "cbw_flag[s]" name, but we do use chan_flags elsewhere already. MFC after: 2 weeks Reviewed by: adrian, gnn Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential revision: https://reviews.freebsd.org/D26091 Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/usb/wlan/if_rsu.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Mon Aug 24 13:14:38 2020 (r364672) +++ head/sys/dev/rtwn/if_rtwn.c Mon Aug 24 13:15:08 2020 (r364673) @@ -1525,25 +1525,29 @@ rtwn_getradiocaps(struct ieee80211com *ic, { struct rtwn_softc *sc = ic->ic_softc; uint8_t bands[IEEE80211_MODE_BYTES]; - int i; + int cbw_flags, i; + cbw_flags = (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) ? + NET80211_CBW_FLAG_HT40 : 0; + memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); setbit(bands, IEEE80211_MODE_11NG); ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, - bands, !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); + bands, cbw_flags); /* XXX workaround add_channel_list() limitations */ setbit(bands, IEEE80211_MODE_11A); setbit(bands, IEEE80211_MODE_11NA); for (i = 0; i < nitems(sc->chan_num_5ghz); i++) { + if (sc->chan_num_5ghz[i] == 0) continue; ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, sc->chan_list_5ghz[i], sc->chan_num_5ghz[i], bands, - !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); + cbw_flags); } } Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Mon Aug 24 13:14:38 2020 (r364672) +++ head/sys/dev/usb/wlan/if_rsu.c Mon Aug 24 13:15:08 2020 (r364673) @@ -779,7 +779,8 @@ rsu_getradiocaps(struct ieee80211com *ic, if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, - bands, (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); + bands, (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) ? + NET80211_CBW_FLAG_HT40 : 0); } static void Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Mon Aug 24 13:14:38 2020 (r364672) +++ head/sys/net80211/ieee80211.c Mon Aug 24 13:15:08 2020 (r364673) @@ -1301,7 +1301,7 @@ copychan_prev(struct ieee80211_channel chans[], int ma * XXX VHT-2GHz */ static void -getflags_2ghz(const uint8_t bands[], uint32_t flags[], int ht40) +getflags_2ghz(const uint8_t bands[], uint32_t flags[], int cbw_flags) { int nmodes; @@ -1312,7 +1312,7 @@ getflags_2ghz(const uint8_t bands[], uint32_t flags[], flags[nmodes++] = IEEE80211_CHAN_G; if (isset(bands, IEEE80211_MODE_11NG)) flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT20; - if (ht40) { + if (cbw_flags & NET80211_CBW_FLAG_HT40) { flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U; flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D; } @@ -1320,12 +1320,12 @@ getflags_2ghz(const uint8_t bands[], uint32_t flags[], } static void -getflags_5ghz(const uint8_t bands[], uint32_t flags[], int ht40, int vht80) +getflags_5ghz(const uint8_t bands[], uint32_t flags[], int cbw_flags) { int nmodes; /* - * the addchan_list function seems to expect the flags array to + * The addchan_list() function seems to expect the flags array to * be in channel width order, so the VHT bits are interspersed * as appropriate to maintain said order. * @@ -1344,36 +1344,51 @@ getflags_5ghz(const uint8_t bands[], uint32_t flags[], } /* 40MHz */ - if (ht40) { + if (cbw_flags & NET80211_CBW_FLAG_HT40) flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U; - } - if (ht40 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { - flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U - | IEEE80211_CHAN_VHT40U; - } - if (ht40) { + if ((cbw_flags & NET80211_CBW_FLAG_HT40) && + isset(bands, IEEE80211_MODE_VHT_5GHZ)) + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT40U; + if (cbw_flags & NET80211_CBW_FLAG_HT40) flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D; + if ((cbw_flags & NET80211_CBW_FLAG_HT40) && + isset(bands, IEEE80211_MODE_VHT_5GHZ)) + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT40D; + + /* 80MHz */ + if ((cbw_flags & NET80211_CBW_FLAG_VHT80) && + isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT80; + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT80; } - if (ht40 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { - flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D - | IEEE80211_CHAN_VHT40D; + + /* VHT160 */ + if ((cbw_flags & NET80211_CBW_FLAG_VHT160) && + isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT160; + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT160; } - /* 80MHz */ - if (vht80 && isset(bands, IEEE80211_MODE_VHT_5GHZ)) { - flags[nmodes++] = IEEE80211_CHAN_A | - IEEE80211_CHAN_HT40U | IEEE80211_CHAN_VHT80; - flags[nmodes++] = IEEE80211_CHAN_A | - IEEE80211_CHAN_HT40D | IEEE80211_CHAN_VHT80; + /* VHT80+80 */ + if ((cbw_flags & NET80211_CBW_FLAG_VHT80P80) && + isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | + IEEE80211_CHAN_VHT80P80; + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D | + IEEE80211_CHAN_VHT80P80; } - /* XXX VHT160 */ - /* XXX VHT80+80 */ flags[nmodes] = 0; } static void -getflags(const uint8_t bands[], uint32_t flags[], int ht40, int vht80) +getflags(const uint8_t bands[], uint32_t flags[], int cbw_flags) { flags[0] = 0; @@ -1386,15 +1401,16 @@ getflags(const uint8_t bands[], uint32_t flags[], int isset(bands, IEEE80211_MODE_VHT_2GHZ)) return; - getflags_5ghz(bands, flags, ht40, vht80); + getflags_5ghz(bands, flags, cbw_flags); } else - getflags_2ghz(bands, flags, ht40); + getflags_2ghz(bands, flags, cbw_flags); } /* * Add one 20 MHz channel into specified channel list. * You MUST NOT mix bands when calling this. It will not add 5ghz * channels if you have any B/G/N band bit set. + * This also does not support 40/80/160/80+80. */ /* XXX VHT */ int @@ -1405,7 +1421,7 @@ ieee80211_add_channel(struct ieee80211_channel chans[] uint32_t flags[IEEE80211_MODE_MAX]; int i, error; - getflags(bands, flags, 0, 0); + getflags(bands, flags, 0); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); error = addchan(chans, maxchans, nchans, ieee, freq, maxregpower, @@ -1632,12 +1648,12 @@ add_chanlist(struct ieee80211_channel chans[], int max int ieee80211_add_channel_list_2ghz(struct ieee80211_channel chans[], int maxchans, int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], - int ht40) + int cbw_flags) { uint32_t flags[IEEE80211_MODE_MAX]; /* XXX no VHT for now */ - getflags_2ghz(bands, flags, ht40); + getflags_2ghz(bands, flags, cbw_flags); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); return (add_chanlist(chans, maxchans, nchans, ieee, nieee, flags)); @@ -1645,30 +1661,27 @@ ieee80211_add_channel_list_2ghz(struct ieee80211_chann int ieee80211_add_channels_default_2ghz(struct ieee80211_channel chans[], - int maxchans, int *nchans, const uint8_t bands[], int ht40) + int maxchans, int *nchans, const uint8_t bands[], int cbw_flags) { const uint8_t default_chan_list[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; return (ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - default_chan_list, nitems(default_chan_list), bands, ht40)); + default_chan_list, nitems(default_chan_list), bands, cbw_flags)); } int ieee80211_add_channel_list_5ghz(struct ieee80211_channel chans[], int maxchans, int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], - int ht40) + int cbw_flags) { - uint32_t flags[IEEE80211_MODE_MAX]; - int vht80 = 0; - /* - * For now, assume VHT == VHT80 support as a minimum. + * XXX-BZ with HT and VHT there is no 1:1 mapping anymore. Review all + * uses of IEEE80211_MODE_MAX and add a new #define name for array size. */ - if (isset(bands, IEEE80211_MODE_VHT_5GHZ)) - vht80 = 1; + uint32_t flags[2 * IEEE80211_MODE_MAX]; - getflags_5ghz(bands, flags, ht40, vht80); + getflags_5ghz(bands, flags, cbw_flags); KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); return (add_chanlist(chans, maxchans, nchans, ieee, nieee, flags)); Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Mon Aug 24 13:14:38 2020 (r364672) +++ head/sys/net80211/ieee80211_regdomain.c Mon Aug 24 13:15:08 2020 (r364673) @@ -118,10 +118,11 @@ ieee80211_init_channels(struct ieee80211com *ic, { struct ieee80211_channel *chans = ic->ic_channels; int *nchans = &ic->ic_nchans; - int ht40; + int cbw_flags; /* XXX just do something for now */ - ht40 = !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40); + cbw_flags = (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) ? + NET80211_CBW_FLAG_HT40 : 0; *nchans = 0; if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G) || @@ -131,19 +132,40 @@ ieee80211_init_channels(struct ieee80211com *ic, nchan -= 3; ieee80211_add_channel_list_2ghz(chans, IEEE80211_CHAN_MAX, - nchans, def_chan_2ghz, nchan, bands, ht40); + nchans, def_chan_2ghz, nchan, bands, cbw_flags); } + /* XXX IEEE80211_MODE_VHT_2GHZ if we really want to. */ + if (isset(bands, IEEE80211_MODE_11A) || isset(bands, IEEE80211_MODE_11NA)) { ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), - bands, ht40); + bands, cbw_flags); ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band2, nitems(def_chan_5ghz_band2), - bands, ht40); + bands, cbw_flags); ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band3, nitems(def_chan_5ghz_band3), - bands, ht40); + bands, cbw_flags); + } + if (isset(bands, IEEE80211_MODE_VHT_5GHZ)) { + cbw_flags |= NET80211_CBW_FLAG_HT40; /* Make sure this is set; or assert? */ + cbw_flags |= NET80211_CBW_FLAG_VHT80; +#define MS(_v, _f) (((_v) & _f) >> _f##_S) + if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1) + cbw_flags |= NET80211_CBW_FLAG_VHT160; + if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) + cbw_flags |= NET80211_CBW_FLAG_VHT80P80; +#undef MS + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), + bands, cbw_flags); + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band2, nitems(def_chan_5ghz_band2), + bands, cbw_flags); + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band3, nitems(def_chan_5ghz_band3), + bands, cbw_flags); } if (rd != NULL) ic->ic_regdomain = *rd; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Aug 24 13:14:38 2020 (r364672) +++ head/sys/net80211/ieee80211_var.h Mon Aug 24 13:15:08 2020 (r364673) @@ -779,6 +779,10 @@ int ieee80211_add_channel_ht40(struct ieee80211_channe uint32_t ieee80211_get_channel_center_freq(const struct ieee80211_channel *); uint32_t ieee80211_get_channel_center_freq1(const struct ieee80211_channel *); uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); +#define NET80211_CBW_FLAG_HT40 0x01 +#define NET80211_CBW_FLAG_VHT80 0x02 +#define NET80211_CBW_FLAG_VHT160 0x04 +#define NET80211_CBW_FLAG_VHT80P80 0x08 int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); int ieee80211_add_channels_default_2ghz(struct ieee80211_channel[], int, From owner-svn-src-head@freebsd.org Mon Aug 24 13:40:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 591C83C0596; Mon, 24 Aug 2020 13:40:36 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZtYJ1hhfz4p7f; Mon, 24 Aug 2020 13:40:36 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E00519467; Mon, 24 Aug 2020 13:40:36 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07ODeaxW068402; Mon, 24 Aug 2020 13:40:36 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07ODeaBG068401; Mon, 24 Aug 2020 13:40:36 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202008241340.07ODeaBG068401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 24 Aug 2020 13:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364675 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 364675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 13:40:36 -0000 Author: luporl Date: Mon Aug 24 13:40:35 2020 New Revision: 364675 URL: https://svnweb.freebsd.org/changeset/base/364675 Log: [PowerPC] Make new auxv format default Assume ELF images without OSREL use the new auxv format. This is specially important for rtld, that is not tagged. Using direct exec mode with new (ELFv2) binaries that expect the new auxv format would result in crashes otherwise. Unfortunately, this may break direct exec'ing old binaries, but it seems better to correctly support new binaries by default, considering the transition to ELFv2 happened quite some time ago. If needed, a sysctl may be added to allow old auxv format to be used when OSREL is not found. Reviewed by: bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D25651 Modified: head/sys/powerpc/powerpc/elf_common.c Modified: head/sys/powerpc/powerpc/elf_common.c ============================================================================== --- head/sys/powerpc/powerpc/elf_common.c Mon Aug 24 13:19:16 2020 (r364674) +++ head/sys/powerpc/powerpc/elf_common.c Mon Aug 24 13:40:35 2020 (r364675) @@ -36,7 +36,22 @@ __elfN(powerpc_copyout_auxargs)(struct image_params *i Elf_Auxinfo *argarray, *pos; int error; - if (imgp->proc->p_osrel >= P_OSREL_POWERPC_NEW_AUX_ARGS) + /* + * XXX If we can't find image's OSREL, assume it uses the new auxv + * format. + * + * This is specially important for rtld, that is not tagged. Using + * direct exec mode with new (ELFv2) binaries that expect the new auxv + * format would result in crashes otherwise. + * + * Unfortunately, this may break direct exec'ing old binaries, + * but it seems better to correctly support new binaries by default, + * considering the transition to ELFv2 happened quite some time + * ago. If needed, a sysctl may be added to allow old auxv format to + * be used when OSREL is not found. + */ + if (imgp->proc->p_osrel >= P_OSREL_POWERPC_NEW_AUX_ARGS || + imgp->proc->p_osrel == 0) return (__elfN(freebsd_copyout_auxargs)(imgp, base)); args = (Elf_Auxargs *)imgp->auxargs; From owner-svn-src-head@freebsd.org Mon Aug 24 14:00:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9313D3C1033; Mon, 24 Aug 2020 14:00:13 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZtzx3DnNz4r58; Mon, 24 Aug 2020 14:00:13 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 529691993A; Mon, 24 Aug 2020 14:00:13 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OE0Dpb080232; Mon, 24 Aug 2020 14:00:13 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OE0D6M080231; Mon, 24 Aug 2020 14:00:13 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202008241400.07OE0D6M080231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 24 Aug 2020 14:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364682 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 364682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 14:00:13 -0000 Author: blackend (doc committer) Date: Mon Aug 24 14:00:12 2020 New Revision: 364682 URL: https://svnweb.freebsd.org/changeset/base/364682 Log: Add missing Korean doc package entry, remove non-existent Serbian doc package entry. Approved by: re (gjb) MFC after: 1 week Modified: head/usr.sbin/bsdinstall/scripts/docsinstall Modified: head/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- head/usr.sbin/bsdinstall/scripts/docsinstall Mon Aug 24 13:56:15 2020 (r364681) +++ head/usr.sbin/bsdinstall/scripts/docsinstall Mon Aug 24 14:00:12 2020 (r364682) @@ -42,7 +42,7 @@ f_include $BSDCFG_SHARE/packages/packages.subr # List of languages to display (descriptions pulled from $msg_{lang}doc_desc) # : ${DOCSINSTALL_LANGS:=\ - bn da de el en es fr hu it ja mn nl pl pt ru sr tr zh_cn zh_tw \ + bn da de el en es fr hu it ja ko mn nl pl pt ru tr zh_cn zh_tw \ } ############################################################ GLOBALS @@ -65,13 +65,13 @@ msg_freebsd_installer="FreeBSD Installer" msg_hudoc_desc="Hungarian Documentation" msg_itdoc_desc="Italian Documentation" msg_jadoc_desc="Japanese Documentation" +msg_kodoc_desc="Korean Documentation" msg_mndoc_desc="Mongolian Documentation" msg_nldoc_desc="Dutch Documentation" msg_ok="OK" msg_pldoc_desc="Polish Documentation" msg_ptdoc_desc="Portuguese Documentation" msg_rudoc_desc="Russian Documentation" -msg_srdoc_desc="Serbian Documentation" msg_trdoc_desc="Turkish Documentation" msg_zh_cndoc_desc="Simplified Chinese Documentation" msg_zh_twdoc_desc="Traditional Chinese Documentation" From owner-svn-src-head@freebsd.org Mon Aug 24 14:04:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E63393C10B8; Mon, 24 Aug 2020 14:04:59 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZv5R5lRtz4rjg; Mon, 24 Aug 2020 14:04:59 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8B5A19D13; Mon, 24 Aug 2020 14:04:59 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OE4xES085941; Mon, 24 Aug 2020 14:04:59 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OE4xKk085940; Mon, 24 Aug 2020 14:04:59 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202008241404.07OE4xKk085940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 24 Aug 2020 14:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364684 - head/usr.sbin/bsdinstall X-SVN-Group: head X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: head/usr.sbin/bsdinstall X-SVN-Commit-Revision: 364684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 14:05:00 -0000 Author: blackend (doc committer) Date: Mon Aug 24 14:04:59 2020 New Revision: 364684 URL: https://svnweb.freebsd.org/changeset/base/364684 Log: s/redundacy/redundancy MFC after: 1 week Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Mon Aug 24 14:01:52 2020 (r364683) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Mon Aug 24 14:04:59 2020 (r364684) @@ -349,7 +349,7 @@ Default: .Dq default .It Ev ZFSBOOT_VDEV_TYPE The type of pool to be created for the base system. -This variable can take one of this values: stripe (No redundacy), +This variable can take one of this values: stripe (No redundancy), mirror (n-Way mirroring), raid10 (RAID 1+0 - n x 2-Way Mirrors), raidz1 (RAID-Z1 - Single Redundancy RAID), raidz2 (RAID-Z2 - Double Redundancy RAID) or raidz3 (RAID-Z3 Triple Redundancy RAID). From owner-svn-src-head@freebsd.org Mon Aug 24 16:06:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A91133C5CB2; Mon, 24 Aug 2020 16:06:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZxnJ41R4z3YyM; Mon, 24 Aug 2020 16:06:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D3F91B403; Mon, 24 Aug 2020 16:06:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OG6Cbd061886; Mon, 24 Aug 2020 16:06:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OG6CUd061884; Mon, 24 Aug 2020 16:06:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008241606.07OG6CUd061884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2020 16:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364701 - in head: . tools/build X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . tools/build X-SVN-Commit-Revision: 364701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 16:06:12 -0000 Author: imp Date: Mon Aug 24 16:06:11 2020 New Revision: 364701 URL: https://svnweb.freebsd.org/changeset/base/364701 Log: When copying over the binaries, use '-p' to preserve date/time Although I can't reproduce it, others are seeing different lex/yacc programs always regenerated after my change to copy rather than symlink the files. The reported fix is to add '-p' to the copies. Since it doesn't hurt, go head and add it, though the reasons for this mattering remain at best obscure and poorly articulated. Modified: head/Makefile.inc1 head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 24 16:00:58 2020 (r364700) +++ head/Makefile.inc1 Mon Aug 24 16:06:11 2020 (r364701) @@ -2319,7 +2319,7 @@ ${_bt}-link-${_tool}: .PHONY .MAKE if [ ! -e "$${source_path}" ] ; then \ echo "Cannot find host tool '${_tool}'"; false; \ fi; \ - cp -f "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}" + cp -pf "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}" ${_bt}-links: ${_bt}-link-${_tool} .endfor Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Aug 24 16:00:58 2020 (r364700) +++ head/tools/build/Makefile Mon Aug 24 16:06:11 2020 (r364701) @@ -130,7 +130,7 @@ host-symlinks: echo "Cannot find host tool '${_tool}'"; false; \ fi; \ rm -f "${DESTDIR}/bin/${_tool}"; \ - cp -f "$${source_path}" "${DESTDIR}/bin/${_tool}" + cp -pf "$${source_path}" "${DESTDIR}/bin/${_tool}" .endfor .for _tool in ${_host_abs_tools_to_symlink} @source_path="${_tool:S/:/ /:[1]}"; \ @@ -139,11 +139,11 @@ host-symlinks: echo "Host tool '${src_path}' is missing"; false; \ fi; \ rm -f "$${target_path}"; \ - cp -f "$${source_path}" "$${target_path}" + cp -pf "$${source_path}" "$${target_path}" .endfor .if exists(/usr/libexec/flua) rm -f ${DESTDIR}/usr/libexec/flua - cp -f /usr/libexec/flua ${DESTDIR}/usr/libexec/flua + cp -pf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua .endif # Create all the directories that are needed during the legacy, bootstrap-tools From owner-svn-src-head@freebsd.org Mon Aug 24 16:45:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5994B3C7349; Mon, 24 Aug 2020 16:45:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZyfX1mSBz3dC1; Mon, 24 Aug 2020 16:45:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 200AF1B842; Mon, 24 Aug 2020 16:45:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OGjO5K086963; Mon, 24 Aug 2020 16:45:24 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OGjOYC086962; Mon, 24 Aug 2020 16:45:24 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <202008241645.07OGjOYC086962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 24 Aug 2020 16:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364711 - head/usr.sbin/gstat X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/usr.sbin/gstat X-SVN-Commit-Revision: 364711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 16:45:24 -0000 Author: sobomax Date: Mon Aug 24 16:45:23 2020 New Revision: 364711 URL: https://svnweb.freebsd.org/changeset/base/364711 Log: In the endless batch mode (-B), terminate if and when stdout is closed. That mode is useful to call gstat from other app, however kinda useless since gstat won't exit and stay running forever when its parent process has long gone. MFC after: 2 weeks Modified: head/usr.sbin/gstat/gstat.c Modified: head/usr.sbin/gstat/gstat.c ============================================================================== --- head/usr.sbin/gstat/gstat.c Mon Aug 24 16:44:17 2020 (r364710) +++ head/usr.sbin/gstat/gstat.c Mon Aug 24 16:45:23 2020 (r364711) @@ -517,7 +517,8 @@ main(int argc, char **argv) if (!flag_B) loop = 0; else - fflush(stdout); + if (fflush(stdout) == EOF) + goto out; usleep(flag_I); continue; } @@ -585,7 +586,7 @@ main(int argc, char **argv) } } } - +out: if (!flag_b) { el_end(el); endwin(); From owner-svn-src-head@freebsd.org Mon Aug 24 17:43:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 936933C8EEE; Mon, 24 Aug 2020 17:43:30 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZzxZ2YjQz41JG; Mon, 24 Aug 2020 17:43:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BEB41C2C5; Mon, 24 Aug 2020 17:43:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OHhUAL024535; Mon, 24 Aug 2020 17:43:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OHhOew024502; Mon, 24 Aug 2020 17:43:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008241743.07OHhOew024502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 24 Aug 2020 17:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364718 - in head: contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/clang/lib/AST contrib/llvm-project/clang/lib/Basic... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/clang/lib/AST contrib/llvm-project/clang/lib/Basic contrib/llvm-project/cla... X-SVN-Commit-Revision: 364718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 17:43:30 -0000 Author: dim Date: Mon Aug 24 17:43:23 2020 New Revision: 364718 URL: https://svnweb.freebsd.org/changeset/base/364718 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp release/11.x llvmorg-11.0.0-rc2-0-g414f32a9e86. MFC after: 6 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm-project/clang/include/clang/Driver/Options.td head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp head/contrib/llvm-project/clang/lib/Basic/Targets.cpp head/contrib/llvm-project/clang/lib/Basic/Targets/OSTargets.h head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h head/contrib/llvm-project/clang/lib/Basic/Targets/Sparc.cpp head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.h head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/AArch64.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm-project/libunwind/src/AddressSpace.hpp head/contrib/llvm-project/lld/docs/ReleaseNotes.rst head/contrib/llvm-project/lld/docs/conf.py head/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.h head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.h head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64StackOffset.h head/contrib/llvm-project/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.td head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/libunwind/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h Mon Aug 24 17:43:23 2020 (r364718) @@ -54,6 +54,10 @@ class TargetOptions { (public) /// be a list of strings starting with by '+' or '-'. std::vector Features; + /// The map of which features have been enabled disabled based on the command + /// line. + llvm::StringMap FeatureMap; + /// Supported OpenCL extensions and optional core features. OpenCLOptions SupportedOpenCLOptions; Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Aug 24 17:43:23 2020 (r364718) @@ -1780,7 +1780,7 @@ def fstack_protector_all : Flag<["-"], "fstack-protect HelpText<"Enable stack protectors for all functions">; def fstack_clash_protection : Flag<["-"], "fstack-clash-protection">, Group, Flags<[CC1Option]>, HelpText<"Enable stack clash protection">; -def fnostack_clash_protection : Flag<["-"], "fnostack-clash-protection">, Group, +def fno_stack_clash_protection : Flag<["-"], "fno-stack-clash-protection">, Group, HelpText<"Disable stack clash protection">; def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group, HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. " Modified: head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -11147,8 +11147,7 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap std::vector Features(FeaturesTmp.begin(), FeaturesTmp.end()); Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } else { - Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, - Target->getTargetOpts().Features); + FeatureMap = Target->getTargetOpts().FeatureMap; } } Modified: head/contrib/llvm-project/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -346,6 +346,8 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new FreeBSDTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::AIX: return new AIXPPC64TargetInfo(Triple, Opts); default: @@ -358,6 +360,8 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new LinuxTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(Triple, Opts); default: return new PPC64TargetInfo(Triple, Opts); } @@ -387,6 +391,8 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, switch (os) { case llvm::Triple::FreeBSD: return new FreeBSDTargetInfo(Triple, Opts); + case llvm::Triple::OpenBSD: + return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::Fuchsia: return new FuchsiaTargetInfo(Triple, Opts); case llvm::Triple::Linux: @@ -662,14 +668,13 @@ TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, // Compute the default target features, we need the target to handle this // because features may have dependencies on one another. - llvm::StringMap Features; - if (!Target->initFeatureMap(Features, Diags, Opts->CPU, + if (!Target->initFeatureMap(Opts->FeatureMap, Diags, Opts->CPU, Opts->FeaturesAsWritten)) return nullptr; // Add the features to the compile options. Opts->Features.clear(); - for (const auto &F : Features) + for (const auto &F : Opts->FeatureMap) Opts->Features.push_back((F.getValue() ? "+" : "-") + F.getKey().str()); // Sort here, so we handle the features in a predictable order. (This matters // when we're dealing with features that overlap.) Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/OSTargets.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/OSTargets.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/OSTargets.h Mon Aug 24 17:43:23 2020 (r364718) @@ -465,6 +465,9 @@ class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : publ public: OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : OSTargetInfo(Triple, Opts) { + this->WCharType = this->WIntType = this->SignedInt; + this->IntMaxType = TargetInfo::SignedLongLong; + this->Int64Type = TargetInfo::SignedLongLong; switch (Triple.getArch()) { case llvm::Triple::x86: case llvm::Triple::x86_64: @@ -476,6 +479,8 @@ class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : publ case llvm::Triple::mips64: case llvm::Triple::mips64el: case llvm::Triple::ppc: + case llvm::Triple::ppc64: + case llvm::Triple::ppc64le: case llvm::Triple::sparcv9: this->MCountName = "_mcount"; break; Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Aug 24 17:43:23 2020 (r364718) @@ -414,8 +414,8 @@ class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public ABI = "elfv1"; } - if (Triple.isOSFreeBSD() || Triple.getOS() == llvm::Triple::AIX || - Triple.isMusl()) { + if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || + Triple.getOS() == llvm::Triple::AIX || Triple.isMusl()) { LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/Sparc.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/Sparc.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/Sparc.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -240,6 +240,11 @@ void SparcV9TargetInfo::getTargetDefines(const LangOpt Builder.defineMacro("__sparc_v9__"); Builder.defineMacro("__sparcv9__"); } + + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); } void SparcV9TargetInfo::fillValidCPUList( Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -96,19 +96,43 @@ void WebAssemblyTargetInfo::getTargetDefines(const Lan } void WebAssemblyTargetInfo::setSIMDLevel(llvm::StringMap &Features, - SIMDEnum Level) { + SIMDEnum Level, bool Enabled) { + if (Enabled) { + switch (Level) { + case UnimplementedSIMD128: + Features["unimplemented-simd128"] = true; + LLVM_FALLTHROUGH; + case SIMD128: + Features["simd128"] = true; + LLVM_FALLTHROUGH; + case NoSIMD: + break; + } + return; + } + switch (Level) { - case UnimplementedSIMD128: - Features["unimplemented-simd128"] = true; - LLVM_FALLTHROUGH; + case NoSIMD: case SIMD128: - Features["simd128"] = true; + Features["simd128"] = false; LLVM_FALLTHROUGH; - case NoSIMD: + case UnimplementedSIMD128: + Features["unimplemented-simd128"] = false; break; } } +void WebAssemblyTargetInfo::setFeatureEnabled(llvm::StringMap &Features, + StringRef Name, + bool Enabled) const { + if (Name == "simd128") + setSIMDLevel(Features, SIMD128, Enabled); + else if (Name == "unimplemented-simd128") + setSIMDLevel(Features, UnimplementedSIMD128, Enabled); + else + Features[Name] = Enabled; +} + bool WebAssemblyTargetInfo::initFeatureMap( llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const { @@ -119,30 +143,8 @@ bool WebAssemblyTargetInfo::initFeatureMap( Features["atomics"] = true; Features["mutable-globals"] = true; Features["tail-call"] = true; - setSIMDLevel(Features, SIMD128); + setSIMDLevel(Features, SIMD128, true); } - // Other targets do not consider user-configured features here, but while we - // are actively developing new features it is useful to let user-configured - // features control availability of builtins - setSIMDLevel(Features, SIMDLevel); - if (HasNontrappingFPToInt) - Features["nontrapping-fptoint"] = true; - if (HasSignExt) - Features["sign-ext"] = true; - if (HasExceptionHandling) - Features["exception-handling"] = true; - if (HasBulkMemory) - Features["bulk-memory"] = true; - if (HasAtomics) - Features["atomics"] = true; - if (HasMutableGlobals) - Features["mutable-globals"] = true; - if (HasMultivalue) - Features["multivalue"] = true; - if (HasTailCall) - Features["tail-call"] = true; - if (HasReferenceTypes) - Features["reference-types"] = true; return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec); } Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/WebAssembly.h Mon Aug 24 17:43:23 2020 (r364718) @@ -69,13 +69,17 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyTargetInfo : MacroBuilder &Builder) const override; private: - static void setSIMDLevel(llvm::StringMap &Features, SIMDEnum Level); + static void setSIMDLevel(llvm::StringMap &Features, SIMDEnum Level, + bool Enabled); bool initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const override; bool hasFeature(StringRef Feature) const final; + + void setFeatureEnabled(llvm::StringMap &Features, StringRef Name, + bool Enabled) const final; bool handleTargetFeatures(std::vector &Features, DiagnosticsEngine &Diags) final; Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -4956,11 +4956,7 @@ bool CGOpenMPRuntimeNVPTX::hasAllocateAttributeForGlob static CudaArch getCudaArch(CodeGenModule &CGM) { if (!CGM.getTarget().hasFeature("ptx")) return CudaArch::UNKNOWN; - llvm::StringMap Features; - CGM.getTarget().initFeatureMap(Features, CGM.getDiags(), - CGM.getTarget().getTargetOpts().CPU, - CGM.getTarget().getTargetOpts().Features); - for (const auto &Feature : Features) { + for (const auto &Feature : CGM.getTarget().getTargetOpts().FeatureMap) { if (Feature.getValue()) { CudaArch Arch = StringToCudaArch(Feature.getKey()); if (Arch != CudaArch::UNKNOWN) Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/AArch64.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/AArch64.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/AArch64.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -370,9 +370,11 @@ fp16_fml_fallthrough: V8_6Pos = Features.insert(std::next(V8_6Pos), {"+i8mm", "+bf16"}); if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access, - options::OPT_munaligned_access)) + options::OPT_munaligned_access)) { if (A->getOption().matches(options::OPT_mno_unaligned_access)) Features.push_back("+strict-align"); + } else if (Triple.isOSOpenBSD()) + Features.push_back("+strict-align"); if (Args.hasArg(options::OPT_ffixed_x1)) Features.push_back("+reserve-x1"); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/X86.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -93,13 +93,13 @@ const char *x86::getX86TargetCPU(const ArgList &Args, return "x86-64"; switch (Triple.getOS()) { - case llvm::Triple::FreeBSD: - return "i686"; case llvm::Triple::NetBSD: - case llvm::Triple::OpenBSD: return "i486"; case llvm::Triple::Haiku: + case llvm::Triple::OpenBSD: return "i586"; + case llvm::Triple::FreeBSD: + return "i686"; default: // Fallback to p4. return "pentium4"; Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -1879,8 +1879,8 @@ void Clang::AddPPCTargetArgs(const ArgList &Args, ABIName = "elfv1-qpx"; break; } - - if (T.isMusl() || (T.isOSFreeBSD() && T.getOSMajorVersion() >= 13)) + if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) || + T.isOSOpenBSD() || T.isMusl()) ABIName = "elfv2"; else ABIName = "elfv1"; @@ -2971,7 +2971,7 @@ static void RenderSCPOptions(const ToolChain &TC, cons return; if (Args.hasFlag(options::OPT_fstack_clash_protection, - options::OPT_fnostack_clash_protection, false)) + options::OPT_fno_stack_clash_protection, false)) CmdArgs.push_back("-fstack-clash-protection"); } Modified: head/contrib/llvm-project/libunwind/src/AddressSpace.hpp ============================================================================== --- head/contrib/llvm-project/libunwind/src/AddressSpace.hpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/libunwind/src/AddressSpace.hpp Mon Aug 24 17:43:23 2020 (r364718) @@ -457,7 +457,7 @@ struct _LIBUNWIND_HIDDEN dl_iterate_cb_data { // There should be just one of these per process. static FrameHeaderCache ProcessFrameHeaderCache; -#endif // _LIBUNWIND_USE_FRAME_HEADER_CACHE +#endif static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base, dl_iterate_cb_data *cbdata) { @@ -481,7 +481,7 @@ int findUnwindSectionsByPhdr(struct dl_phdr_info *pinf #if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE) if (ProcessFrameHeaderCache.find(pinfo, pinfo_size, data)) return 1; -#endif // _LIBUNWIND_USE_FRAME_HEADER_CACHE +#endif Elf_Addr image_base = calculateImageBase(pinfo); bool found_obj = false; @@ -511,7 +511,7 @@ int findUnwindSectionsByPhdr(struct dl_phdr_info *pinf if (found_obj && found_hdr) { #if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE) ProcessFrameHeaderCache.add(cbdata->sects); -#endif // _LIBUNWIND_USE_FRAME_HEADER_CACHE +#endif return 1; } } Modified: head/contrib/llvm-project/lld/docs/ReleaseNotes.rst ============================================================================== --- head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/lld/docs/ReleaseNotes.rst Mon Aug 24 17:43:23 2020 (r364718) @@ -28,6 +28,10 @@ ELF Improvements chrome://tracing. The file can be specified with ``--time-trace-file``. Trace granularity can be specified with ``--time-trace-granularity``. (`D71060 `_) +* For ARM architectures the default max page size was increased to 64k. + This increases compatibility with systems where a non standard page + size was configured. This also is inline with GNU ld defaults. + (`D77330 `_) * ... Breaking changes @@ -40,12 +44,17 @@ Breaking changes COFF Improvements ----------------- -* ... +* Fixed exporting symbols whose names contain a period (``.``), which was + a regression in lld 7. MinGW Improvements ------------------ -* ... +* Implemented new options for disabling auto import and runtime pseudo + relocations (``--disable-auto-import`` and + ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options + for selecting file and section alignment (``--file-alignment`` and + ``--section-alignment``). MachO Improvements ------------------ Modified: head/contrib/llvm-project/lld/docs/conf.py ============================================================================== --- head/contrib/llvm-project/lld/docs/conf.py Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/lld/docs/conf.py Mon Aug 24 17:43:23 2020 (r364718) @@ -134,7 +134,7 @@ html_last_updated_fmt = '%Y-%m-%d' #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -html_sidebars = {'index': 'indexsidebar.html'} +html_sidebars = {'index': ['indexsidebar.html']} # Additional templates that should be rendered to pages, maps page names to # template names. Modified: head/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h ============================================================================== --- head/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/include/llvm/MC/MCDwarf.h Mon Aug 24 17:43:23 2020 (r364718) @@ -467,10 +467,12 @@ class MCCFIInstruction { (private) unsigned Register2; }; std::vector Values; + std::string Comment; - MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R, int O, StringRef V) + MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R, int O, StringRef V, + StringRef Comment = "") : Operation(Op), Label(L), Register(R), Offset(O), - Values(V.begin(), V.end()) { + Values(V.begin(), V.end()), Comment(Comment) { assert(Op != OpRegister); } @@ -570,8 +572,9 @@ class MCCFIInstruction { (private) /// .cfi_escape Allows the user to add arbitrary bytes to the unwind /// info. - static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals) { - return MCCFIInstruction(OpEscape, L, 0, 0, Vals); + static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals, + StringRef Comment = "") { + return MCCFIInstruction(OpEscape, L, 0, 0, Vals, Comment); } /// A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE @@ -605,6 +608,10 @@ class MCCFIInstruction { (private) StringRef getValues() const { assert(Operation == OpEscape); return StringRef(&Values[0], Values.size()); + } + + StringRef getComment() const { + return Comment; } }; Modified: head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -241,6 +241,7 @@ void AsmPrinter::emitCFIInstruction(const MCCFIInstruc OutStreamer->emitCFIGnuArgsSize(Inst.getOffset()); break; case MCCFIInstruction::OpEscape: + OutStreamer->AddComment(Inst.getComment()); OutStreamer->emitCFIEscape(Inst.getValues()); break; case MCCFIInstruction::OpRestore: Modified: head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -37,6 +37,10 @@ class FeatureBitset { (public) set(I); } + bool any() const { + return llvm::any_of(Bits, [](uint64_t V) { return V != 0; }); + } + constexpr FeatureBitset &set(unsigned I) { // GCC <6.2 crashes if this is written in a single statement. uint32_t NewBits = Bits[I / 32] | (uint32_t(1) << (I % 32)); @@ -89,6 +93,13 @@ class FeatureBitset { (public) Result.Bits[I] = ~Bits[I]; return Result; } + + constexpr bool operator!=(const FeatureBitset &RHS) const { + for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) + if (Bits[I] != RHS.Bits[I]) + return true; + return false; + } }; struct ProcInfo { @@ -552,11 +563,17 @@ void llvm::X86::getFeaturesForCPU(StringRef CPU, // For each feature that is (transitively) implied by this feature, set it. static void getImpliedEnabledFeatures(FeatureBitset &Bits, const FeatureBitset &Implies) { + // Fast path: Implies is often empty. + if (!Implies.any()) + return; + FeatureBitset Prev; Bits |= Implies; - for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i) { - if (Implies[i]) - getImpliedEnabledFeatures(Bits, FeatureInfos[i].ImpliedFeatures); - } + do { + Prev = Bits; + for (unsigned i = CPU_FEATURE_MAX; i;) + if (Bits[--i]) + Bits |= FeatureInfos[i].ImpliedFeatures; + } while (Prev != Bits); } /// Create bit vector of features that are implied disabled if the feature @@ -564,12 +581,14 @@ static void getImpliedEnabledFeatures(FeatureBitset &B static void getImpliedDisabledFeatures(FeatureBitset &Bits, unsigned Value) { // Check all features looking for any dependent on this feature. If we find // one, mark it and recursively find any feature that depend on it. - for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i) { - if (FeatureInfos[i].ImpliedFeatures[Value]) { - Bits.set(i); - getImpliedDisabledFeatures(Bits, i); - } - } + FeatureBitset Prev; + Bits.set(Value); + do { + Prev = Bits; + for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i) + if ((FeatureInfos[i].ImpliedFeatures & Bits).any()) + Bits.set(i); + } while (Prev != Bits); } void llvm::X86::getImpliedFeatures( Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -148,6 +148,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/LEB128.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" @@ -399,12 +400,102 @@ static bool ShouldSignReturnAddress(MachineFunction &M return false; } +// Convenience function to create a DWARF expression for +// Expr + NumBytes + NumVGScaledBytes * AArch64::VG +static void appendVGScaledOffsetExpr(SmallVectorImpl &Expr, + int NumBytes, int NumVGScaledBytes, unsigned VG, + llvm::raw_string_ostream &Comment) { + uint8_t buffer[16]; + + if (NumBytes) { + Expr.push_back(dwarf::DW_OP_consts); + Expr.append(buffer, buffer + encodeSLEB128(NumBytes, buffer)); + Expr.push_back((uint8_t)dwarf::DW_OP_plus); + Comment << (NumBytes < 0 ? " - " : " + ") << std::abs(NumBytes); + } + + if (NumVGScaledBytes) { + Expr.push_back((uint8_t)dwarf::DW_OP_consts); + Expr.append(buffer, buffer + encodeSLEB128(NumVGScaledBytes, buffer)); + + Expr.push_back((uint8_t)dwarf::DW_OP_bregx); + Expr.append(buffer, buffer + encodeULEB128(VG, buffer)); + Expr.push_back(0); + + Expr.push_back((uint8_t)dwarf::DW_OP_mul); + Expr.push_back((uint8_t)dwarf::DW_OP_plus); + + Comment << (NumVGScaledBytes < 0 ? " - " : " + ") + << std::abs(NumVGScaledBytes) << " * VG"; + } +} + +// Creates an MCCFIInstruction: +// { DW_CFA_def_cfa_expression, ULEB128 (sizeof expr), expr } +MCCFIInstruction AArch64FrameLowering::createDefCFAExpressionFromSP( + const TargetRegisterInfo &TRI, const StackOffset &OffsetFromSP) const { + int64_t NumBytes, NumVGScaledBytes; + OffsetFromSP.getForDwarfOffset(NumBytes, NumVGScaledBytes); + + std::string CommentBuffer = "sp"; + llvm::raw_string_ostream Comment(CommentBuffer); + + // Build up the expression (SP + NumBytes + NumVGScaledBytes * AArch64::VG) + SmallString<64> Expr; + Expr.push_back((uint8_t)(dwarf::DW_OP_breg0 + /*SP*/ 31)); + Expr.push_back(0); + appendVGScaledOffsetExpr(Expr, NumBytes, NumVGScaledBytes, + TRI.getDwarfRegNum(AArch64::VG, true), Comment); + + // Wrap this into DW_CFA_def_cfa. + SmallString<64> DefCfaExpr; + DefCfaExpr.push_back(dwarf::DW_CFA_def_cfa_expression); + uint8_t buffer[16]; + DefCfaExpr.append(buffer, + buffer + encodeULEB128(Expr.size(), buffer)); + DefCfaExpr.append(Expr.str()); + return MCCFIInstruction::createEscape(nullptr, DefCfaExpr.str(), + Comment.str()); +} + +MCCFIInstruction AArch64FrameLowering::createCfaOffset( + const TargetRegisterInfo &TRI, unsigned Reg, + const StackOffset &OffsetFromDefCFA) const { + int64_t NumBytes, NumVGScaledBytes; + OffsetFromDefCFA.getForDwarfOffset(NumBytes, NumVGScaledBytes); + + unsigned DwarfReg = TRI.getDwarfRegNum(Reg, true); + + // Non-scalable offsets can use DW_CFA_offset directly. + if (!NumVGScaledBytes) + return MCCFIInstruction::createOffset(nullptr, DwarfReg, NumBytes); + + std::string CommentBuffer; + llvm::raw_string_ostream Comment(CommentBuffer); + Comment << printReg(Reg, &TRI) << " @ cfa"; + + // Build up expression (NumBytes + NumVGScaledBytes * AArch64::VG) + SmallString<64> OffsetExpr; + appendVGScaledOffsetExpr(OffsetExpr, NumBytes, NumVGScaledBytes, + TRI.getDwarfRegNum(AArch64::VG, true), Comment); + + // Wrap this into DW_CFA_expression + SmallString<64> CfaExpr; + CfaExpr.push_back(dwarf::DW_CFA_expression); + uint8_t buffer[16]; + CfaExpr.append(buffer, buffer + encodeULEB128(DwarfReg, buffer)); + CfaExpr.append(buffer, buffer + encodeULEB128(OffsetExpr.size(), buffer)); + CfaExpr.append(OffsetExpr.str()); + + return MCCFIInstruction::createEscape(nullptr, CfaExpr.str(), Comment.str()); +} + void AArch64FrameLowering::emitCalleeSavedFrameMoves( MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) const { MachineFunction &MF = *MBB.getParent(); MachineFrameInfo &MFI = MF.getFrameInfo(); const TargetSubtargetInfo &STI = MF.getSubtarget(); - const MCRegisterInfo *MRI = STI.getRegisterInfo(); + const TargetRegisterInfo *TRI = STI.getRegisterInfo(); const TargetInstrInfo *TII = STI.getInstrInfo(); DebugLoc DL = MBB.findDebugLoc(MBBI); @@ -415,11 +506,26 @@ void AArch64FrameLowering::emitCalleeSavedFrameMoves( for (const auto &Info : CSI) { unsigned Reg = Info.getReg(); - int64_t Offset = - MFI.getObjectOffset(Info.getFrameIdx()) - getOffsetOfLocalArea(); - unsigned DwarfReg = MRI->getDwarfRegNum(Reg, true); - unsigned CFIIndex = MF.addFrameInst( - MCCFIInstruction::createOffset(nullptr, DwarfReg, Offset)); + + // Not all unwinders may know about SVE registers, so assume the lowest + // common demoninator. + unsigned NewReg; + if (static_cast(TRI)->regNeedsCFI(Reg, NewReg)) + Reg = NewReg; + else + continue; + + StackOffset Offset; + if (MFI.getStackID(Info.getFrameIdx()) == TargetStackID::SVEVector) { + AArch64FunctionInfo *AFI = MF.getInfo(); + Offset = StackOffset(MFI.getObjectOffset(Info.getFrameIdx()), MVT::nxv1i8) - + StackOffset(AFI->getCalleeSavedStackSize(MFI), MVT::i8); + } else { + Offset = {MFI.getObjectOffset(Info.getFrameIdx()) - + getOffsetOfLocalArea(), + MVT::i8}; + } + unsigned CFIIndex = MF.addFrameInst(createCfaOffset(*TRI, Reg, Offset)); BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::CFI_INSTRUCTION)) .addCFIIndex(CFIIndex) .setMIFlags(MachineInstr::FrameSetup); @@ -1383,9 +1489,18 @@ void AArch64FrameLowering::emitPrologue(MachineFunctio .addCFIIndex(CFIIndex) .setMIFlags(MachineInstr::FrameSetup); } else { - // Encode the stack size of the leaf function. - unsigned CFIIndex = MF.addFrameInst( - MCCFIInstruction::cfiDefCfaOffset(nullptr, MFI.getStackSize())); + unsigned CFIIndex; + if (SVEStackSize) { + const TargetSubtargetInfo &STI = MF.getSubtarget(); + const TargetRegisterInfo &TRI = *STI.getRegisterInfo(); + StackOffset TotalSize = + SVEStackSize + StackOffset((int64_t)MFI.getStackSize(), MVT::i8); + CFIIndex = MF.addFrameInst(createDefCFAExpressionFromSP(TRI, TotalSize)); + } else { + // Encode the stack size of the leaf function. + CFIIndex = MF.addFrameInst( + MCCFIInstruction::cfiDefCfaOffset(nullptr, MFI.getStackSize())); + } BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::CFI_INSTRUCTION)) .addCFIIndex(CFIIndex) .setMIFlags(MachineInstr::FrameSetup); @@ -2006,6 +2121,7 @@ static void computeCalleeSaveRegisterPairs( // available unwind codes. This flag assures that the alignment fixup is done // only once, as intened. bool FixupDone = false; + for (unsigned i = 0; i < Count; ++i) { RegPairInfo RPI; RPI.Reg1 = CSI[i].getReg(); Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.h ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.h Mon Aug 24 17:43:23 2020 (r364718) @@ -18,6 +18,8 @@ namespace llvm { +class MCCFIInstruction; + class AArch64FrameLowering : public TargetFrameLowering { public: explicit AArch64FrameLowering() @@ -119,6 +121,11 @@ class AArch64FrameLowering : public TargetFrameLowerin int64_t assignSVEStackObjectOffsets(MachineFrameInfo &MF, int &MinCSFrameIndex, int &MaxCSFrameIndex) const; + MCCFIInstruction + createDefCFAExpressionFromSP(const TargetRegisterInfo &TRI, + const StackOffset &OffsetFromSP) const; + MCCFIInstruction createCfaOffset(const TargetRegisterInfo &MRI, unsigned DwarfReg, + const StackOffset &OffsetFromDefCFA) const; bool shouldCombineCSRLocalStackBumpInEpilogue(MachineBasicBlock &MBB, unsigned StackBumpBytes) const; }; Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -4107,6 +4107,7 @@ static bool canGuaranteeTCO(CallingConv::ID CC) { static bool mayTailCallThisCC(CallingConv::ID CC) { switch (CC) { case CallingConv::C: + case CallingConv::AArch64_SVE_VectorCall: case CallingConv::PreserveMost: case CallingConv::Swift: return true; @@ -4126,6 +4127,15 @@ bool AArch64TargetLowering::isEligibleForTailCallOptim MachineFunction &MF = DAG.getMachineFunction(); const Function &CallerF = MF.getFunction(); CallingConv::ID CallerCC = CallerF.getCallingConv(); + + // If this function uses the C calling convention but has an SVE signature, + // then it preserves more registers and should assume the SVE_VectorCall CC. + // The check for matching callee-saved regs will determine whether it is + // eligible for TCO. + if (CallerCC == CallingConv::C && + AArch64RegisterInfo::hasSVEArgsOrReturn(&MF)) + CallerCC = CallingConv::AArch64_SVE_VectorCall; + bool CCMatch = CallerCC == CalleeCC; // When using the Windows calling convention on a non-windows OS, we want @@ -4313,6 +4323,20 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI bool TailCallOpt = MF.getTarget().Options.GuaranteedTailCallOpt; bool IsSibCall = false; + // Check callee args/returns for SVE registers and set calling convention + // accordingly. + if (CallConv == CallingConv::C) { + bool CalleeOutSVE = any_of(Outs, [](ISD::OutputArg &Out){ + return Out.VT.isScalableVector(); + }); + bool CalleeInSVE = any_of(Ins, [](ISD::InputArg &In){ + return In.VT.isScalableVector(); + }); + + if (CalleeInSVE || CalleeOutSVE) + CallConv = CallingConv::AArch64_SVE_VectorCall; + } + if (IsTailCall) { // Check if it's really possible to do a tail call. IsTailCall = isEligibleForTailCallOptimization( @@ -4665,20 +4689,6 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI for (auto &RegToPass : RegsToPass) Ops.push_back(DAG.getRegister(RegToPass.first, RegToPass.second.getValueType())); - - // Check callee args/returns for SVE registers and set calling convention - // accordingly. - if (CallConv == CallingConv::C) { - bool CalleeOutSVE = any_of(Outs, [](ISD::OutputArg &Out){ - return Out.VT.isScalableVector(); - }); - bool CalleeInSVE = any_of(Ins, [](ISD::InputArg &In){ - return In.VT.isScalableVector(); - }); - - if (CalleeInSVE || CalleeOutSVE) - CallConv = CallingConv::AArch64_SVE_VectorCall; - } // Add a register mask operand representing the call-preserved registers. const uint32_t *Mask; Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -40,7 +40,30 @@ AArch64RegisterInfo::AArch64RegisterInfo(const Triple AArch64_MC::initLLVMToCVRegMapping(this); } -static bool hasSVEArgsOrReturn(const MachineFunction *MF) { +/// Return whether the register needs a CFI entry. Not all unwinders may know +/// about SVE registers, so we assume the lowest common denominator, i.e. the +/// callee-saves required by the base ABI. For the SVE registers z8-z15 only the +/// lower 64-bits (d8-d15) need to be saved. The lower 64-bits subreg is +/// returned in \p RegToUseForCFI. +bool AArch64RegisterInfo::regNeedsCFI(unsigned Reg, + unsigned &RegToUseForCFI) const { + if (AArch64::PPRRegClass.contains(Reg)) + return false; + + if (AArch64::ZPRRegClass.contains(Reg)) { + RegToUseForCFI = getSubReg(Reg, AArch64::dsub); + for (int I = 0; CSR_AArch64_AAPCS_SaveList[I]; ++I) { + if (CSR_AArch64_AAPCS_SaveList[I] == RegToUseForCFI) + return true; + } + return false; + } + + RegToUseForCFI = Reg; + return true; +} + +bool AArch64RegisterInfo::hasSVEArgsOrReturn(const MachineFunction *MF) { const Function &F = MF->getFunction(); return isa(F.getReturnType()) || any_of(F.args(), [](const Argument &Arg) { Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.h ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.h Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.h Mon Aug 24 17:43:23 2020 (r364718) @@ -42,6 +42,8 @@ class AArch64RegisterInfo final : public AArch64GenReg void UpdateCustomCallPreservedMask(MachineFunction &MF, const uint32_t **Mask) const; + static bool hasSVEArgsOrReturn(const MachineFunction *MF); + /// Code Generation virtual methods... const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override; const MCPhysReg *getDarwinCalleeSavedRegs(const MachineFunction *MF) const; @@ -122,6 +124,7 @@ class AArch64RegisterInfo final : public AArch64GenReg MachineFunction &MF) const override; unsigned getLocalAddressRegister(const MachineFunction &MF) const; + bool regNeedsCFI(unsigned Reg, unsigned &RegToUseForCFI) const; }; } // end namespace llvm Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.td Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64RegisterInfo.td Mon Aug 24 17:43:23 2020 (r364718) @@ -133,6 +133,9 @@ def NZCV : AArch64Reg<0, "nzcv">; // First fault status register def FFR : AArch64Reg<0, "ffr">, DwarfRegNum<[47]>; +// Purely virtual Vector Granule (VG) Dwarf register +def VG : AArch64Reg<0, "vg">, DwarfRegNum<[46]>; + // GPR register classes with the intersections of GPR32/GPR32sp and // GPR64/GPR64sp for use by the coalescer. def GPR32common : RegisterClass<"AArch64", [i32], 32, (sequence "W%u", 0, 30)> { Modified: head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td Mon Aug 24 17:43:23 2020 (r364718) @@ -1765,7 +1765,7 @@ multiclass sve_prefetch; defm : unpred_store< store, nxv2f16, ST1H_D_IMM, PTRUE_D>; defm : unpred_store< store, nxv4f32, ST1W_IMM, PTRUE_S>; - defm : unpred_store< store, nxv4f32, ST1W_D_IMM, PTRUE_D>; + defm : unpred_store< store, nxv2f32, ST1W_D_IMM, PTRUE_D>; defm : unpred_store< store, nxv2f64, ST1D_IMM, PTRUE_D>; multiclass unpred_loaderaseFromParent(); if (Op1->use_empty()) Op1->eraseFromParent(); - if (Op2->use_empty()) + if (Op1 != Op2 && Op2->use_empty()) Op2->eraseFromParent(); return true; Modified: head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -279,7 +279,7 @@ bool RISCVInstrInfo::analyzeBranch(MachineBasicBlock & // Handle a single unconditional branch. if (NumTerminators == 1 && I->getDesc().isUnconditionalBranch()) { - TBB = I->getOperand(0).getMBB(); + TBB = getBranchDestBlock(*I); return false; } @@ -293,7 +293,7 @@ bool RISCVInstrInfo::analyzeBranch(MachineBasicBlock & if (NumTerminators == 2 && std::prev(I)->getDesc().isConditionalBranch() && I->getDesc().isUnconditionalBranch()) { parseCondBranch(*std::prev(I), TBB, Cond); - FBB = I->getOperand(0).getMBB(); + FBB = getBranchDestBlock(*I); return false; } @@ -384,11 +384,7 @@ unsigned RISCVInstrInfo::insertIndirectBranch(MachineB MachineFunction *MF = MBB.getParent(); MachineRegisterInfo &MRI = MF->getRegInfo(); - const auto &TM = static_cast(MF->getTarget()); - if (TM.isPositionIndependent()) - report_fatal_error("Unable to insert indirect branch"); - if (!isInt<32>(BrOffset)) report_fatal_error( "Branch offsets outside of the signed 32-bit range not supported"); @@ -399,15 +395,13 @@ unsigned RISCVInstrInfo::insertIndirectBranch(MachineB Register ScratchReg = MRI.createVirtualRegister(&RISCV::GPRRegClass); auto II = MBB.end(); - MachineInstr &LuiMI = *BuildMI(MBB, II, DL, get(RISCV::LUI), ScratchReg) - .addMBB(&DestBB, RISCVII::MO_HI); - BuildMI(MBB, II, DL, get(RISCV::PseudoBRIND)) - .addReg(ScratchReg, RegState::Kill) - .addMBB(&DestBB, RISCVII::MO_LO); + MachineInstr &MI = *BuildMI(MBB, II, DL, get(RISCV::PseudoJump)) + .addReg(ScratchReg, RegState::Define | RegState::Dead) + .addMBB(&DestBB, RISCVII::MO_CALL); RS->enterBasicBlockEnd(MBB); unsigned Scav = RS->scavengeRegisterBackwards(RISCV::GPRRegClass, - LuiMI.getIterator(), false, 0); + MI.getIterator(), false, 0); MRI.replaceRegWith(ScratchReg, Scav); MRI.clearVirtRegs(); RS->setRegUsed(Scav); @@ -431,6 +425,7 @@ RISCVInstrInfo::getBranchDestBlock(const MachineInstr bool RISCVInstrInfo::isBranchOffsetInRange(unsigned BranchOp, int64_t BrOffset) const { + unsigned XLen = STI.getXLen(); // Ideally we could determine the supported branch offset from the // RISCVII::FormMask, but this can't be used for Pseudo instructions like // PseudoBR. @@ -447,6 +442,8 @@ bool RISCVInstrInfo::isBranchOffsetInRange(unsigned Br case RISCV::JAL: case RISCV::PseudoBR: return isIntN(21, BrOffset); + case RISCV::PseudoJump: + return isIntN(32, SignExtend64(BrOffset + 0x800, XLen)); } } Modified: head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.td Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.td Mon Aug 24 17:43:23 2020 (r364718) @@ -1012,8 +1012,8 @@ def : Pat<(riscv_tail (iPTR tglobaladdr:$dst)), def : Pat<(riscv_tail (iPTR texternalsym:$dst)), (PseudoTAIL texternalsym:$dst)>; -let isCall = 0, isBarrier = 0, isCodeGenOnly = 0, hasSideEffects = 0, - mayStore = 0, mayLoad = 0 in +let isCall = 0, isBarrier = 1, isBranch = 1, isTerminator = 1, + isCodeGenOnly = 0, hasSideEffects = 0, mayStore = 0, mayLoad = 0 in def PseudoJump : Pseudo<(outs GPR:$rd), (ins pseudo_jump_symbol:$target), []> { let AsmString = "jump\t$target, $rd"; } Modified: head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -3208,13 +3208,23 @@ X86TargetLowering::LowerMemArgument(SDValue Chain, Cal return DAG.getFrameIndex(FI, PtrVT); } + EVT ArgVT = Ins[i].ArgVT; + + // If this is a vector that has been split into multiple parts, and the + // scalar size of the parts don't match the vector element size, then we can't + // elide the copy. The parts will have padding between them instead of being + // packed like a vector. + bool ScalarizedAndExtendedVector = + ArgVT.isVector() && !VA.getLocVT().isVector() && + VA.getLocVT().getSizeInBits() != ArgVT.getScalarSizeInBits(); + // This is an argument in memory. We might be able to perform copy elision. // If the argument is passed directly in memory without any extension, then we // can perform copy elision. Large vector types, for example, may be passed // indirectly by pointer. if (Flags.isCopyElisionCandidate() && - VA.getLocInfo() != CCValAssign::Indirect && !ExtendedInMem) { - EVT ArgVT = Ins[i].ArgVT; + VA.getLocInfo() != CCValAssign::Indirect && !ExtendedInMem && + !ScalarizedAndExtendedVector) { SDValue PartAddr; if (Ins[i].PartOffset == 0) { // If this is a one-part value or the first part of a multi-part value, Modified: head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Aug 24 17:31:17 2020 (r364717) +++ head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Aug 24 17:43:23 2020 (r364718) @@ -468,19 +468,16 @@ static bool CanDoGlobalSRA(GlobalVariable *GV) { /// Copy over the debug info for a variable to its SRA replacements. static void transferSRADebugInfo(GlobalVariable *GV, GlobalVariable *NGV, uint64_t FragmentOffsetInBits, - uint64_t FragmentSizeInBits) { + uint64_t FragmentSizeInBits, + uint64_t VarSize) { SmallVector GVs; GV->getDebugInfo(GVs); for (auto *GVE : GVs) { DIVariable *Var = GVE->getVariable(); - Optional VarSize = Var->getSizeInBits(); - DIExpression *Expr = GVE->getExpression(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 17:57:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A96E53C9819; Mon, 24 Aug 2020 17:57:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb0FK3rblz41lr; Mon, 24 Aug 2020 17:57:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6368E1C37F; Mon, 24 Aug 2020 17:57:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OHv9P0031145; Mon, 24 Aug 2020 17:57:09 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OHv95N031144; Mon, 24 Aug 2020 17:57:09 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202008241757.07OHv95N031144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Mon, 24 Aug 2020 17:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364719 - head/usr.bin/w X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/w X-SVN-Commit-Revision: 364719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 17:57:09 -0000 Author: fernape (ports committer) Date: Mon Aug 24 17:57:08 2020 New Revision: 364719 URL: https://svnweb.freebsd.org/changeset/base/364719 Log: w(1): Add EXAMPLES to man page Add small example section showing general use and -d and -h flags Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26172 Modified: head/usr.bin/w/w.1 Modified: head/usr.bin/w/w.1 ============================================================================== --- head/usr.bin/w/w.1 Mon Aug 24 17:43:23 2020 (r364718) +++ head/usr.bin/w/w.1 Mon Aug 24 17:57:08 2020 (r364719) @@ -28,7 +28,7 @@ .\" @(#)w.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd August 24, 2020 .Dt W 1 .Os .Sh NAME @@ -99,6 +99,41 @@ names are specified, the output is restricted to those .It Pa /var/run/utx.active list of users on the system .El +.Sh EXAMPLES +Show global activity of the system: +.Bd -literal -offset indent +$ w + 8:05PM up 35 mins, 3 users, load averages: 0.09, 0.35, 0.27 +USER TTY FROM LOGIN@ IDLE WHAT +fernape v0 - 7:30PM - tmux: client (/tmp/tmux-1001/default) (tmux) +root v1 - 8:03PM 1 -bash (bash) +fernape pts/0 tmux(1391).%0 8:04PM - w +.Ed +.Pp +Show the entire process list per tty: +.Bd -literal -offset indent +$ w -d + 8:12PM up 42 mins, 3 users, load averages: 0.01, 0.11, 0.17 +USER TTY FROM LOGIN@ IDLE WHAT + 1199 login [pam] (login) + 1207 -bash (bash) + 1507 tmux: client (/tmp/tmux-1001/default) (tmux) +fernape v0 - 7:30PM - tmux: client (/tmp/tmux-1001/default) (tmux) + 1488 login [pam] (login) + 1489 -bash (bash) +root v1 - 8:08PM 3 -bash (bash) + 1510 -bash (bash) + 1515 w -d +fernape pts/0 tmux(1509).%0 8:11PM - w -d +.Ed +.Pp +Same as above but only for the root user and omitting the heading: +.Bd -literal -offset indent +$ w -d -h root + 1183 login [pam] (login) + 1204 -bash (bash) +root v1 - 7:15PM - -bash (bash) +.Ed .Sh COMPATIBILITY The .Fl f , @@ -137,9 +172,7 @@ to ignore interrupts. prints .Ql \- . ) .Pp -The -.Tn CPU -time is only an estimate, in particular, if someone leaves a background +The CPU time is only an estimate, in particular, if someone leaves a background process running after logging out, the person currently on that terminal is .Dq charged with the time. From owner-svn-src-head@freebsd.org Mon Aug 24 18:13:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0ADB3CA0BC; Mon, 24 Aug 2020 18:13:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb0cV4ftgz43FH; Mon, 24 Aug 2020 18:13:46 +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 83CA31C958; Mon, 24 Aug 2020 18:13:46 +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 07OIDkmV043288; Mon, 24 Aug 2020 18:13:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OIDjbx043281; Mon, 24 Aug 2020 18:13:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008241813.07OIDjbx043281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Aug 2020 18:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364720 - in head/contrib/sqlite3: . tea X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea X-SVN-Commit-Revision: 364720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 18:13:46 -0000 Author: cy Date: Mon Aug 24 18:13:44 2020 New Revision: 364720 URL: https://svnweb.freebsd.org/changeset/base/364720 Log: MFV 364467: Update sqlite to 3.33.0 (3330000). Release announcement at https://www.sqlite.org/releaselog/3_33_0.html. MFC after: 1 month Added: head/contrib/sqlite3/sqlite3rc.h - copied unchanged from r364467, vendor/sqlite3/dist/sqlite3rc.h Modified: head/contrib/sqlite3/Makefile.am head/contrib/sqlite3/Makefile.in head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.am ============================================================================== --- head/contrib/sqlite3/Makefile.am Mon Aug 24 17:57:08 2020 (r364719) +++ head/contrib/sqlite3/Makefile.am Mon Aug 24 18:13:44 2020 (r364720) @@ -13,7 +13,7 @@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_ include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Modified: head/contrib/sqlite3/Makefile.in ============================================================================== --- head/contrib/sqlite3/Makefile.in Mon Aug 24 17:57:08 2020 (r364719) +++ head/contrib/sqlite3/Makefile.in Mon Aug 24 18:13:44 2020 (r364720) @@ -370,7 +370,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc sqlite3rc.h README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Mon Aug 24 17:57:08 2020 (r364719) +++ head/contrib/sqlite3/configure Mon Aug 24 18:13:44 2020 (r364720) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.32.3. +# Generated by GNU Autoconf 2.69 for sqlite 3.33.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.32.3' -PACKAGE_STRING='sqlite 3.32.3' +PACKAGE_VERSION='3.33.0' +PACKAGE_STRING='sqlite 3.33.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.32.3 to adapt to many kinds of systems. +\`configure' configures sqlite 3.33.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.32.3:";; + short | recursive ) echo "Configuration of sqlite 3.33.0:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.32.3 +sqlite configure 3.33.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.32.3, which was +It was created by sqlite $as_me 3.33.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.32.3' + VERSION='3.33.0' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.32.3, which was +This file was extended by sqlite $as_me 3.33.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.32.3 +sqlite config.status 3.33.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Mon Aug 24 17:57:08 2020 (r364719) +++ head/contrib/sqlite3/configure.ac Mon Aug 24 18:13:44 2020 (r364720) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.32.3, http://www.sqlite.org) +AC_INIT(sqlite, 3.33.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Mon Aug 24 17:57:08 2020 (r364719) +++ head/contrib/sqlite3/shell.c Mon Aug 24 18:13:44 2020 (r364720) @@ -642,6 +642,21 @@ static int strlenChar(const char *z){ } /* +** Return true if zFile does not exist or if it is not an ordinary file. +*/ +#ifdef _WIN32 +# define notNormalFile(X) 0 +#else +static int notNormalFile(const char *zFile){ + struct stat x; + int rc; + memset(&x, 0, sizeof(x)); + rc = stat(zFile, &x); + return rc || !S_ISREG(x.st_mode); +} +#endif + +/* ** This routine reads a line of text from FILE in, stores ** the text in memory obtained from malloc() and returns a pointer ** to the text. NULL is returned at end of file, or if malloc() @@ -953,7 +968,7 @@ static void shellModuleSchema( ** CREATE VIRTUAL TABLE ** ** This UDF is used by the .schema command to insert the schema name of -** attached databases into the middle of the sqlite_master.sql field. +** attached databases into the middle of the sqlite_schema.sql field. */ static void shellAddSchemaName( sqlite3_context *pCtx, @@ -3330,7 +3345,7 @@ static int completionNext(sqlite3_vtab_cursor *cur){ const char *zDb = (const char*)sqlite3_column_text(pS2, 1); zSql = sqlite3_mprintf( "%z%s" - "SELECT name FROM \"%w\".sqlite_master", + "SELECT name FROM \"%w\".sqlite_schema", zSql, zSep, zDb ); if( zSql==0 ) return SQLITE_NOMEM; @@ -3354,7 +3369,7 @@ static int completionNext(sqlite3_vtab_cursor *cur){ const char *zDb = (const char*)sqlite3_column_text(pS2, 1); zSql = sqlite3_mprintf( "%z%s" - "SELECT pti.name FROM \"%w\".sqlite_master AS sm" + "SELECT pti.name FROM \"%w\".sqlite_schema AS sm" " JOIN pragma_table_info(sm.name,%Q) AS pti" " WHERE sm.type='table'", zSql, zSep, zDb, zDb @@ -4047,7 +4062,7 @@ static int apndOpen( p = (ApndFile*)pFile; memset(p, 0, sizeof(*p)); pSubFile = ORIGFILE(pFile); - p->base.pMethods = &apnd_io_methods; + pFile->pMethods = &apnd_io_methods; rc = pSubVfs->xOpen(pSubVfs, zName, pSubFile, flags, pOutFlags); if( rc ) goto apnd_open_done; rc = pSubFile->pMethods->xFileSize(pSubFile, &sz); @@ -4379,6 +4394,927 @@ int sqlite3_uint_init( } /************************* End ../ext/misc/uint.c ********************/ +/************************* Begin ../ext/misc/decimal.c ******************/ +/* +** 2020-06-22 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** Routines to implement arbitrary-precision decimal math. +** +** The focus here is on simplicity and correctness, not performance. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include +#include +#include + +/* Mark a function parameter as unused, to suppress nuisance compiler +** warnings. */ +#ifndef UNUSED_PARAMETER +# define UNUSED_PARAMETER(X) (void)(X) +#endif + + +/* A decimal object */ +typedef struct Decimal Decimal; +struct Decimal { + char sign; /* 0 for positive, 1 for negative */ + char oom; /* True if an OOM is encountered */ + char isNull; /* True if holds a NULL rather than a number */ + char isInit; /* True upon initialization */ + int nDigit; /* Total number of digits */ + int nFrac; /* Number of digits to the right of the decimal point */ + signed char *a; /* Array of digits. Most significant first. */ +}; + +/* +** Release memory held by a Decimal, but do not free the object itself. +*/ +static void decimal_clear(Decimal *p){ + sqlite3_free(p->a); +} + +/* +** Destroy a Decimal object +*/ +static void decimal_free(Decimal *p){ + if( p ){ + decimal_clear(p); + sqlite3_free(p); + } +} + +/* +** Allocate a new Decimal object. Initialize it to the number given +** by the input string. +*/ +static Decimal *decimal_new( + sqlite3_context *pCtx, + sqlite3_value *pIn, + int nAlt, + const unsigned char *zAlt +){ + Decimal *p; + int n, i; + const unsigned char *zIn; + int iExp = 0; + p = sqlite3_malloc( sizeof(*p) ); + if( p==0 ) goto new_no_mem; + p->sign = 0; + p->oom = 0; + p->isInit = 1; + p->isNull = 0; + p->nDigit = 0; + p->nFrac = 0; + if( zAlt ){ + n = nAlt, + zIn = zAlt; + }else{ + if( sqlite3_value_type(pIn)==SQLITE_NULL ){ + p->a = 0; + p->isNull = 1; + return p; + } + n = sqlite3_value_bytes(pIn); + zIn = sqlite3_value_text(pIn); + } + p->a = sqlite3_malloc64( n+1 ); + if( p->a==0 ) goto new_no_mem; + for(i=0; isspace(zIn[i]); i++){} + if( zIn[i]=='-' ){ + p->sign = 1; + i++; + }else if( zIn[i]=='+' ){ + i++; + } + while( i='0' && c<='9' ){ + p->a[p->nDigit++] = c - '0'; + }else if( c=='.' ){ + p->nFrac = p->nDigit + 1; + }else if( c=='e' || c=='E' ){ + int j = i+1; + int neg = 0; + if( j>=n ) break; + if( zIn[j]=='-' ){ + neg = 1; + j++; + }else if( zIn[j]=='+' ){ + j++; + } + while( j='0' && zIn[j]<='9' ){ + iExp = iExp*10 + zIn[j] - '0'; + } + j++; + } + if( neg ) iExp = -iExp; + break; + } + i++; + } + if( p->nFrac ){ + p->nFrac = p->nDigit - (p->nFrac - 1); + } + if( iExp>0 ){ + if( p->nFrac>0 ){ + if( iExp<=p->nFrac ){ + p->nFrac -= iExp; + iExp = 0; + }else{ + iExp -= p->nFrac; + p->nFrac = 0; + } + } + if( iExp>0 ){ + p->a = sqlite3_realloc64(p->a, p->nDigit + iExp + 1 ); + if( p->a==0 ) goto new_no_mem; + memset(p->a+p->nDigit, 0, iExp); + p->nDigit += iExp; + } + }else if( iExp<0 ){ + int nExtra; + iExp = -iExp; + nExtra = p->nDigit - p->nFrac - 1; + if( nExtra ){ + if( nExtra>=iExp ){ + p->nFrac += iExp; + iExp = 0; + }else{ + iExp -= nExtra; + p->nFrac = p->nDigit - 1; + } + } + if( iExp>0 ){ + p->a = sqlite3_realloc64(p->a, p->nDigit + iExp + 1 ); + if( p->a==0 ) goto new_no_mem; + memmove(p->a+iExp, p->a, p->nDigit); + memset(p->a, 0, iExp); + p->nDigit += iExp; + p->nFrac += iExp; + } + } + return p; + +new_no_mem: + if( pCtx ) sqlite3_result_error_nomem(pCtx); + sqlite3_free(p); + return 0; +} + +/* +** Make the given Decimal the result. +*/ +static void decimal_result(sqlite3_context *pCtx, Decimal *p){ + char *z; + int i, j; + int n; + if( p==0 || p->oom ){ + sqlite3_result_error_nomem(pCtx); + return; + } + if( p->isNull ){ + sqlite3_result_null(pCtx); + return; + } + z = sqlite3_malloc( p->nDigit+4 ); + if( z==0 ){ + sqlite3_result_error_nomem(pCtx); + return; + } + i = 0; + if( p->nDigit==0 || (p->nDigit==1 && p->a[0]==0) ){ + p->sign = 0; + } + if( p->sign ){ + z[0] = '-'; + i = 1; + } + n = p->nDigit - p->nFrac; + if( n<=0 ){ + z[i++] = '0'; + } + j = 0; + while( n>1 && p->a[j]==0 ){ + j++; + n--; + } + while( n>0 ){ + z[i++] = p->a[j] + '0'; + j++; + n--; + } + if( p->nFrac ){ + z[i++] = '.'; + do{ + z[i++] = p->a[j] + '0'; + j++; + }while( jnDigit ); + } + z[i] = 0; + sqlite3_result_text(pCtx, z, i, sqlite3_free); +} + +/* +** SQL Function: decimal(X) +** +** Convert input X into decimal and then back into text +*/ +static void decimalFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *p = decimal_new(context, argv[0], 0, 0); + UNUSED_PARAMETER(argc); + decimal_result(context, p); + decimal_free(p); +} + +/* +** Compare to Decimal objects. Return negative, 0, or positive if the +** first object is less than, equal to, or greater than the second. +** +** Preconditions for this routine: +** +** pA!=0 +** pA->isNull==0 +** pB!=0 +** pB->isNull==0 +*/ +static int decimal_cmp(const Decimal *pA, const Decimal *pB){ + int nASig, nBSig, rc, n; + if( pA->sign!=pB->sign ){ + return pA->sign ? -1 : +1; + } + if( pA->sign ){ + const Decimal *pTemp = pA; + pA = pB; + pB = pTemp; + } + nASig = pA->nDigit - pA->nFrac; + nBSig = pB->nDigit - pB->nFrac; + if( nASig!=nBSig ){ + return nASig - nBSig; + } + n = pA->nDigit; + if( n>pB->nDigit ) n = pB->nDigit; + rc = memcmp(pA->a, pB->a, n); + if( rc==0 ){ + rc = pA->nDigit - pB->nDigit; + } + return rc; +} + +/* +** SQL Function: decimal_cmp(X, Y) +** +** Return negative, zero, or positive if X is less then, equal to, or +** greater than Y. +*/ +static void decimalCmpFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *pA = 0, *pB = 0; + int rc; + + UNUSED_PARAMETER(argc); + pA = decimal_new(context, argv[0], 0, 0); + if( pA==0 || pA->isNull ) goto cmp_done; + pB = decimal_new(context, argv[1], 0, 0); + if( pB==0 || pB->isNull ) goto cmp_done; + rc = decimal_cmp(pA, pB); + if( rc<0 ) rc = -1; + else if( rc>0 ) rc = +1; + sqlite3_result_int(context, rc); +cmp_done: + decimal_free(pA); + decimal_free(pB); +} + +/* +** Expand the Decimal so that it has a least nDigit digits and nFrac +** digits to the right of the decimal point. +*/ +static void decimal_expand(Decimal *p, int nDigit, int nFrac){ + int nAddSig; + int nAddFrac; + if( p==0 ) return; + nAddFrac = nFrac - p->nFrac; + nAddSig = (nDigit - p->nDigit) - nAddFrac; + if( nAddFrac==0 && nAddSig==0 ) return; + p->a = sqlite3_realloc64(p->a, nDigit+1); + if( p->a==0 ){ + p->oom = 1; + return; + } + if( nAddSig ){ + memmove(p->a+nAddSig, p->a, p->nDigit); + memset(p->a, 0, nAddSig); + p->nDigit += nAddSig; + } + if( nAddFrac ){ + memset(p->a+p->nDigit, 0, nAddFrac); + p->nDigit += nAddFrac; + p->nFrac += nAddFrac; + } +} + +/* +** Add the value pB into pA. +** +** Both pA and pB might become denormalized by this routine. +*/ +static void decimal_add(Decimal *pA, Decimal *pB){ + int nSig, nFrac, nDigit; + int i, rc; + if( pA==0 ){ + return; + } + if( pA->oom || pB==0 || pB->oom ){ + pA->oom = 1; + return; + } + if( pA->isNull || pB->isNull ){ + pA->isNull = 1; + return; + } + nSig = pA->nDigit - pA->nFrac; + if( nSig && pA->a[0]==0 ) nSig--; + if( nSignDigit-pB->nFrac ){ + nSig = pB->nDigit - pB->nFrac; + } + nFrac = pA->nFrac; + if( nFracnFrac ) nFrac = pB->nFrac; + nDigit = nSig + nFrac + 1; + decimal_expand(pA, nDigit, nFrac); + decimal_expand(pB, nDigit, nFrac); + if( pA->oom || pB->oom ){ + pA->oom = 1; + }else{ + if( pA->sign==pB->sign ){ + int carry = 0; + for(i=nDigit-1; i>=0; i--){ + int x = pA->a[i] + pB->a[i] + carry; + if( x>=10 ){ + carry = 1; + pA->a[i] = x - 10; + }else{ + carry = 0; + pA->a[i] = x; + } + } + }else{ + signed char *aA, *aB; + int borrow = 0; + rc = memcmp(pA->a, pB->a, nDigit); + if( rc<0 ){ + aA = pB->a; + aB = pA->a; + pA->sign = !pA->sign; + }else{ + aA = pA->a; + aB = pB->a; + } + for(i=nDigit-1; i>=0; i--){ + int x = aA[i] - aB[i] - borrow; + if( x<0 ){ + pA->a[i] = x+10; + borrow = 1; + }else{ + pA->a[i] = x; + borrow = 0; + } + } + } + } +} + +/* +** Compare text in decimal order. +*/ +static int decimalCollFunc( + void *notUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + const unsigned char *zA = (const unsigned char*)pKey1; + const unsigned char *zB = (const unsigned char*)pKey2; + Decimal *pA = decimal_new(0, 0, nKey1, zA); + Decimal *pB = decimal_new(0, 0, nKey2, zB); + int rc; + UNUSED_PARAMETER(notUsed); + if( pA==0 || pB==0 ){ + rc = 0; + }else{ + rc = decimal_cmp(pA, pB); + } + decimal_free(pA); + decimal_free(pB); + return rc; +} + + +/* +** SQL Function: decimal_add(X, Y) +** decimal_sub(X, Y) +** +** Return the sum or difference of X and Y. +*/ +static void decimalAddFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *pA = decimal_new(context, argv[0], 0, 0); + Decimal *pB = decimal_new(context, argv[1], 0, 0); + UNUSED_PARAMETER(argc); + decimal_add(pA, pB); + decimal_result(context, pA); + decimal_free(pA); + decimal_free(pB); +} +static void decimalSubFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *pA = decimal_new(context, argv[0], 0, 0); + Decimal *pB = decimal_new(context, argv[1], 0, 0); + UNUSED_PARAMETER(argc); + if( pB==0 ) return; + pB->sign = !pB->sign; + decimal_add(pA, pB); + decimal_result(context, pA); + decimal_free(pA); + decimal_free(pB); +} + +/* Aggregate funcion: decimal_sum(X) +** +** Works like sum() except that it uses decimal arithmetic for unlimited +** precision. +*/ +static void decimalSumStep( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *p; + Decimal *pArg; + UNUSED_PARAMETER(argc); + p = sqlite3_aggregate_context(context, sizeof(*p)); + if( p==0 ) return; + if( !p->isInit ){ + p->isInit = 1; + p->a = sqlite3_malloc(2); + if( p->a==0 ){ + p->oom = 1; + }else{ + p->a[0] = 0; + } + p->nDigit = 1; + p->nFrac = 0; + } + if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; + pArg = decimal_new(context, argv[0], 0, 0); + decimal_add(p, pArg); + decimal_free(pArg); +} +static void decimalSumInverse( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *p; + Decimal *pArg; + UNUSED_PARAMETER(argc); + p = sqlite3_aggregate_context(context, sizeof(*p)); + if( p==0 ) return; + if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; + pArg = decimal_new(context, argv[0], 0, 0); + if( pArg ) pArg->sign = !pArg->sign; + decimal_add(p, pArg); + decimal_free(pArg); +} +static void decimalSumValue(sqlite3_context *context){ + Decimal *p = sqlite3_aggregate_context(context, 0); + if( p==0 ) return; + decimal_result(context, p); +} +static void decimalSumFinalize(sqlite3_context *context){ + Decimal *p = sqlite3_aggregate_context(context, 0); + if( p==0 ) return; + decimal_result(context, p); + decimal_clear(p); +} + +/* +** SQL Function: decimal_mul(X, Y) +** +** Return the product of X and Y. +** +** All significant digits after the decimal point are retained. +** Trailing zeros after the decimal point are omitted as long as +** the number of digits after the decimal point is no less than +** either the number of digits in either input. +*/ +static void decimalMulFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + Decimal *pA = decimal_new(context, argv[0], 0, 0); + Decimal *pB = decimal_new(context, argv[1], 0, 0); + signed char *acc = 0; + int i, j, k; + int minFrac; + UNUSED_PARAMETER(argc); + if( pA==0 || pA->oom || pA->isNull + || pB==0 || pB->oom || pB->isNull + ){ + goto mul_end; + } + acc = sqlite3_malloc64( pA->nDigit + pB->nDigit + 2 ); + if( acc==0 ){ + sqlite3_result_error_nomem(context); + goto mul_end; + } + memset(acc, 0, pA->nDigit + pB->nDigit + 2); + minFrac = pA->nFrac; + if( pB->nFracnFrac; + for(i=pA->nDigit-1; i>=0; i--){ + signed char f = pA->a[i]; + int carry = 0, x; + for(j=pB->nDigit-1, k=i+j+3; j>=0; j--, k--){ + x = acc[k] + f*pB->a[j] + carry; + acc[k] = x%10; + carry = x/10; + } + x = acc[k] + carry; + acc[k] = x%10; + acc[k-1] += x/10; + } + sqlite3_free(pA->a); + pA->a = acc; + acc = 0; + pA->nDigit += pB->nDigit + 2; + pA->nFrac += pB->nFrac; + pA->sign ^= pB->sign; + while( pA->nFrac>minFrac && pA->a[pA->nDigit-1]==0 ){ + pA->nFrac--; + pA->nDigit--; + } + decimal_result(context, pA); + +mul_end: + sqlite3_free(acc); + decimal_free(pA); + decimal_free(pB); +} + +#ifdef _WIN32 + +#endif +int sqlite3_decimal_init( + sqlite3 *db, + char **pzErrMsg, + const sqlite3_api_routines *pApi +){ + int rc = SQLITE_OK; + static const struct { + const char *zFuncName; + int nArg; + void (*xFunc)(sqlite3_context*,int,sqlite3_value**); + } aFunc[] = { + { "decimal", 1, decimalFunc }, + { "decimal_cmp", 2, decimalCmpFunc }, + { "decimal_add", 2, decimalAddFunc }, + { "decimal_sub", 2, decimalSubFunc }, + { "decimal_mul", 2, decimalMulFunc }, + }; + unsigned int i; + (void)pzErrMsg; /* Unused parameter */ + + SQLITE_EXTENSION_INIT2(pApi); + + for(i=0; i 'ieee754(2,0)' +** ieee754(45.25) -> 'ieee754(181,-2)' +** ieee754(2, 0) -> 2.0 +** ieee754(181, -2) -> 45.25 +** +** Two additional functions break apart the one-argument ieee754() +** result into separate integer values: +** +** ieee754_mantissa(45.25) -> 181 +** ieee754_exponent(45.25) -> -2 +** +** These functions convert binary64 numbers into blobs and back again. +** +** ieee754_from_blob(x'3ff0000000000000') -> 1.0 +** ieee754_to_blob(1.0) -> x'3ff0000000000000' +** +** In all single-argument functions, if the argument is an 8-byte blob +** then that blob is interpreted as a big-endian binary64 value. +** +** +** EXACT DECIMAL REPRESENTATION OF BINARY64 VALUES +** ----------------------------------------------- +** +** This extension in combination with the separate 'decimal' extension +** can be used to compute the exact decimal representation of binary64 +** values. To begin, first compute a table of exponent values: +** +** CREATE TABLE pow2(x INTEGER PRIMARY KEY, v TEXT); +** WITH RECURSIVE c(x,v) AS ( +** VALUES(0,'1') +** UNION ALL +** SELECT x+1, decimal_mul(v,'2') FROM c WHERE x+1<=971 +** ) INSERT INTO pow2(x,v) SELECT x, v FROM c; +** WITH RECURSIVE c(x,v) AS ( +** VALUES(-1,'0.5') +** UNION ALL +** SELECT x-1, decimal_mul(v,'0.5') FROM c WHERE x-1>=-1075 +** ) INSERT INTO pow2(x,v) SELECT x, v FROM c; +** +** Then, to compute the exact decimal representation of a floating +** point value (the value 47.49 is used in the example) do: +** +** WITH c(n) AS (VALUES(47.49)) +** ---------------^^^^^---- Replace with whatever you want +** SELECT decimal_mul(ieee754_mantissa(c.n),pow2.v) +** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n); +** +** Here is a query to show various boundry values for the binary64 +** number format: +** +** WITH c(name,bin) AS (VALUES +** ('minimum positive value', x'0000000000000001'), +** ('maximum subnormal value', x'000fffffffffffff'), +** ('mininum positive nornal value', x'0010000000000000'), +** ('maximum value', x'7fefffffffffffff')) +** SELECT c.name, decimal_mul(ieee754_mantissa(c.bin),pow2.v) +** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin); +** +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include + +/* Mark a function parameter as unused, to suppress nuisance compiler +** warnings. */ +#ifndef UNUSED_PARAMETER +# define UNUSED_PARAMETER(X) (void)(X) +#endif + +/* +** Implementation of the ieee754() function +*/ +static void ieee754func( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + if( argc==1 ){ + sqlite3_int64 m, a; + double r; + int e; + int isNeg; + char zResult[100]; + assert( sizeof(m)==sizeof(r) ); + if( sqlite3_value_type(argv[0])==SQLITE_BLOB + && sqlite3_value_bytes(argv[0])==sizeof(r) + ){ + const unsigned char *x = sqlite3_value_blob(argv[0]); + unsigned int i; + sqlite3_uint64 v = 0; + for(i=0; i>52; + m = a & ((((sqlite3_int64)1)<<52)-1); + if( e==0 ){ + m <<= 1; + }else{ + m |= ((sqlite3_int64)1)<<52; + } + while( e<1075 && m>0 && (m&1)==0 ){ + m >>= 1; + e++; + } + if( isNeg ) m = -m; + } + switch( *(int*)sqlite3_user_data(context) ){ + case 0: + sqlite3_snprintf(sizeof(zResult), zResult, "ieee754(%lld,%d)", + m, e-1075); + sqlite3_result_text(context, zResult, -1, SQLITE_TRANSIENT); + break; + case 1: + sqlite3_result_int64(context, m); + break; + case 2: + sqlite3_result_int(context, e-1075); + break; + } + }else{ + sqlite3_int64 m, e, a; + double r; + int isNeg = 0; + m = sqlite3_value_int64(argv[0]); + e = sqlite3_value_int64(argv[1]); + if( m<0 ){ + isNeg = 1; + m = -m; + if( m<0 ) return; + }else if( m==0 && e>-1000 && e<1000 ){ + sqlite3_result_double(context, 0.0); + return; + } + while( (m>>32)&0xffe00000 ){ + m >>= 1; + e++; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 18:14:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A2803CA06F; Mon, 24 Aug 2020 18:14:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb0ct1hsyz439F; Mon, 24 Aug 2020 18:14:06 +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 1920D1C77D; Mon, 24 Aug 2020 18:14:06 +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 07OIE632043355; Mon, 24 Aug 2020 18:14:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OIE41g043346; Mon, 24 Aug 2020 18:14:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008241814.07OIE41g043346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Aug 2020 18:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364721 - in head/contrib/unbound: . .github cachedb contrib contrib/android contrib/ios daemon dns64 dnstap doc dynlibmod edns-subnet iterator libunbound respip services sldns smallapp... X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/unbound: . .github cachedb contrib contrib/android contrib/ios daemon dns64 dnstap doc dynlibmod edns-subnet iterator libunbound respip services sldns smallapp util util/shm_side valid... X-SVN-Commit-Revision: 364721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 18:14:06 -0000 Author: cy Date: Mon Aug 24 18:14:04 2020 New Revision: 364721 URL: https://svnweb.freebsd.org/changeset/base/364721 Log: MFV 364468: Update unbound 1.10.1 --> 1.11.0. MFH: 1 month Added: head/contrib/unbound/README-Travis.md - copied unchanged from r364468, vendor/unbound/dist/README-Travis.md head/contrib/unbound/contrib/android/ - copied from r364468, vendor/unbound/dist/contrib/android/ head/contrib/unbound/contrib/ios/ - copied from r364468, vendor/unbound/dist/contrib/ios/ head/contrib/unbound/dnstap/dnstap_fstrm.c - copied unchanged from r364468, vendor/unbound/dist/dnstap/dnstap_fstrm.c head/contrib/unbound/dnstap/dnstap_fstrm.h - copied unchanged from r364468, vendor/unbound/dist/dnstap/dnstap_fstrm.h head/contrib/unbound/dnstap/dtstream.c - copied unchanged from r364468, vendor/unbound/dist/dnstap/dtstream.c head/contrib/unbound/dnstap/dtstream.h - copied unchanged from r364468, vendor/unbound/dist/dnstap/dtstream.h head/contrib/unbound/dnstap/unbound-dnstap-socket.c - copied unchanged from r364468, vendor/unbound/dist/dnstap/unbound-dnstap-socket.c head/contrib/unbound/dynlibmod/ - copied from r364468, vendor/unbound/dist/dynlibmod/ Modified: head/contrib/unbound/.github/FUNDING.yml head/contrib/unbound/.travis.yml head/contrib/unbound/Makefile.in head/contrib/unbound/acx_python.m4 head/contrib/unbound/cachedb/cachedb.c head/contrib/unbound/cachedb/cachedb.h head/contrib/unbound/cachedb/redis.c head/contrib/unbound/config.guess head/contrib/unbound/config.h.in head/contrib/unbound/config.sub head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/contrib/aaaa-filter-iterator.patch head/contrib/unbound/contrib/fastrpz.patch head/contrib/unbound/contrib/libunbound.pc.in head/contrib/unbound/contrib/unbound.service.in head/contrib/unbound/daemon/acl_list.c head/contrib/unbound/daemon/daemon.c head/contrib/unbound/daemon/remote.c head/contrib/unbound/daemon/unbound.c head/contrib/unbound/daemon/worker.c head/contrib/unbound/dns64/dns64.c head/contrib/unbound/dnstap/dnstap.c head/contrib/unbound/dnstap/dnstap.h head/contrib/unbound/dnstap/dnstap.m4 head/contrib/unbound/doc/Changelog head/contrib/unbound/doc/README head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/libunbound.3.in head/contrib/unbound/doc/unbound-anchor.8.in head/contrib/unbound/doc/unbound-checkconf.8.in head/contrib/unbound/doc/unbound-control.8.in head/contrib/unbound/doc/unbound-host.1.in head/contrib/unbound/doc/unbound.8.in head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/edns-subnet/subnetmod.c head/contrib/unbound/edns-subnet/subnetmod.h head/contrib/unbound/iterator/iter_utils.c head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h head/contrib/unbound/libunbound/libworker.c head/contrib/unbound/libunbound/unbound.h head/contrib/unbound/respip/respip.c head/contrib/unbound/services/authzone.c head/contrib/unbound/services/authzone.h head/contrib/unbound/services/listen_dnsport.c head/contrib/unbound/services/listen_dnsport.h head/contrib/unbound/services/localzone.c head/contrib/unbound/services/mesh.c head/contrib/unbound/services/modstack.c head/contrib/unbound/services/outside_network.c head/contrib/unbound/services/outside_network.h head/contrib/unbound/services/rpz.c head/contrib/unbound/services/rpz.h head/contrib/unbound/sldns/parseutil.c head/contrib/unbound/smallapp/unbound-anchor.c head/contrib/unbound/smallapp/unbound-checkconf.c head/contrib/unbound/smallapp/unbound-control-setup.sh.in head/contrib/unbound/smallapp/unbound-control.c head/contrib/unbound/smallapp/worker_cb.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/contrib/unbound/util/fptr_wlist.c head/contrib/unbound/util/iana_ports.inc head/contrib/unbound/util/mini_event.h head/contrib/unbound/util/net_help.c head/contrib/unbound/util/net_help.h head/contrib/unbound/util/netevent.c head/contrib/unbound/util/netevent.h head/contrib/unbound/util/shm_side/shm_main.c head/contrib/unbound/util/ub_event.c head/contrib/unbound/validator/val_secalgo.c head/contrib/unbound/validator/val_sigcrypt.c Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/.github/FUNDING.yml ============================================================================== --- head/contrib/unbound/.github/FUNDING.yml Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/.github/FUNDING.yml Mon Aug 24 18:14:04 2020 (r364721) @@ -1,12 +1,2 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username +github: [NLnetLabs] custom: ['https://nlnetlabs.nl/funding/'] Modified: head/contrib/unbound/.travis.yml ============================================================================== --- head/contrib/unbound/.travis.yml Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/.travis.yml Mon Aug 24 18:14:04 2020 (r364721) @@ -1,7 +1,8 @@ -sudo: false language: c -compiler: - - gcc + +git: + depth: 5 + addons: apt: packages: @@ -9,8 +10,335 @@ addons: - libevent-dev - libexpat-dev - clang + homebrew: + packages: + - openssl + - libevent + - expat + update: true + +jobs: + include: + - os: linux + name: GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, Amd64 + compiler: clang + arch: amd64 + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: osx + name: Clang on OS X, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - CONFIG_OPTS="--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/" + - os: linux + name: Libevent, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + env: + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-libevent" + - os: linux + name: Libevent, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-libevent" + - os: osx + name: Libevent, Clang on OS X, Amd64 + compiler: clang + arch: amd64 + env: + - TEST_OSX=yes + - TEST_LIBEVENT=yes + - CONFIG_OPTS="--with-ssl=/usr/local/opt/openssl/ --with-libevent=/usr/local/opt/libevent/" + - os: linux + name: UBsan, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + dist: bionic + env: + - TEST_UBSAN=yes + - os: linux + name: UBsan, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_UBSAN=yes + - os: linux + name: Asan, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + dist: bionic + env: + - TEST_ASAN=yes + - os: linux + name: Asan, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ASAN=yes + - os: linux + name: GCC on Linux, Aarch64 + compiler: gcc + arch: arm64 + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, Aarch64 + compiler: clang + arch: arm64 + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: GCC on Linux, PowerPC64 + compiler: gcc + arch: ppc64le + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, PowerPC64 + compiler: clang + arch: ppc64le + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: GCC on Linux, s390x + compiler: gcc + arch: s390x + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: linux + name: Clang on Linux, s390x + compiler: clang + arch: s390x + dist: bionic + env: + - CONFIG_OPTS="--enable-debug --disable-flto" + - os: osx + osx_image: xcode10 + name: Apple iPhone on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=armv7s + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple iPhone on iOS, arm64 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=aarch64-apple-ios + - OPENSSL_HOST=ios64-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=arm64 + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple TV on iOS, arm64 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=aarch64-apple-ios + - OPENSSL_HOST=ios64-cross + - IOS_SDK=AppleTVOS + - IOS_CPU=arm64 + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: Apple Watch on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=WatchOS + - IOS_CPU=armv7k + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: iPhoneSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: iPhoneSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=iPhoneSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: AppleTVSimulator on OS X, x86_64 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=x86_64-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=x86_64 + - IOS_SDK=AppleTVSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: osx + osx_image: xcode10 + name: WatchSimulator on OS X, i386 + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=i386-apple-ios + - OPENSSL_HOST=iphoneos-cross + - IOS_CPU=i386 + - IOS_SDK=WatchSimulator + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" + - os: linux + name: Android armv7a, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=armv7a-linux-androideabi + - OPENSSL_HOST=android-arm + - ANDROID_CPU=armv7a + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android aarch64, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=aarch64-linux-android + - OPENSSL_HOST=android-arm64 + - ANDROID_CPU=aarch64 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android x86, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=i686-linux-android + - OPENSSL_HOST=android-x86 + - ANDROID_CPU=x86 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + - os: linux + name: Android x86_64, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=x86_64-linux-android + - OPENSSL_HOST=android-x86_64 + - ANDROID_CPU=x86_64 + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" + + allow_failures: + - os: linux + name: Android armv7a, Linux, Amd64 + - os: linux + name: Android aarch64, Linux, Amd64 + - os: linux + name: Android x86, Linux, Amd64 + - os: linux + name: Android x86_64, Linux, Amd64 + +before_script: + - | + if [ "$TEST_ANDROID" = "yes" ]; then + ./contrib/android/install_tools.sh + elif [ "$TEST_IOS" = "yes" ]; then + ./contrib/ios/install_tools.sh + fi + +# The Travis docs say to avoid calling exit in the script. It leads to +# some code duplication to avoid failures in cross-compiles. Also see +# https://docs.travis-ci.com/user/job-lifecycle/ in the Travis docs. script: - - ./configure --enable-debug --disable-flto - - make - - make test - - (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + - | + if [ "$TEST_UBSAN" = "yes" ]; then + export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" + ./configure + make -j 2 + make test + elif [ "$TEST_ASAN" = "yes" ]; then + export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" + ./configure + make -j 2 + make test + elif [ "$TEST_IOS" = "yes" ]; then + export AUTOTOOLS_BUILD="$(./config.guess)" + export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig" + source ./contrib/ios/setenv_ios.sh + ./contrib/ios/install_openssl.sh + ./contrib/ios/install_expat.sh + ./configure \ + --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ + --prefix="$IOS_PREFIX" \ + --with-ssl="$IOS_PREFIX" --disable-gost \ + --with-libexpat="$IOS_PREFIX"; + make -j 2 + make install + elif [ "$TEST_ANDROID" = "yes" ]; then + export AUTOTOOLS_BUILD="$(./config.guess)" + export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig" + ./contrib/android/install_ndk.sh + source ./contrib/android/setenv_android.sh + ./contrib/android/install_openssl.sh + ./contrib/android/install_expat.sh + ./configure \ + --build="$AUTOTOOLS_BUILD" --host="$AUTOTOOLS_HOST" \ + --prefix="$ANDROID_PREFIX" \ + --with-ssl="$ANDROID_PREFIX" --disable-gost \ + --with-libexpat="$ANDROID_PREFIX"; + make -j 2 + make install + elif [ "$TEST_OSX" = "yes" ]; then + ./configure --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl/ + make -j 2 + make test + (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + else + ./configure ${CONFIG_OPTS} + make -j 2 + make test + (cd testdata/clang-analysis.tdir; bash clang-analysis.test) + fi Modified: head/contrib/unbound/Makefile.in ============================================================================== --- head/contrib/unbound/Makefile.in Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/Makefile.in Mon Aug 24 18:14:04 2020 (r364721) @@ -25,6 +25,7 @@ DNSTAP_SRC=@DNSTAP_SRC@ DNSTAP_OBJ=@DNSTAP_OBJ@ DNSCRYPT_SRC=@DNSCRYPT_SRC@ DNSCRYPT_OBJ=@DNSCRYPT_OBJ@ +WITH_DYNLIBMODULE=@WITH_DYNLIBMODULE@ WITH_PYTHONMODULE=@WITH_PYTHONMODULE@ WITH_PYUNBOUND=@WITH_PYUNBOUND@ PY_MAJOR_VERSION=@PY_MAJOR_VERSION@ @@ -77,7 +78,7 @@ LINT=splint LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list -formatcode #-Dglob64=glob -Dglobfree64=globfree # compat with openssl linux edition. -LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"ECDSA_SIG=DSA_SIG" -Dfstrm_res=int +LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" -D"ECDSA_SIG=DSA_SIG" # compat with NetBSD LINTFLAGS+=@NETBSD_LINTFLAGS@ # compat with OpenBSD @@ -87,6 +88,12 @@ LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_ME INSTALL=$(SHELL) $(srcdir)/install-sh +DYNLIBMOD_SRC=dynlibmod/dynlibmod.c +DYNLIBMOD_OBJ=@DYNLIBMOD_OBJ@ +DYNLIBMOD_HEADER=@DYNLIBMOD_HEADER@ +DYNLIBMOD_EXTRALIBS=@DYNLIBMOD_EXTRALIBS@ + + #pythonmod.c is not here, it is mentioned by itself in its own rules, #makedepend fails on missing interface.h otherwise. PYTHONMOD_SRC=pythonmod/pythonmod_utils.c @@ -140,7 +147,7 @@ autotrust.lo val_anchor.lo rpz.lo \ validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \ val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo cachedb.lo redis.lo authzone.lo \ $(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ) $(DNSCRYPT_OBJ) \ -$(IPSECMOD_OBJ) $(IPSET_OBJ) respip.lo +$(IPSECMOD_OBJ) $(IPSET_OBJ) $(DYNLIBMOD_OBJ) respip.lo COMMON_OBJ_WITHOUT_UB_EVENT=$(COMMON_OBJ_WITHOUT_NETCALL) netevent.lo listen_dnsport.lo \ outside_network.lo COMMON_OBJ=$(COMMON_OBJ_WITHOUT_UB_EVENT) ub_event.lo @@ -219,7 +226,7 @@ MEMSTATS_OBJ_LINK=$(MEMSTATS_OBJ) worker_cb.lo $(COMMO $(SLDNS_OBJ) ASYNCLOOK_SRC=testcode/asynclook.c ASYNCLOOK_OBJ=asynclook.lo -ASYNCLOOK_OBJ_LINK=$(ASYNCLOOK_OBJ) log.lo locks.lo $(COMPAT_OBJ) @ASYNCLOOK_ALLOCCHECK_EXTRA_OBJ@ +ASYNCLOOK_OBJ_LINK=$(ASYNCLOOK_OBJ) log.lo locks.lo $(CHECKLOCK_OBJ) $(COMPAT_OBJ) @ASYNCLOOK_ALLOCCHECK_EXTRA_OBJ@ STREAMTCP_SRC=testcode/streamtcp.c STREAMTCP_OBJ=streamtcp.lo STREAMTCP_OBJ_LINK=$(STREAMTCP_OBJ) worker_cb.lo $(COMMON_OBJ) $(COMPAT_OBJ) \ @@ -233,6 +240,10 @@ DELAYER_OBJ_LINK=$(DELAYER_OBJ) worker_cb.lo $(COMMON_ $(SLDNS_OBJ) IPSET_SRC=@IPSET_SRC@ IPSET_OBJ=@IPSET_OBJ@ +DNSTAP_SOCKET_SRC=dnstap/unbound-dnstap-socket.c +DNSTAP_SOCKET_OBJ=unbound-dnstap-socket.lo +DNSTAP_SOCKET_OBJ_LINK=$(DNSTAP_SOCKET_OBJ) $(COMMON_OBJ) \ +$(COMPAT_OBJ) $(SLDNS_OBJ) LIBUNBOUND_SRC=libunbound/context.c libunbound/libunbound.c \ libunbound/libworker.c LIBUNBOUND_OBJ=context.lo libunbound.lo libworker.lo ub_event_pluggable.lo @@ -259,7 +270,7 @@ ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \ $(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) \ $(MEMSTATS_SRC) $(CHECKCONF_SRC) $(LIBUNBOUND_SRC) $(HOST_SRC) \ $(ASYNCLOOK_SRC) $(STREAMTCP_SRC) $(PERF_SRC) $(DELAYER_SRC) \ - $(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) \ + $(CONTROL_SRC) $(UBANCHOR_SRC) $(PETAL_SRC) $(DNSTAP_SOCKET_SRC)\ $(PYTHONMOD_SRC) $(PYUNBOUND_SRC) $(WIN_DAEMON_THE_SRC) \ $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC) $(SLDNS_SRC) @@ -267,7 +278,7 @@ ALL_OBJ=$(COMMON_OBJ) $(UNITTEST_OBJ) $(DAEMON_OBJ) \ $(TESTBOUND_OBJ) $(LOCKVERIFY_OBJ) $(PKTVIEW_OBJ) \ $(MEMSTATS_OBJ) $(CHECKCONF_OBJ) $(LIBUNBOUND_OBJ) $(HOST_OBJ) \ $(ASYNCLOOK_OBJ) $(STREAMTCP_OBJ) $(PERF_OBJ) $(DELAYER_OBJ) \ - $(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) \ + $(CONTROL_OBJ) $(UBANCHOR_OBJ) $(PETAL_OBJ) $(DNSTAP_SOCKET_OBJ)\ $(COMPAT_OBJ) $(PYUNBOUND_OBJ) \ $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ) $(SLDNS_OBJ) @@ -306,6 +317,7 @@ rsrc_unbound_checkconf.o: $(srcdir)/winrc/rsrc_unbound TEST_BIN=asynclook$(EXEEXT) delayer$(EXEEXT) \ lock-verify$(EXEEXT) memstats$(EXEEXT) perf$(EXEEXT) \ petal$(EXEEXT) pktview$(EXEEXT) streamtcp$(EXEEXT) \ + unbound-dnstap-socket$(EXEEXT) \ testbound$(EXEEXT) unittest$(EXEEXT) tests: all $(TEST_BIN) @@ -315,7 +327,7 @@ longcheck: longtest test: unittest$(EXEEXT) testbound$(EXEEXT) ./unittest$(EXEEXT) ./testbound$(EXEEXT) -s - for x in $(srcdir)/testdata/*.rpl; do echo -n "$$x "; if ./testbound$(EXEEXT) -p $$x >/dev/null 2>&1; then echo OK; else echo failed; exit 1; fi done + for x in $(srcdir)/testdata/*.rpl; do printf "%s" "$$x "; if ./testbound$(EXEEXT) -p $$x >/dev/null 2>&1; then echo OK; else echo failed; exit 1; fi done @echo test OK longtest: tests @@ -328,13 +340,13 @@ libunbound.la: $(LIBUNBOUND_OBJ_LINK) $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) $(SSLLIB) $(LIBS) unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) @@ -352,34 +364,34 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ_LINK) libunbo $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) -L. -L.libs -lunbound $(SSLLIB) $(LIBS) streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) signit$(EXEEXT): testcode/signit.c $(CC) $(CPPFLAGS) $(CFLAGS) @PTHREAD_CFLAGS_ONLY@ -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) @@ -401,7 +413,13 @@ dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h: $(srcdir)/d @-if test ! -d dnstap; then $(INSTALL) -d dnstap; fi $(PROTOC_C) --c_out=. --proto_path=$(srcdir) $(srcdir)/dnstap/dnstap.proto +unbound-dnstap-socket$(EXEEXT): $(DNSTAP_SOCKET_OBJ_LINK) + $(LINK) -o $@ $(DNSTAP_SOCKET_OBJ_LINK) $(SSLLIB) $(LIBS) $(DYNLIBMOD_EXTRALIBS) + dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h +dtstream.lo dtstream.o: $(srcdir)/dnstap/dtstream.c config.h $(srcdir)/dnstap/dtstream.h +dnstap_fstrm.lo dnstap_fstrm.o: $(srcdir)/dnstap/dnstap_fstrm.c config.h $(srcdir)/dnstap/dnstap_fstrm.h +unbound-dnstap-socket.lo unbound-dnstap-socket.o: $(srcdir)/dnstap/unbound-dnstap-socket.c config.h $(srcdir)/dnstap/dtstream.h # dnscrypt dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h \ @@ -455,6 +473,7 @@ clean: rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-anchor$(EXEEXT) unbound-control-setup libunbound.la unbound.h rm -f $(ALL_SRC:.c=.lint) rm -f _unbound.la libunbound/python/libunbound_wrap.c libunbound/python/unbound.py pythonmod/interface.h pythonmod/unboundmodule.py + rm -f libunbound.a rm -rf autom4te.cache .libs build doc/html doc/xml distclean: clean @@ -629,6 +648,7 @@ depend: -e 's?$$(srcdir)/pythonmod/pythonmod.h?$$(PYTHONMOD_HEADER)?g' \ -e 's?$$(srcdir)/edns-subnet/subnetmod.h $$(srcdir)/edns-subnet/subnet-whitelist.h $$(srcdir)/edns-subnet/edns-subnet.h $$(srcdir)/edns-subnet/addrtree.h?$$(SUBNET_HEADER)?g' \ -e 's?$$(srcdir)/ipsecmod/ipsecmod.h $$(srcdir)/ipsecmod/ipsecmod-whitelist.h?$$(IPSECMOD_HEADER)?g' \ + -e 's?$$(srcdir)/dynlibmod/dynlibmod.h?$$(DYNLIBMOD_HEADER)?g' \ -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' \ > $(DEPEND_TMP) cp $(DEPEND_TARGET) $(DEPEND_TMP2) @@ -796,12 +816,13 @@ modstack.lo modstack.o: $(srcdir)/services/modstack.c $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ + $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ + $(srcdir)/ipset/ipset.h $(srcdir)/dynlibmod/dynlibmod.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ @@ -886,21 +907,23 @@ authzone.lo authzone.o: $(srcdir)/services/authzone.c $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ - $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h + $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ + $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ + $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ + $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ + $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ + $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h \ + $(srcdir)/dynlibmod/dynlibmod.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ @@ -1108,7 +1131,32 @@ respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h +dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ + $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ + dnstap/dnstap.pb-c.h +dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ + +dynlibmod.lo dynlibmod.o: $(srcdir)/dynlibmod/dynlibmod.c config.h $(srcdir)/dynlibmod/dynlibmod.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h\ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/wire2str.h +dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ + $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/storage/lookup3.h ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h +ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ Copied: head/contrib/unbound/README-Travis.md (from r364468, vendor/unbound/dist/README-Travis.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/unbound/README-Travis.md Mon Aug 24 18:14:04 2020 (r364721, copy of r364468, vendor/unbound/dist/README-Travis.md) @@ -0,0 +1,278 @@ +# Travis Testing + +Unbound 1.10 and above leverage Travis CI to increase coverage of compilers and platforms. Compilers include Clang and GCC; while platforms include Android, iOS, Linux, and OS X on AMD64, Aarch64, PowerPC and s390x hardware. + +Android is tested on armv7a, aarch64, x86 and x86_64. The Android recipes build and install OpenSSL and Expat, and then builds Unbound. The testing is tailored for Android NDK-r19 and above, and includes NDK-r20 and NDK-r21. Mips and Mips64 are not tested because they are no longer supported under current NDKs. + +iOS is tested for iPhoneOS, WatchOS, AppleTVOS, iPhoneSimulator, AppleTVSimulator and WatchSimulator. The testing uses Xcode 10 on OS X 10.13. + +The Unbound Travis configuration file `.travis.yml` does not use top-level keys like `os:` and `compiler:` so there is no matrix expansion. Instead Unbound specifies the exact job to run under the `jobs:` and `include:` keys. + +## Typical recipe + +A typical recipe tests Clang and GCC on various hardware. The hardware includes AMD64, Aarch64, PowerPC and s390x. PowerPC is a little-endian platform, and s390x is a big-endian platform. There are pairs of recipes that are similar to the following. + +``` +- os: linux + name: GCC on Linux, Aarch64 + compiler: gcc + arch: arm64 + dist: bionic +- os: linux + name: Clang on Linux, Aarch64 + compiler: clang + arch: arm64 + dist: bionic +``` + +OS X provides a single recipe to test Clang. GCC is not tested because GCC is an alias for Clang. + +## Sanitizer builds + +Two sanitizer builds are tested using Clang and GCC, for a total of four builds. The first sanitizer is Undefined Behavior sanitizer (UBsan), and the second is Address sanitizer (Asan). The sanitizers are only run on AMD64 hardware. Note the environment includes `TEST_UBSAN=yes` or `TEST_ASAN=yes` for the sanitizer builds. + +The recipes are similar to the following. + +``` +- os: linux + name: UBsan, GCC on Linux, Amd64 + compiler: gcc + arch: amd64 + dist: bionic + env: TEST_UBSAN=yes +- os: linux + name: UBsan, Clang on Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: TEST_UBSAN=yes +``` + +When the Travis script encounters a sanitizer it uses different `CFLAGS` and configuration string. + +``` +if [ "$TEST_UBSAN" = "yes" ]; then + export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover" + ./configure + make -j 2 + make test +elif [ "$TEST_ASAN" = "yes" ]; then + export CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" + ./configure + make -j 2 + make test +... +``` + +## Android builds + +Travis tests Android builds for the armv7a, aarch64, x86 and x86_64 architectures. The builds are trickier than other builds for several reasons. The testing requires installation of the Android NDK and SDK, it requires a cross-compile, and requires OpenSSL and Expat prerequisites. The Android cross-compiles also require care to set the Autotools triplet, the OpenSSL triplet, the toolchain path, the tool variables, and the sysroot. The discussion below detail the steps of the Android recipes. + +### Android job + +The first step sets environmental variables for the cross-compile using the Travis job. A typical job with variables is shown below. + +``` +- os: linux + name: Android armv7a, Linux, Amd64 + compiler: clang + arch: amd64 + dist: bionic + env: + - TEST_ANDROID=yes + - AUTOTOOLS_HOST=armv7a-linux-androideabi + - OPENSSL_HOST=android-arm + - ANDROID_CPU=armv7a + - ANDROID_API=23 + - ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU" + - ANDROID_SDK_ROOT="$HOME/android-sdk" + - ANDROID_NDK_ROOT="$HOME/android-ndk" +``` + +### ANDROID_NDK_ROOT + +The second step for Android is to set the environmental variables `ANDROID_NDK_ROOT` and `ANDROID_SDK_ROOT`. This is an important step because the NDK and SDK use the variables internally to locate their own tools. Also see [Recommended NDK Directory?](https://groups.google.com/forum/#!topic/android-ndk/qZjhOaynHXc) on the android-ndk mailing list. (Many folks miss this step, or use incorrect variables like `ANDROID_NDK_HOME` or `ANDROID_SDK_HOME`). + +If you are working from a developer machine you probably already have the necessary tools installed. You should ensure `ANDROID_NDK_ROOT` and `ANDROID_SDK_ROOT` are set properly. + +### Tool installation + +The second step installs tools needed for OpenSSL, Expat and Unbound. This step is handled in by the script `contrib/android/install_tools.sh`. The tools include curl, tar, zip, unzip and java. + +``` +before_script: + - | + if [ "$TEST_ANDROID" = "yes" ]; then + ./contrib/android/install_tools.sh + elif [ "$TEST_IOS" = "yes" ]; then + ./contrib/ios/install_tools.sh + fi +``` + +### NDK installation + +The third step installs the NDK and SDK. This step is handled in by the script `contrib/android/install_ndk.sh`. The script uses `ANDROID_NDK_ROOT` and `ANDROID_SDK_ROOT` to place the NDK and SDK in the `$HOME` directory. + +If you are working from a developer machine you probably already have a NDK and SDK installed. + +### Android environment + +The fourth step sets the Android cross-compile environment using the script `contrib/android/setenv_android.sh`. The script is `sourced` so the variables in the script are available to the calling shell. The script sets variables like `CC`, `CXX`, `AS` and `AR`; sets `CFLAGS` and `CXXFLAGS`; sets a `sysroot` so Android headers and libraries are found; and adds the path to the toolchain to `PATH`. + +`contrib/android/setenv_android.sh` knows which toolchain and architecture to select by inspecting environmental variables set by Travis for the job. In particular, the variables `ANDROID_CPU` and `ANDROID_API` tell `contrib/android/setenv_android.sh` which tools and libraries to select. + +The `contrib/android/setenv_android.sh` script specifies the tools in a `case` statement like the following. There is a case for each of the architectures armv7a, aarch64, x86 and x86_64. + +``` +armv8a|aarch64|arm64|arm64-v8a) + CC="aarch64-linux-android$ANDROID_API-clang" + CXX="aarch64-linux-android$ANDROID_API-clang++" + LD="aarch64-linux-android-ld" + AS="aarch64-linux-android-as" + AR="aarch64-linux-android-ar" + RANLIB="aarch64-linux-android-ranlib" + STRIP="aarch64-linux-android-strip" + + CFLAGS="-funwind-tables -fexceptions" + CXXFLAGS="-funwind-tables -fexceptions -frtti" +``` + +### OpenSSL and Expat + +The fifth step builds OpenSSL and Expat. OpenSSL and Expat are built for Android using the scripts `contrib/android/install_openssl.sh` and `contrib/android/install_expat.sh`. The scripts download, configure and install the latest release version of the libraries. The libraries are configured with `--prefix="$ANDROID_PREFIX"` so the headers are placed in `$ANDROID_PREFIX/include` directory, and the libraries are placed in the `$ANDROID_PREFIX/lib` directory. + +`ANDROID_PREFIX` is the value `$HOME/android$ANDROID_API-$ANDROID_CPU`. The libraries will be installed in `$HOME/android23-armv7a`, `$HOME/android23-aarch64`, etc. For Autotools projects, the appropriate `PKG_CONFIG_PATH` is exported. `PKG_CONFIG_PATH` is the userland equivalent to sysroot, and allows Autotools to find non-system headers and libraries for an architecture. Typical `PKG_CONFIG_PATH` are `$HOME/android23-armv7a/lib/pkgconfig` and `$HOME/android23-aarch64/lib/pkgconfig`. + +OpenSSL also uses a custom configuration file called `15-android.conf`. It is a copy of the OpenSSL's project file and located at `contrib/android/15-android.conf`. The Unbound version is copied to the OpenSSL source files after unpacking the OpenSSL distribution. The Unbound version has legacy NDK support removed and some other fixes, like `ANDROID_NDK_ROOT` awareness. The changes mean Unbound's `15-android.conf` will only work with Unbound, with NDK-r19 and above, and a properly set environment. + +OpenSSL is configured with `no-engine`. If you want to include OpenSSL engines then edit `contrib/android/install_openssl.sh` and remove the config option. + +### Android build + +Finally, once OpenSSL and Expat are built, then the Travis script configures and builds Unbound. The recipe looks as follows. + +``` +elif [ "$TEST_ANDROID" = "yes" ]; then + export AUTOTOOLS_BUILD="$(./config.guess)" + export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig" + ./contrib/android/install_ndk.sh + source ./contrib/android/setenv_android.sh + ./contrib/android/install_openssl.sh + ./contrib/android/install_expat.sh + ./configure \ + --build="$AUTOTOOLS_BUILD" \ + --host="$AUTOTOOLS_HOST" \ + --prefix="$ANDROID_PREFIX" \ + --with-ssl="$ANDROID_PREFIX" \ + --with-libexpat="$ANDROID_PREFIX" \ + --disable-gost; + make -j 2 + make install +``` + +Travis only smoke tests an Android build using a compile, link and install. The self tests are not run. TODO: figure out how to fire up an emulator, push the tests to the device and run them. + +### Android flags + +`contrib/android/setenv_android.sh` uses specific flags for `CFLAGS` and `CXXFLAGS`. They are taken from `ndk-build`, so we consider them the official flag set. It is important to use the same flags across projects to avoid subtle problems due to mixing and matching different flags. + +`CXXFLAGS` includes `-fexceptions` and `-frtti` because exceptions and runtime type info are disabled by default. `CFLAGS` include `-funwind-tables` and `-fexceptions` to ensure C++ exceptions pass through C code, if needed. Also see `docs/CPLUSPLUS-SUPPORT.html` in the NDK docs. + +To inspect the flags used by `ndk-build` for a platform clone ASOP's [ndk-samples](https://github.com/android/ndk-samples/tree/master/hello-jni) and build the `hello-jni` project. Use the `V=1` flag to see the full compiler output from `ndk-build`. + +## iOS builds + +Travis tests iOS builds for the armv7a, armv7s and aarch64 architectures for iPhoneOS, AppleTVOS and WatchOS. iPhoneOS is tested using both 32-bit builds (iPhones) and 64-bit builds (iPads). Travis also tests compiles against the simulators. The builds are trickier than other builds for several reasons. The testing requires a cross-compile, and requires OpenSSL and Expat prerequisites. The iOS cross-compiles also require care to set the Autotools triplet, the OpenSSL triplet, the toolchain path, the tool variables, and the sysroot. The discussion below detail the steps of the iOS recipes. + +### iOS job + +The first step sets environmental variables for the cross-compile using the Travis job. A typical job with variables is shown below. + +``` +- os: osx + osx_image: xcode10 + name: Apple iPhone on iOS, armv7 + compiler: clang + env: + - TEST_IOS=yes + - AUTOTOOLS_HOST=armv7-apple-ios + - OPENSSL_HOST=ios-cross + - IOS_SDK=iPhoneOS + - IOS_CPU=armv7s + - IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU" +``` + +### Tool installation + +The second step installs tools needed for OpenSSL, Expat and Unbound. This step is handled in by the script `contrib/ios/install_tools.sh`. The tools include autotools, curl and perl. The installation happens at the `before_script:` stage of Travis. + +``` +before_script: + - | + if [ "$TEST_ANDROID" = "yes" ]; then + ./contrib/android/install_tools.sh + elif [ "$TEST_IOS" = "yes" ]; then + ./contrib/ios/install_tools.sh + fi +``` + +### iOS environment + +The third step sets the iOS cross-compile environment using the script `contrib/ios/setenv_ios.sh`. The script is `sourced` so the variables in the script are available to the calling shell. The script sets variables like `CC`, `CXX`, `AS` and `AR`; sets `CFLAGS` and `CXXFLAGS`; sets a `sysroot` so iOS headers and libraries are found; and adds the path to the toolchain to `PATH`. + +`contrib/ios/setenv_ios.sh` knows which toolchain and architecture to select by inspecting environmental variables set by Travis for the job. In particular, the variables `IOS_SDK` and `IOS_CPU` tell `contrib/ios/setenv_ios.sh` which tools and libraries to select. + +The `contrib/ios/setenv_ios.sh` script specifies the tools to use during the cross-compile. For Apple SDKs, the tool names are the same as a desktop. There are no special prefixes for the mobile tools. + +``` +CPP=cpp +CC=clang +CXX=clang++ +LD=ld +AS=as +AR=ar +RANLIB=ranlib +STRIP=strip +``` + +If you are working from a developer machine you probably already have the necessary tools installed. + +### OpenSSL and Expat + +The fourth step builds OpenSSL and Expat. OpenSSL and Expat are built for iOS using the scripts `contrib/ios/install_openssl.sh` and `contrib/ios/install_expat.sh`. The scripts download, configure and install the latest release version of the libraries. The libraries are configured with `--prefix="$IOS_PREFIX"` so the headers are placed in `$IOS_PREFIX/include` directory, and the libraries are placed in the `$IOS_PREFIX/lib` directory. + +`IOS_PREFIX` is the value `$HOME/$IOS_SDK-$IOS_CPU`. The scheme handles both iOS SDKs and cpu architectures so the pair recieves a unique installation directory. The libraries will be installed in `$HOME/iPhoneOS-armv7s`, `$HOME/iPhoneOS-arm64`, `$HOME/iPhoneSimulator-i386`, etc. For Autotools projects, the appropriate `PKG_CONFIG_PATH` is exported. + +`PKG_CONFIG_PATH` is an important variable. It is the userland equivalent to sysroot, and allows Autotools to find non-system headers and libraries for an architecture. Typical `PKG_CONFIG_PATH` are `$HOME/iPhoneOS-armv7s/lib/pkgconfig` and `$HOME/iPhoneOS-arm64/lib/pkgconfig`. + +OpenSSL also uses a custom configuration file called `15-ios.conf`. It is a copy of the OpenSSL's project file and located at `contrib/ios/15-ios.conf`. The Unbound version is copied to the OpenSSL source files after unpacking the OpenSSL distribution. The changes mean Unbound's `15-ios.conf` will only work with Unbound and a properly set environment. + +OpenSSL is configured with `no-engine`. Engines require dynamic loading so engines are disabled permanently in `15-ios.conf`. + +### iOS build + +Finally, once OpenSSL and Expat are built, then the Travis script configures and builds Unbound. The full recipe looks as follows. + +``` +elif [ "$TEST_IOS" = "yes" ]; then + export AUTOTOOLS_BUILD="$(./config.guess)" + export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig" + source ./contrib/ios/setenv_ios.sh + ./contrib/ios/install_openssl.sh + ./contrib/ios/install_expat.sh + ./configure \ + --build="$AUTOTOOLS_BUILD" \ + --host="$AUTOTOOLS_HOST" \ + --prefix="$IOS_PREFIX" \ + --with-ssl="$IOS_PREFIX" \ + --with-libexpat="$IOS_PREFIX" \ + --disable-gost; + make -j 2 + make install +``` + +Travis only smoke tests an iOS build using a compile, link and install. The self tests are not run. TODO: figure out how to fire up an simulator, push the tests to the device and run them. + +### iOS flags + +`contrib/ios/setenv_ios.sh` uses specific flags for `CFLAGS` and `CXXFLAGS`. They are taken from Xcode, so we consider them the official flag set. It is important to use the same flags across projects to avoid subtle problems due to mixing and matching different flags. Modified: head/contrib/unbound/acx_python.m4 ============================================================================== --- head/contrib/unbound/acx_python.m4 Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/acx_python.m4 Mon Aug 24 18:14:04 2020 (r364721) @@ -58,6 +58,11 @@ $ac_distutils_result]) AC_MSG_RESULT([$PYTHON_LDFLAGS]) AC_SUBST([PYTHON_LDFLAGS]) + if test -z "$PYTHON_LIBDIR"; then + PYTHON_LIBDIR=`$PYTHON -c "from distutils.sysconfig import *; \ + print(get_config_var('LIBDIR'));"` + fi + # # Check for site packages # Modified: head/contrib/unbound/cachedb/cachedb.c ============================================================================== --- head/contrib/unbound/cachedb/cachedb.c Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/cachedb/cachedb.c Mon Aug 24 18:14:04 2020 (r364721) @@ -160,7 +160,7 @@ testframe_lookup(struct module_env* env, struct cached static void testframe_store(struct module_env* env, struct cachedb_env* cachedb_env, - char* key, uint8_t* data, size_t data_len) + char* key, uint8_t* data, size_t data_len, time_t ATTR_UNUSED(ttl)) { struct testframe_moddata* d = (struct testframe_moddata*) cachedb_env->backend_data; @@ -606,7 +606,8 @@ cachedb_extcache_store(struct module_qstate* qstate, s /* call backend */ (*ie->backend->store)(qstate->env, ie, key, sldns_buffer_begin(qstate->env->scratch_buffer), - sldns_buffer_limit(qstate->env->scratch_buffer)); + sldns_buffer_limit(qstate->env->scratch_buffer), + qstate->return_msg->rep->ttl); } /** Modified: head/contrib/unbound/cachedb/cachedb.h ============================================================================== --- head/contrib/unbound/cachedb/cachedb.h Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/cachedb/cachedb.h Mon Aug 24 18:14:04 2020 (r364721) @@ -84,7 +84,7 @@ struct cachedb_backend { /** Store (env, cachedb_env, key, data, data_len) */ void (*store)(struct module_env*, struct cachedb_env*, char*, - uint8_t*, size_t); + uint8_t*, size_t, time_t); }; #define CACHEDB_HASHSIZE 256 /* bit hash */ Modified: head/contrib/unbound/cachedb/redis.c ============================================================================== --- head/contrib/unbound/cachedb/redis.c Mon Aug 24 18:13:44 2020 (r364720) +++ head/contrib/unbound/cachedb/redis.c Mon Aug 24 18:14:04 2020 (r364721) @@ -59,6 +59,9 @@ struct redis_moddata { struct timeval timeout; /* timeout for connection setup and commands */ }; +static redisReply* redis_command(struct module_env*, struct cachedb_env*, + const char*, const uint8_t*, size_t); + static redisContext* redis_connect(const struct redis_moddata* moddata) { @@ -114,6 +117,33 @@ redis_init(struct module_env* env, struct cachedb_env* for(i = 0; i < moddata->numctxs; i++) moddata->ctxs[i] = redis_connect(moddata); cachedb_env->backend_data = moddata; + if(env->cfg->redis_expire_records) { + redisReply* rep = NULL; + int redis_reply_type = 0; + /** check if setex command is supported */ + rep = redis_command(env, cachedb_env, + "SETEX __UNBOUND_REDIS_CHECK__ 1 none", NULL, 0); + if(!rep) { + /** init failed, no response from redis server*/ + log_err("redis_init: failed to init redis, the " *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 24 18:17:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70CA53CA147; Mon, 24 Aug 2020 18:17:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb0hV2S55z43Wv; Mon, 24 Aug 2020 18:17:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 370761C77E; Mon, 24 Aug 2020 18:17:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OIHExb043539; Mon, 24 Aug 2020 18:17:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OIHEgb043538; Mon, 24 Aug 2020 18:17:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008241817.07OIHEgb043538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Aug 2020 18:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364722 - head/usr.sbin/unbound X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.sbin/unbound X-SVN-Commit-Revision: 364722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 18:17:14 -0000 Author: cy Date: Mon Aug 24 18:17:13 2020 New Revision: 364722 URL: https://svnweb.freebsd.org/changeset/base/364722 Log: Update unbound version number. MFC after: 1 month X-MFC with: r364721 Modified: head/usr.sbin/unbound/config.h Modified: head/usr.sbin/unbound/config.h ============================================================================== --- head/usr.sbin/unbound/config.h Mon Aug 24 18:14:04 2020 (r364721) +++ head/usr.sbin/unbound/config.h Mon Aug 24 18:17:13 2020 (r364722) @@ -687,7 +687,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.10.1" +#define PACKAGE_VERSION "1.11.0" /* default pidfile location */ #define PIDFILE "/var/unbound/unbound.pid" @@ -709,7 +709,7 @@ #define ROOT_CERT_FILE "/var/unbound/icannbundle.pem" /* version number for resource files */ -#define RSRC_PACKAGE_VERSION 1,9,6,0 +#define RSRC_PACKAGE_VERSION 1,11,0,0 /* Directory to chdir to */ #define RUN_DIR "/var/unbound" From owner-svn-src-head@freebsd.org Mon Aug 24 18:23:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B59013CA78B; Mon, 24 Aug 2020 18:23:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb0rH3x34z43xJ; Mon, 24 Aug 2020 18:23:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A8491CC70; Mon, 24 Aug 2020 18:23:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OINxtH049484; Mon, 24 Aug 2020 18:23:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OINxvQ049483; Mon, 24 Aug 2020 18:23:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008241823.07OINxvQ049483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 24 Aug 2020 18:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364723 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 18:23:59 -0000 Author: mjg Date: Mon Aug 24 18:23:58 2020 New Revision: 364723 URL: https://svnweb.freebsd.org/changeset/base/364723 Log: cache: remove leftover assert in vn_fullpath_any_smr It is only valid when !slash_prefixed. For slash_prefixed the length is properly accounted for later. Reported by: markj (syzkaller) Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 24 18:17:13 2020 (r364722) +++ head/sys/kern/vfs_cache.c Mon Aug 24 18:23:58 2020 (r364723) @@ -2834,8 +2834,6 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rd orig_buflen = *buflen; - MPASS(*buflen >= 2); - if (!slash_prefixed) { MPASS(*buflen >= 2); *buflen -= 1; From owner-svn-src-head@freebsd.org Mon Aug 24 19:35:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 880663CB3F6; Mon, 24 Aug 2020 19:35:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb2QX2s38z47qk; Mon, 24 Aug 2020 19:35:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 276F41D849; Mon, 24 Aug 2020 19:35:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OJZGRG092509; Mon, 24 Aug 2020 19:35:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OJZF1H092507; Mon, 24 Aug 2020 19:35:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008241935.07OJZF1H092507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2020 19:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364725 - in head: sbin/devd sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin/devd sys/kern X-SVN-Commit-Revision: 364725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 19:35:16 -0000 Author: imp Date: Mon Aug 24 19:35:15 2020 New Revision: 364725 URL: https://svnweb.freebsd.org/changeset/base/364725 Log: Change the resume notification event from 'kern' to 'kernel' We have both a system of 'kern' and of 'kernel'. Prefer the latter and convert this notification to use 'kernel' instead of 'kern'. As a transition period, continue to also generate the 'kern' notification until sometime after FreeBSD 13 is branched. MFC After: 3 days Modified: head/sbin/devd/devd.conf.5 head/sys/kern/subr_bus.c Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Mon Aug 24 19:00:57 2020 (r364724) +++ head/sbin/devd/devd.conf.5 Mon Aug 24 19:35:15 2020 (r364725) @@ -465,6 +465,8 @@ provider size has changed. .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kern Ta Li power Ta Li resume Ta Notification that the system has woken from the suspended state. +Note: this notification is deprecated and will be removed in +.Fx 14.0 . .El .Pp .Pp @@ -472,6 +474,8 @@ Notification that the system has woken from the suspen .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kernel Ta Li signal Ta Li coredump Ta Notification that a process has crashed and dumped core. +.It Li kernel Ta Li power Ta Li resume Ta +Notification that the system has woken from the suspended state. .El .Pp .Bl -column "System" "Subsystem" "1234567" -compact Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Aug 24 19:00:57 2020 (r364724) +++ head/sys/kern/subr_bus.c Mon Aug 24 19:35:15 2020 (r364725) @@ -4989,8 +4989,10 @@ root_resume(device_t dev) int error; error = bus_generic_resume(dev); - if (error == 0) - devctl_notify("kern", "power", "resume", NULL); + if (error == 0) { + devctl_notify("kern", "power", "resume", NULL); /* Deprecated gone in 14 */ + devctl_notify("kernel", "power", "resume", NULL); + } return (error); } From owner-svn-src-head@freebsd.org Mon Aug 24 19:35:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 709883CB5B7; Mon, 24 Aug 2020 19:35:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb2Qm0VFbz47x3; Mon, 24 Aug 2020 19:35:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3EA51D5F1; Mon, 24 Aug 2020 19:35:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OJZRbx092568; Mon, 24 Aug 2020 19:35:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OJZROr092567; Mon, 24 Aug 2020 19:35:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008241935.07OJZROr092567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2020 19:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364726 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 19:35:28 -0000 Author: imp Date: Mon Aug 24 19:35:27 2020 New Revision: 364726 URL: https://svnweb.freebsd.org/changeset/base/364726 Log: Document the kern -> kernel name change for resume events. MFC After: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Aug 24 19:35:15 2020 (r364725) +++ head/UPDATING Mon Aug 24 19:35:27 2020 (r364726) @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200824: + The resume code now notifies devd with the 'kernel' system + rather than the old 'kern' subsystem to be consistent with + other use. The old notification will be created as well, but + will be removed prior to FreeBSD 14.0. + 20200821: r362275 changed the internal API between the kernel RPC and the NFS modules. As such, all the modules must be recompiled from From owner-svn-src-head@freebsd.org Mon Aug 24 19:49:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B18F3CB833; Mon, 24 Aug 2020 19:49:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb2kq2C2kz49Bw; Mon, 24 Aug 2020 19:49:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AB101DB29; Mon, 24 Aug 2020 19:49:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OJnNmK099084; Mon, 24 Aug 2020 19:49:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OJnNI7099083; Mon, 24 Aug 2020 19:49:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008241949.07OJnNI7099083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2020 19:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364727 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 19:49:23 -0000 Author: imp Date: Mon Aug 24 19:49:22 2020 New Revision: 364727 URL: https://svnweb.freebsd.org/changeset/base/364727 Log: Document devd event change from r364725 Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Mon Aug 24 19:35:27 2020 (r364726) +++ head/RELNOTES Mon Aug 24 19:49:22 2020 (r364727) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r364725: + Changes to one obscure devd event generated on resume need to + be documented. The old form will still be gerated in 13, but not + in 14. + r363679: Applications using regex(3), e.g. sed/grep, will no longer accept redundant escapes for most ordinary characters. From owner-svn-src-head@freebsd.org Mon Aug 24 20:02:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BED63CBDE2; Mon, 24 Aug 2020 20:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb31f3By8z4Bpr; Mon, 24 Aug 2020 20:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 511AF1DF2A; Mon, 24 Aug 2020 20:02:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OK2EJi010325; Mon, 24 Aug 2020 20:02:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OK2EDS010324; Mon, 24 Aug 2020 20:02:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008242002.07OK2EDS010324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Aug 2020 20:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364728 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:02:14 -0000 Author: imp Date: Mon Aug 24 20:02:13 2020 New Revision: 364728 URL: https://svnweb.freebsd.org/changeset/base/364728 Log: Fix silly typo... Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Mon Aug 24 19:49:22 2020 (r364727) +++ head/RELNOTES Mon Aug 24 20:02:13 2020 (r364728) @@ -12,7 +12,7 @@ Changes to this file should not be MFCed. r364725: Changes to one obscure devd event generated on resume need to - be documented. The old form will still be gerated in 13, but not + be documented. The old form will still be generated in 13, but not in 14. r363679: From owner-svn-src-head@freebsd.org Mon Aug 24 20:06:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B48B73CC488; Mon, 24 Aug 2020 20:06:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb3604J7rz4CZw; Mon, 24 Aug 2020 20:06:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:496b:2c59:e028:c140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7481A2D6D1; Mon, 24 Aug 2020 20:05:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364675 - head/sys/powerpc/powerpc To: Leandro Lupori , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008241340.07ODeaBG068401@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 24 Aug 2020 13:05:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202008241340.07ODeaBG068401@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:06:00 -0000 On 8/24/20 6:40 AM, Leandro Lupori wrote: > Author: luporl > Date: Mon Aug 24 13:40:35 2020 > New Revision: 364675 > URL: https://svnweb.freebsd.org/changeset/base/364675 > > Log: > [PowerPC] Make new auxv format default > > Assume ELF images without OSREL use the new auxv format. > > This is specially important for rtld, that is not tagged. Using > direct exec mode with new (ELFv2) binaries that expect the new auxv > format would result in crashes otherwise. > > Unfortunately, this may break direct exec'ing old binaries, > but it seems better to correctly support new binaries by default, > considering the transition to ELFv2 happened quite some time > ago. If needed, a sysctl may be added to allow old auxv format to > be used when OSREL is not found. BTW, rtld is now tagged in HEAD as of r363264 (a little over a month ago) -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 24 20:23:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 013C53CC895; Mon, 24 Aug 2020 20:23:36 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb3VH6BXMz4DJd; Mon, 24 Aug 2020 20:23:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B84E11DDFC; Mon, 24 Aug 2020 20:23:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OKNZo2023418; Mon, 24 Aug 2020 20:23:35 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OKNYGI023412; Mon, 24 Aug 2020 20:23:34 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008242023.07OKNYGI023412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 24 Aug 2020 20:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364730 - in head/sys: kern net net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: kern net net/route X-SVN-Commit-Revision: 364730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:23:36 -0000 Author: melifaro Date: Mon Aug 24 20:23:34 2020 New Revision: 364730 URL: https://svnweb.freebsd.org/changeset/base/364730 Log: Remove RT_LOCK mutex from rte. rtentry lock traditionally served 2 purposed: first was protecting refcounts, the second was assuring consistent field access/changes. Since route nexthop introduction, the need for the former disappeared and the need for the latter reduced. To be more precise, the following rte field are mutable: rt_nhop (nexthop pointer, updated with RIB_WLOCK, passed in rib_cmd_info) rte_flags (only RTF_HOST and RTF_UP, where RTF_UP gets changed at rte removal) rt_weight (relative weight, updated with RIB_WLOCK, passed in rib_cmd_info) rt_expire (time when rte deletion is scheduled, updated with RIB_WLOCK) rt_chain (deletion chain pointer, updated with RIB_WLOCK) All of them are updated under RIB_WLOCK, so the only remaining concern is the reading. rt_nhop and rt_weight (addressed in this review) are read under rib lock and stored in the rib_cmd_info, so the caller has no problem with consitency. rte_flags is currently read unlocked in rtsock reporting (however the scope is only RTF_UP flag, which is pretty static). rt_expire is currently read unlocked in rtsock reporting. rt_chain accesses are safe, as this is only used at route deletion. rt_expire and rte_flags reads will be dealt in a separate reviews soon. Differential Revision: https://reviews.freebsd.org/D26162 Modified: head/sys/kern/subr_witness.c head/sys/net/route.c head/sys/net/route/route_ctl.c head/sys/net/route/route_var.h head/sys/net/rtsock.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Aug 24 20:02:36 2020 (r364729) +++ head/sys/kern/subr_witness.c Mon Aug 24 20:23:34 2020 (r364730) @@ -531,7 +531,6 @@ static struct witness_order_list_entry order_lists[] = */ { "so_rcv", &lock_class_mtx_sleep }, { "radix node head", &lock_class_rm }, - { "rtentry", &lock_class_mtx_sleep }, { "ifaddr", &lock_class_mtx_sleep }, { NULL, NULL }, /* Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Aug 24 20:02:36 2020 (r364729) +++ head/sys/net/route.c Mon Aug 24 20:23:34 2020 (r364730) @@ -214,18 +214,19 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s /* Verify the allowed flag mask. */ KASSERT(((flags & ~(RTF_GATEWAY)) == 0), ("invalid redirect flags: %x", flags)); + flags |= RTF_HOST | RTF_DYNAMIC; /* Get the best ifa for the given interface and gateway. */ if ((ifa = ifaof_ifpforaddr(gateway, ifp)) == NULL) return (ENETUNREACH); ifa_ref(ifa); - + bzero(&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; info.rti_info[RTAX_GATEWAY] = gateway; info.rti_ifa = ifa; info.rti_ifp = ifp; - info.rti_flags = flags | RTF_HOST | RTF_DYNAMIC; + info.rti_flags = flags; /* Setup route metrics to define expire time. */ bzero(&rti_rmx, sizeof(rti_rmx)); @@ -242,10 +243,6 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s return (error); } - RT_LOCK(rc.rc_rt); - flags = rc.rc_rt->rte_flags; - RT_UNLOCK(rc.rc_rt); - RTSTAT_INC(rts_dynamic); /* Send notification of a route addition to userland. */ @@ -253,7 +250,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s info.rti_info[RTAX_DST] = dst; info.rti_info[RTAX_GATEWAY] = gateway; info.rti_info[RTAX_AUTHOR] = author; - rt_missmsg_fib(RTM_REDIRECT, &info, flags, error, fibnum); + rt_missmsg_fib(RTM_REDIRECT, &info, flags | RTF_UP, error, fibnum); return (0); } @@ -811,9 +808,7 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin */ if (rn) { rto = RNTORT(rn); - RT_LOCK(rto); rto->rte_flags |= RTF_UP; - RT_UNLOCK(rto); } else if (rt->rte_flags & RTF_GATEWAY) { /* * For gateway routes, we need to Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Mon Aug 24 20:02:36 2020 (r364729) +++ head/sys/net/route/route_ctl.c Mon Aug 24 20:23:34 2020 (r364730) @@ -149,9 +149,6 @@ rtfree(struct rtentry *rt) KASSERT(rt != NULL, ("%s: NULL rt", __func__)); - RT_LOCK_ASSERT(rt); - - RT_UNLOCK(rt); epoch_call(net_epoch_preempt, destroy_rtentry_epoch, &rt->rt_epoch_ctx); } @@ -250,7 +247,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in nhop_free(nh); return (ENOBUFS); } - RT_LOCK_INIT(rt); rt->rte_flags = RTF_UP | flags; rt->rt_nhop = nh; @@ -283,7 +279,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in rt_old = NULL; RIB_WLOCK(rnh); - RT_LOCK(rt); #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ if (rt_mpath_capable(rnh) && @@ -291,7 +286,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in RIB_WUNLOCK(rnh); nhop_free(nh); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return (EEXIST); } @@ -307,8 +301,9 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in /* Finalize notification */ rnh->rnh_gen++; - rc->rc_rt = RNTORT(rn); + rc->rc_rt = rt; rc->rc_nh_new = nh; + rc->rc_nh_weight = rt->rt_weight; rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); } else if ((info->rti_flags & RTF_PINNED) != 0) { @@ -333,14 +328,15 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in if (rn != NULL) { rc->rc_cmd = RTM_CHANGE; - rc->rc_rt = RNTORT(rn); + rc->rc_rt = rt; rc->rc_nh_old = rt_old->rt_nhop; rc->rc_nh_new = nh; + rc->rc_nh_weight = rt->rt_weight; } else { rc->rc_cmd = RTM_DELETE; - rc->rc_rt = RNTORT(rn); + rc->rc_rt = rt_old; rc->rc_nh_old = rt_old->rt_nhop; - rc->rc_nh_new = nh; + rc->rc_nh_weight = rt_old->rt_weight; } rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); } @@ -359,13 +355,10 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in */ if (rn == NULL) { nhop_free(nh); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return (EEXIST); } - RT_UNLOCK(rt); - return (0); } @@ -461,7 +454,6 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo panic ("rtrequest delete"); rt = RNTORT(rn); - RT_LOCK(rt); rt->rte_flags &= ~RTF_UP; *perror = 0; @@ -620,21 +612,19 @@ change_route_one(struct rib_head *rnh, struct rt_addri } /* Proceed with the update */ - RT_LOCK(rt); /* Provide notification to the protocols.*/ rt->rt_nhop = nh; rt_setmetrics(info, rt); /* Finalize notification */ + rnh->rnh_gen++; + rc->rc_rt = rt; rc->rc_nh_old = nh_orig; rc->rc_nh_new = rt->rt_nhop; + rc->rc_nh_weight = rt->rt_weight; - RT_UNLOCK(rt); - - /* Update generation id to reflect rtable change */ - rnh->rnh_gen++; rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); RIB_WUNLOCK(rnh); Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Mon Aug 24 20:02:36 2020 (r364729) +++ head/sys/net/route/route_var.h Mon Aug 24 20:23:34 2020 (r364730) @@ -168,22 +168,9 @@ struct rtentry { int rte_flags; /* up/down?, host/net */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ -#define rt_endzero rt_mtx - struct mtx rt_mtx; /* mutex for routing entry */ struct rtentry *rt_chain; /* pointer to next rtentry to delete */ struct epoch_context rt_epoch_ctx; /* net epoch tracker */ }; - -#define RT_LOCK_INIT(_rt) \ - mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW) -#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) -#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) -#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) -#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) -#define RT_UNLOCK_COND(_rt) do { \ - if (mtx_owned(&(_rt)->rt_mtx)) \ - mtx_unlock(&(_rt)->rt_mtx); \ -} while (0) /* * With the split between the routing entry and the nexthop, Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Mon Aug 24 20:02:36 2020 (r364729) +++ head/sys/net/rtsock.c Mon Aug 24 20:23:34 2020 (r364730) @@ -184,9 +184,9 @@ static void rt_getmetrics(const struct rtentry *rt, static void rt_dispatch(struct mbuf *, sa_family_t); static int handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, struct rt_msghdr *rtm, struct rib_cmd_info *rc); -static int update_rtm_from_rte(struct rt_addrinfo *info, +static int update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, int alloc_len, - struct rtentry *rt, struct nhop_object *nh); + struct rib_cmd_info *rc, struct nhop_object *nh); static void send_rtm_reply(struct socket *so, struct rt_msghdr *rtm, struct mbuf *m, sa_family_t saf, u_int fibnum, int rtm_errno); @@ -747,7 +747,7 @@ handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, } /* - * Update sockaddrs, flags, etc in @prtm based on @rt data. + * Update sockaddrs, flags, etc in @prtm based on @rc data. * rtm can be reallocated. * * Returns 0 on success, along with pointer to (potentially reallocated) @@ -755,8 +755,8 @@ handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, * */ static int -update_rtm_from_rte(struct rt_addrinfo *info, struct rt_msghdr **prtm, - int alloc_len, struct rtentry *rt, struct nhop_object *nh) +update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, + int alloc_len, struct rib_cmd_info *rc, struct nhop_object *nh) { struct sockaddr_storage netmask_ss; struct walkarg w; @@ -767,10 +767,10 @@ update_rtm_from_rte(struct rt_addrinfo *info, struct r rtm = *prtm; - info->rti_info[RTAX_DST] = rt_key(rt); + info->rti_info[RTAX_DST] = rt_key(rc->rc_rt); info->rti_info[RTAX_GATEWAY] = &nh->gw_sa; - info->rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt), - rt_mask(rt), &netmask_ss); + info->rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rc->rc_rt), + rt_mask(rc->rc_rt), &netmask_ss); info->rti_info[RTAX_GENMASK] = 0; ifp = nh->nh_ifp; if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { @@ -815,12 +815,12 @@ update_rtm_from_rte(struct rt_addrinfo *info, struct r w.w_tmemsize = alloc_len; rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); - if (rt->rte_flags & RTF_GWFLAG_COMPAT) + rtm->rtm_flags = rc->rc_rt->rte_flags | nhop_get_rtflags(nh); + if (rtm->rtm_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | - (rt->rte_flags & ~RTF_GWFLAG_COMPAT); - else - rtm->rtm_flags = rt->rte_flags; - rt_getmetrics(rt, nh, &rtm->rtm_rmx); + (rtm->rtm_flags & ~RTF_GWFLAG_COMPAT); + rt_getmetrics(rc->rc_rt, nh, &rtm->rtm_rmx); + rtm->rtm_rmx.rmx_weight = rc->rc_nh_weight; rtm->rtm_addrs = info->rti_addrs; if (orig_rtm != NULL) @@ -918,8 +918,8 @@ route_output(struct mbuf *m, struct socket *so, ...) #ifdef INET6 rti_need_deembed = 1; #endif - rtm->rtm_index = rc.rc_nh_new->nh_ifp->if_index; nh = rc.rc_nh_new; + rtm->rtm_index = nh->nh_ifp->if_index; } break; @@ -946,7 +946,7 @@ report: senderr(ESRCH); } - error = update_rtm_from_rte(&info, &rtm, alloc_len, rc.rc_rt, nh); + error = update_rtm_from_rc(&info, &rtm, alloc_len, &rc, nh); /* * Note that some sockaddr pointers may have changed to * point to memory outsize @rtm. Some may be pointing From owner-svn-src-head@freebsd.org Mon Aug 24 20:28:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4940C3CC8BE; Mon, 24 Aug 2020 20:28:22 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb3bp19qZz4DgR; Mon, 24 Aug 2020 20:28:22 +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 0BACB1E488; Mon, 24 Aug 2020 20:28:22 +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 07OKSLgL023680; Mon, 24 Aug 2020 20:28:21 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OKSLDL023679; Mon, 24 Aug 2020 20:28:21 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008242028.07OKSLDL023679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 24 Aug 2020 20:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364731 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 364731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:28:22 -0000 Author: vmaffione Date: Mon Aug 24 20:28:21 2020 New Revision: 364731 URL: https://svnweb.freebsd.org/changeset/base/364731 Log: netmap: use FreeBSD guards for epoch calls EPOCH calls are FreeBSD specific. Use guards to protect these, so that the code can compile under Linux. MFC after: 1 week Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Aug 24 20:23:34 2020 (r364730) +++ head/sys/dev/netmap/netmap.c Mon Aug 24 20:28:21 2020 (r364731) @@ -1149,11 +1149,13 @@ netmap_dtor(void *data) static void netmap_send_up(struct ifnet *dst, struct mbq *q) { - struct epoch_tracker et; struct mbuf *m; struct mbuf *head = NULL, *prev = NULL; +#ifdef __FreeBSD__ + struct epoch_tracker et; NET_EPOCH_ENTER(et); +#endif /* __FreeBSD__ */ /* Send packets up, outside the lock; head/prev machinery * is only useful for Windows. */ while ((m = mbq_dequeue(q)) != NULL) { @@ -1165,7 +1167,9 @@ netmap_send_up(struct ifnet *dst, struct mbq *q) } if (head) nm_os_send_up(dst, NULL, head); +#ifdef __FreeBSD__ NET_EPOCH_EXIT(et); +#endif /* __FreeBSD__ */ mbq_fini(q); } From owner-svn-src-head@freebsd.org Mon Aug 24 20:37:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9E3C3CCDCB; Mon, 24 Aug 2020 20:37:19 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb3p74KRTz4FD4; Mon, 24 Aug 2020 20:37:19 +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 78B7B1E59A; Mon, 24 Aug 2020 20:37:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OKbJV4030030; Mon, 24 Aug 2020 20:37:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OKbIYw030024; Mon, 24 Aug 2020 20:37:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008242037.07OKbIYw030024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 24 Aug 2020 20:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364732 - head/contrib/llvm-project/openmp/runtime/src X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 364732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:37:19 -0000 Author: dim Date: Mon Aug 24 20:37:18 2020 New Revision: 364732 URL: https://svnweb.freebsd.org/changeset/base/364732 Log: Merge commit cde8f4c16 from llvm git (by me): Move special va_list handling to kmp_os.h Instead of copying and pasting the same #ifdef expressions in multiple places, define a type and a pair of macros in kmp_os.h, to handle whether va_list is pointer-like or not: * kmp_va_list is the type to use for __kmp_fork_call() * kmp_va_deref() dereferences a va_list, if necessary * kmp_va_addr_of() takes the address of a va_list, if necessary Also add FreeBSD to the list of OSes that has a non pointer-like va_list. This can now be easily extended to other OSes too. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D86397 This should enable building of LLVM's OpenMP on AArch64. Addition to share/mk will follow in a subsequent commit. PR: 248864 MFC after: 2 weeks Modified: head/contrib/llvm-project/openmp/runtime/src/kmp.h head/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp head/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp head/contrib/llvm-project/openmp/runtime/src/kmp_os.h head/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Modified: head/contrib/llvm-project/openmp/runtime/src/kmp.h ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Aug 24 20:28:21 2020 (r364731) +++ head/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Aug 24 20:37:18 2020 (r364732) @@ -3459,13 +3459,7 @@ enum fork_context_e { extern int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ); + kmp_va_list ap); extern void __kmp_join_call(ident_t *loc, int gtid #if OMPT_SUPPORT Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Aug 24 20:28:21 2020 (r364731) +++ head/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Aug 24 20:37:18 2020 (r364732) @@ -308,13 +308,7 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, km __kmp_fork_call(loc, gtid, fork_context_intel, argc, VOLATILE_CAST(microtask_t) microtask, // "wrapped" task VOLATILE_CAST(launch_t) __kmp_invoke_task_func, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + kmp_va_addr_of(ap)); #if INCLUDE_SSC_MARKS SSC_MARK_JOINING(); #endif @@ -408,16 +402,10 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, k KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nteams >= 1); KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nth >= 1); - __kmp_fork_call(loc, gtid, fork_context_intel, argc, - VOLATILE_CAST(microtask_t) - __kmp_teams_master, // "wrapped" task - VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_fork_call( + loc, gtid, fork_context_intel, argc, + VOLATILE_CAST(microtask_t) __kmp_teams_master, // "wrapped" task + VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, kmp_va_addr_of(ap)); __kmp_join_call(loc, gtid #if OMPT_SUPPORT , Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Aug 24 20:28:21 2020 (r364731) +++ head/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Aug 24 20:37:18 2020 (r364732) @@ -376,13 +376,7 @@ static va_start(ap, argc); rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, - __kmp_invoke_task_func, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_invoke_task_func, kmp_va_addr_of(ap)); va_end(ap); Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Aug 24 20:28:21 2020 (r364731) +++ head/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Aug 24 20:37:18 2020 (r364732) @@ -200,6 +200,18 @@ typedef kmp_uint32 kmp_uint; #define KMP_INT_MAX ((kmp_int32)0x7FFFFFFF) #define KMP_INT_MIN ((kmp_int32)0x80000000) +// stdarg handling +#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) +typedef va_list *kmp_va_list; +#define kmp_va_deref(ap) (*(ap)) +#define kmp_va_addr_of(ap) (&(ap)) +#else +typedef va_list kmp_va_list; +#define kmp_va_deref(ap) (ap) +#define kmp_va_addr_of(ap) (ap) +#endif + #ifdef __cplusplus // macros to cast out qualifiers and to re-interpret types #define CCAST(type, var) const_cast(var) Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Aug 24 20:28:21 2020 (r364731) +++ head/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Aug 24 20:37:18 2020 (r364732) @@ -1389,13 +1389,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context, // Intel, GNU, ... kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ) { + kmp_va_list ap) { void **argv; int i; int master_tid; @@ -1505,12 +1499,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, parent_team->t.t_argc = argc; argv = (void **)parent_team->t.t_argv; for (i = argc - 1; i >= 0; --i) -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); // Increment our nested depth levels, but not increase the serialization if (parent_team == master_th->th.th_serial_team) { // AC: we are in serialized parallel @@ -1804,12 +1793,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); } else { for (i = 0; i < argc; ++i) // Get args from parent team for teams construct @@ -1840,12 +1824,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, } else { argv = args; for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); KMP_MB(); #if OMPT_SUPPORT @@ -2130,12 +2109,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) { -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - void *new_argv = va_arg(*ap, void *); -#else - void *new_argv = va_arg(ap, void *); -#endif + void *new_argv = va_arg(kmp_va_deref(ap), void *); KMP_CHECK_UPDATE(*argv, new_argv); argv++; } From owner-svn-src-head@freebsd.org Mon Aug 24 20:40:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77BC53CCEFA; Mon, 24 Aug 2020 20:40:27 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb3sl2dNWz4FX1; Mon, 24 Aug 2020 20:40:27 +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 3A2271E1DE; Mon, 24 Aug 2020 20:40:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OKeQxj030264; Mon, 24 Aug 2020 20:40:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OKeQ8q030263; Mon, 24 Aug 2020 20:40:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008242040.07OKeQ8q030263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 24 Aug 2020 20:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364733 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 364733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 20:40:27 -0000 Author: dim Date: Mon Aug 24 20:40:26 2020 New Revision: 364733 URL: https://svnweb.freebsd.org/changeset/base/364733 Log: After r364732, we can now enable MK_OPENMP for aarch64 by default. PR: 248864 MFC after: 2 weeks Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Aug 24 20:37:18 2020 (r364732) +++ head/share/mk/src.opts.mk Mon Aug 24 20:40:26 2020 (r364733) @@ -359,7 +359,8 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64" __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP From owner-svn-src-head@freebsd.org Mon Aug 24 22:12:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17BBF3CEE95; Mon, 24 Aug 2020 22:12:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb5wF6hDjz4LVf; Mon, 24 Aug 2020 22:12:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C935A1F850; Mon, 24 Aug 2020 22:12:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OMCjqn091706; Mon, 24 Aug 2020 22:12:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OMCjXH091705; Mon, 24 Aug 2020 22:12:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008242212.07OMCjXH091705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Aug 2020 22:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364734 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 364734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 22:12:46 -0000 Author: kib Date: Mon Aug 24 22:12:45 2020 New Revision: 364734 URL: https://svnweb.freebsd.org/changeset/base/364734 Log: Restore workaround for sysret fault on non-canonical address after LA57. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Aug 24 20:40:26 2020 (r364733) +++ head/sys/amd64/amd64/trap.c Mon Aug 24 22:12:45 2020 (r364734) @@ -1189,7 +1189,8 @@ amd64_syscall(struct thread *td, int traced) * not be safe. Instead, use the full return path which * catches the problem safely. */ - if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) + if (__predict_false(td->td_frame->tf_rip >= (la57 ? + VM_MAXUSER_ADDRESS_LA57 : VM_MAXUSER_ADDRESS_LA48))) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); amd64_syscall_ret_flush_l1d_check_inline(td->td_errno); From owner-svn-src-head@freebsd.org Mon Aug 24 22:53:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B119A3B02EC; Mon, 24 Aug 2020 22:53:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb6q74644z4P8H; Mon, 24 Aug 2020 22:53:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7115C1FF18; Mon, 24 Aug 2020 22:53:23 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07OMrNOw016613; Mon, 24 Aug 2020 22:53:23 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07OMrNO2016612; Mon, 24 Aug 2020 22:53:23 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202008242253.07OMrNO2016612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 24 Aug 2020 22:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364737 - head/sys/dev/drm2 X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/dev/drm2 X-SVN-Commit-Revision: 364737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 22:53:23 -0000 Author: zeising (doc,ports committer) Date: Mon Aug 24 22:53:23 2020 New Revision: 364737 URL: https://svnweb.freebsd.org/changeset/base/364737 Log: drm2: Update deprecation message Update the deprecation message in the drm2 (aka legacy drm) drivers to point towards the graphics/drm-kmod ports for all architectures, not just amd64. drm-kmod has support for more architectures these days, and the graphics/drm-legacy-kmod port is being deprecated. Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26174 Modified: head/sys/dev/drm2/drm_os_freebsd.h Modified: head/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- head/sys/dev/drm2/drm_os_freebsd.h Mon Aug 24 22:48:19 2020 (r364736) +++ head/sys/dev/drm2/drm_os_freebsd.h Mon Aug 24 22:53:23 2020 (r364737) @@ -154,16 +154,12 @@ typedef void irqreturn_t; *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) + \ (vm_offset_t)(offset)) = htole64(val) -#ifdef amd64 #define DRM_PORT "graphics/drm-kmod" -#else -#define DRM_PORT "graphics/drm-legacy-kmod" -#endif #define DRM_OBSOLETE(dev) \ do { \ device_printf(dev, "=======================================================\n"); \ - device_printf(dev, "This code is obsolete abandonware. Install the " DRM_PORT " pkg\n"); \ + device_printf(dev, "This code is deprecated. Install the " DRM_PORT " pkg\n"); \ device_printf(dev, "=======================================================\n"); \ gone_in_dev(dev, 13, "drm2 drivers"); \ } while (0) From owner-svn-src-head@freebsd.org Mon Aug 24 23:31:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EAD73B0D90; Mon, 24 Aug 2020 23:31:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb7g333Tjz4Qgw; Mon, 24 Aug 2020 23:31:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 324AA201ED; Mon, 24 Aug 2020 23:31:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07ONVRqK037235; Mon, 24 Aug 2020 23:31:27 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07ONVRt7037234; Mon, 24 Aug 2020 23:31:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008242331.07ONVRt7037234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 24 Aug 2020 23:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364740 - head/sys/contrib/openzfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/contrib/openzfs X-SVN-Commit-Revision: 364740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 23:31:27 -0000 Author: mmacy Date: Mon Aug 24 23:31:26 2020 New Revision: 364740 URL: https://svnweb.freebsd.org/changeset/base/364740 Log: Initial import from vendor-sys branch of openzfs Added: head/sys/contrib/openzfs/ - copied from r364739, vendor-sys/openzfs/dist/ From owner-svn-src-head@freebsd.org Tue Aug 25 00:58:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1BC73B2681; Tue, 25 Aug 2020 00:58:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bb9bB5Nb7z4VpQ; Tue, 25 Aug 2020 00:58:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95EFD214D5; Tue, 25 Aug 2020 00:58:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P0wEhN091740; Tue, 25 Aug 2020 00:58:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P0wEFU091739; Tue, 25 Aug 2020 00:58:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202008250058.07P0wEFU091739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 25 Aug 2020 00:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364744 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 00:58:15 -0000 Author: rmacklem Date: Tue Aug 25 00:58:14 2020 New Revision: 364744 URL: https://svnweb.freebsd.org/changeset/base/364744 Log: Fix hangs with processes stuck sleeping on btalloc on i386. r358097 introduced a problem for i386, where kernel builds will intermittently get hung, typically with many processes sleeping on "btalloc". I know nothing about VM, but received assistance from rlibby@ and markj@. rlibby@ stated the following: It looks like the problem is that for systems that do not have UMA_MD_SMALL_ALLOC, we do uma_zone_set_allocf(vmem_bt_zone, vmem_bt_alloc); but we haven't set an appropriate free function. This is probably why UMA_ZONE_NOFREE was originally there. When NOFREE was removed, it was appropriate for systems with uma_small_alloc. So by default we get page_free as our free function. That calls kmem_free, which calls vmem_free ... but we do our allocs with vmem_xalloc. I'm not positive, but I think the problem is that in effect we vmem_xalloc -> vmem_free, not vmem_xfree. Three possible fixes: 1: The one you tested, but this is not best for systems with uma_small_alloc. 2: Pass UMA_ZONE_NOFREE conditional on UMA_MD_SMALL_ALLOC. 3: Actually provide an appropriate vmem_bt_free function. I think we should just do option 2 with a comment, it's simple and it's what we used to do. I'm not sure how much benefit we would see from option 3, but it's more work. This patch implements #2. I haven't done a comment, since I don't know what the problem is. markj@ noted the following: I think the suggested patch is ok, but not for the reason stated. On platforms without a direct map the problem is: to allocate btags we need a slab, and to allocate a slab we need to map a page, and to map a page we need to allocate btags. We handle this recursion using a custom slab allocator which specifies M_USE_RESERVE, allowing it to dip into a reserve of free btags. Because the returned slab can be used to keep the reserve populated, this ensures that there are always enough free btags available to handle the recursion. UMA_ZONE_NOFREE ensures that we never reclaim free slabs from the zone. However, when it was removed, an apparent bug in UMA was exposed: keg_drain() ignores the reservation set by uma_zone_reserve() in vmem_startup(). So under memory pressure we reclaim the free btags that are needed to break the recursion. That's why adding _NOFREE back fixes the problem: it disables the reclamation. We could perhaps fix it more cleverly, by modifying keg_drain() to always leave uk_reserve slabs available. markj@'s initial patch failed testing, so committing this patch was agreed upon as the interim solution. Either rlibby@ or markj@ might choose to add a comment to it. PR: 248008 Reviewed by: rlibby, markj Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Aug 25 00:49:57 2020 (r364743) +++ head/sys/kern/subr_vmem.c Tue Aug 25 00:58:14 2020 (r364744) @@ -668,10 +668,14 @@ vmem_startup(void) vmem_zone = uma_zcreate("vmem", sizeof(struct vmem), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +#ifdef UMA_MD_SMALL_ALLOC vmem_bt_zone = uma_zcreate("vmem btag", sizeof(struct vmem_btag), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); -#ifndef UMA_MD_SMALL_ALLOC +#else + vmem_bt_zone = uma_zcreate("vmem btag", + sizeof(struct vmem_btag), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); mtx_init(&vmem_bt_lock, "btag lock", NULL, MTX_DEF); uma_prealloc(vmem_bt_zone, BT_MAXALLOC); /* From owner-svn-src-head@freebsd.org Tue Aug 25 02:21:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B57483B5D9A; Tue, 25 Aug 2020 02:21:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbCRJ4Yvjz4bsx; Tue, 25 Aug 2020 02:21:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65A87226A2; Tue, 25 Aug 2020 02:21:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P2LW54044861; Tue, 25 Aug 2020 02:21:32 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P2LRST044836; Tue, 25 Aug 2020 02:21:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008250221.07P2LRST044836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 02:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364746 - in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opens... X-SVN-Commit-Revision: 364746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 02:21:32 -0000 Author: mmacy Date: Tue Aug 25 02:21:27 2020 New Revision: 364746 URL: https://svnweb.freebsd.org/changeset/base/364746 Log: Merge OpenZFS support in to HEAD. The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Added: head/cddl/lib/libicp/ head/cddl/lib/libicp/Makefile (contents, props changed) head/cddl/lib/libicp_rescue/ head/cddl/lib/libicp_rescue/Makefile (contents, props changed) head/cddl/lib/libspl/ head/cddl/lib/libspl/Makefile (contents, props changed) head/cddl/lib/libtpool/ head/cddl/lib/libtpool/Makefile (contents, props changed) head/cddl/lib/libzutil/ head/cddl/lib/libzutil/Makefile (contents, props changed) head/cddl/usr.bin/zstream/ head/cddl/usr.bin/zstream/Makefile (contents, props changed) head/sys/modules/zfs/static_ccompile.h (contents, props changed) head/sys/modules/zfs/zfs_config.h (contents, props changed) head/sys/modules/zfs/zfs_gitrev.h (contents, props changed) Deleted: head/cddl/compat/opensolaris/include/mnttab.h head/cddl/contrib/opensolaris/cmd/zdb/ head/cddl/contrib/opensolaris/cmd/zfs/ head/cddl/contrib/opensolaris/cmd/zhack/ head/cddl/contrib/opensolaris/cmd/zinject/ head/cddl/contrib/opensolaris/cmd/zlook/ head/cddl/contrib/opensolaris/cmd/zpool/ head/cddl/contrib/opensolaris/cmd/zstreamdump/ head/cddl/contrib/opensolaris/cmd/ztest/ head/cddl/contrib/opensolaris/lib/libnvpair/ head/cddl/contrib/opensolaris/lib/libuutil/ head/cddl/contrib/opensolaris/lib/libzfs/ head/cddl/contrib/opensolaris/lib/libzfs_core/ head/cddl/contrib/opensolaris/lib/libzpool/ head/cddl/usr.bin/zlook/ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c head/sys/cddl/compat/opensolaris/sys/acl.h head/sys/cddl/compat/opensolaris/sys/file.h head/sys/cddl/compat/opensolaris/sys/kobj.h head/sys/cddl/compat/opensolaris/sys/lock.h head/sys/cddl/compat/opensolaris/sys/mman.h head/sys/cddl/compat/opensolaris/sys/mount.h head/sys/cddl/compat/opensolaris/sys/mutex.h head/sys/cddl/compat/opensolaris/sys/nvpair.h head/sys/cddl/compat/opensolaris/sys/param.h head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/cddl/compat/opensolaris/sys/stat.h head/sys/cddl/compat/opensolaris/sys/systm.h head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/compat/opensolaris/sys/types.h head/sys/cddl/compat/opensolaris/sys/uio.h head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/cddl/contrib/opensolaris/common/acl/ head/sys/cddl/contrib/opensolaris/common/atomic/ head/sys/cddl/contrib/opensolaris/common/avl/ head/sys/cddl/contrib/opensolaris/common/nvpair/ head/sys/cddl/contrib/opensolaris/common/zfs/ head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ head/sys/cddl/contrib/opensolaris/uts/common/os/callb.c head/sys/cddl/contrib/opensolaris/uts/common/os/fm.c head/sys/cddl/contrib/opensolaris/uts/common/os/nvpair_alloc_system.c head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fm/ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/ head/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h head/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair_impl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Modified: head/Makefile.inc1 head/cddl/compat/opensolaris/include/fcntl.h head/cddl/contrib/opensolaris/cmd/lockstat/sym.c head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c head/cddl/lib/Makefile head/cddl/lib/drti/Makefile head/cddl/lib/libavl/Makefile head/cddl/lib/libctf/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/lib/libnvpair/Makefile head/cddl/lib/libuutil/Makefile head/cddl/lib/libzfs/Makefile head/cddl/lib/libzfs_core/Makefile head/cddl/lib/libzpool/Makefile head/cddl/lib/libzpool/Makefile.depend head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile head/cddl/usr.bin/Makefile head/cddl/usr.bin/ctfconvert/Makefile head/cddl/usr.bin/ctfconvert/Makefile.depend head/cddl/usr.bin/ctfdump/Makefile head/cddl/usr.bin/ctfmerge/Makefile head/cddl/usr.bin/zinject/Makefile head/cddl/usr.bin/zstreamdump/Makefile head/cddl/usr.bin/ztest/Makefile head/cddl/usr.sbin/dtrace/Makefile head/cddl/usr.sbin/lockstat/Makefile head/cddl/usr.sbin/plockstat/Makefile head/cddl/usr.sbin/zdb/Makefile head/cddl/usr.sbin/zfsd/Makefile.common head/cddl/usr.sbin/zfsd/callout.cc head/cddl/usr.sbin/zfsd/case_file.cc head/cddl/usr.sbin/zfsd/tests/zfsd_unittest.cc head/cddl/usr.sbin/zfsd/vdev.cc head/cddl/usr.sbin/zfsd/vdev_iterator.cc head/cddl/usr.sbin/zfsd/zfsd.cc head/cddl/usr.sbin/zfsd/zfsd_event.cc head/cddl/usr.sbin/zfsd/zfsd_exception.cc head/cddl/usr.sbin/zfsd/zpool_list.cc head/cddl/usr.sbin/zhack/Makefile head/include/Makefile head/lib/libbe/Makefile head/lib/libbe/be.c head/lib/libbe/tests/Makefile head/lib/libproc/Makefile head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_sym.c head/lib/libprocstat/libprocstat.c head/lib/libprocstat/zfs/Makefile head/lib/libprocstat/zfs_defs.c head/libexec/rc/rc.d/zfs head/rescue/rescue/Makefile head/sbin/bectl/Makefile head/sbin/bectl/Makefile.depend head/sbin/bectl/bectl.c head/sbin/zfsbootcfg/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/sys/cddl/compat/opensolaris/kern/opensolaris.c head/sys/cddl/compat/opensolaris/sys/misc.h head/sys/cddl/compat/opensolaris/sys/modctl.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/ccompile.h head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/fbt/fbt.c head/sys/cddl/dev/profile/profile.c head/sys/cddl/dev/sdt/sdt.c head/sys/cddl/dev/systrace/systrace.c head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/sys/modules/dtrace/dtaudit/Makefile head/sys/modules/dtrace/dtmalloc/Makefile head/sys/modules/dtrace/dtnfscl/Makefile head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/dtrace/fbt/Makefile head/sys/modules/dtrace/profile/Makefile head/sys/modules/dtrace/prototype/Makefile head/sys/modules/dtrace/sdt/Makefile head/sys/modules/dtrace/systrace/Makefile head/sys/modules/dtrace/systrace_freebsd32/Makefile head/sys/modules/dtrace/systrace_linux/Makefile head/sys/modules/dtrace/systrace_linux32/Makefile head/sys/modules/opensolaris/Makefile head/sys/modules/zfs/Makefile head/sys/vm/vm.h head/tests/sys/cddl/zfs/bin/file_write.c head/tools/boot/rootgen.sh head/usr.sbin/fstyp/Makefile head/usr.sbin/fstyp/zfs.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 25 02:14:36 2020 (r364745) +++ head/Makefile.inc1 Tue Aug 25 02:21:27 2020 (r364746) @@ -2442,7 +2442,7 @@ _btxld= usr.sbin/btxld # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures # resulting from missing bug fixes or ELF Toolchain updates. .if ${MK_CDDL} != "no" -_dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert \ +_dtrace_tools= cddl/lib/libctf cddl/lib/libspl cddl/usr.bin/ctfconvert \ cddl/usr.bin/ctfmerge .endif @@ -2756,7 +2756,12 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ ${_cddl_lib_libuutil} \ ${_cddl_lib_libavl} \ + ${_cddl_lib_libicp} \ + ${_cddl_lib_libicp_rescue} \ + ${_cddl_lib_libspl} \ + ${_cddl_lib_libtpool} \ ${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \ + ${_cddl_lib_libzutil} \ ${_cddl_lib_libctf} \ lib/libufs \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ @@ -2826,21 +2831,34 @@ _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil +_cddl_lib_libspl= cddl/lib/libspl + +cddl/lib/libuutil__L: cddl/lib/libavl__L cddl/lib/libspl__L + .if ${MK_ZFS} != "no" +_cddl_lib_libicp= cddl/lib/libicp +_cddl_lib_libicp_rescue= cddl/lib/libicp_rescue +_cddl_lib_libtpool= cddl/lib/libtpool +_cddl_lib_libzutil= cddl/lib/libzutil _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib_libzfs= cddl/lib/libzfs +cddl/lib/libtpool__L: cddl/lib/libspl__L + +cddl/lib/libzutil__L: cddl/lib/libavl__L cddl/lib/libtpool__L + cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__L lib/libutil__L cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L +cddl/lib/libzfs__L: cddl/lib/libnvpair__L cddl/lib/libzutil__L lib/libbe__L: cddl/lib/libzfs__L .endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib -cddl/lib/libctf__L: lib/libz__L +cddl/lib/libctf__L: lib/libz__L cddl/lib/libspl__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db _prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db Modified: head/cddl/compat/opensolaris/include/fcntl.h ============================================================================== --- head/cddl/compat/opensolaris/include/fcntl.h Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/compat/opensolaris/include/fcntl.h Tue Aug 25 02:21:27 2020 (r364746) @@ -32,7 +32,9 @@ #include_next +#ifndef open64 #define open64(...) open(__VA_ARGS__) +#endif #define openat64(...) openat(__VA_ARGS__) #endif Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 25 02:21:27 2020 (r364746) @@ -54,6 +54,7 @@ #endif #include + typedef struct syment { uintptr_t addr; char *name; @@ -71,6 +72,11 @@ static char maxsymname[64]; #define elf_getshdr elf32_getshdr #endif #endif + +#define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x +__sElfN(Sym); +__sElfN(Shdr); +#define elf_getshdr __elfN(getshdr) static void add_symbol(char *name, uintptr_t addr, size_t size) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue Aug 25 02:21:27 2020 (r364746) @@ -24,6 +24,7 @@ * Use is subject to license terms. */ +#include #include #include #include Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Aug 25 02:21:27 2020 (r364746) @@ -31,6 +31,7 @@ #include #include +#include #include #include #include Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Tue Aug 25 02:21:27 2020 (r364746) @@ -77,7 +77,6 @@ #include #include #include -#include #include #include Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Aug 25 02:21:27 2020 (r364746) @@ -44,11 +44,18 @@ #include #include #include -#include - +#include #include #include #include + +#ifndef NS_IN6ADDRSZ +#define NS_IN6ADDRSZ 16 +#endif + +#ifndef NS_INADDRSZ +#define NS_INADDRSZ 4 +#endif /*ARGSUSED*/ static int Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Tue Aug 25 02:21:27 2020 (r364746) @@ -29,6 +29,7 @@ * Utility functions */ +#include #include #include #include Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -6,27 +6,40 @@ SUBDIR= drti \ libavl \ libctf \ libdtrace \ + ${_libicp} \ + ${_libicp_rescue} \ libnvpair \ + libspl \ + ${_libtpool} \ libumem \ libuutil \ ${_libzfs_core} \ ${_libzfs} \ ${_libzpool} \ + ${_libzutil} SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _libzfs_core= libzfs_core +_libicp= libicp +_libicp_rescue= libicp_rescue _libzfs= libzfs +_libzutil= libzutil .if ${MK_LIBTHR} != "no" _libzpool= libzpool +_libtpool= libtpool .endif .endif +SUBDIR_DEPEND_libctf= libspl SUBDIR_DEPEND_libdtrace= libctf +SUBDIR_DEPEND_libtpool= libspl +SUBDIR_DEPEND_libuutil= libavl libspl SUBDIR_DEPEND_libzfs_core= libnvpair -SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core -SUBDIR_DEPEND_libzpool= libavl libnvpair libumem +SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core libzutil +SUBDIR_DEPEND_libzpool= libavl libnvpair libumem libicp +SUBDIR_DEPEND_libzutil= libavl libtpool SUBDIR_PARALLEL= Modified: head/cddl/lib/drti/Makefile ============================================================================== --- head/cddl/lib/drti/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/drti/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -11,7 +11,14 @@ FILESDIR= ${LIBDIR}/dtrace CLEANFILES= ${FILES} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY - +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: head/cddl/lib/libavl/Makefile ============================================================================== --- head/cddl/lib/libavl/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libavl/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,12 +1,15 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/avl PACKAGE= runtime LIB= avl SRCS= avl.c WARNS?= 3 -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common - +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h .include Modified: head/cddl/lib/libctf/Makefile ============================================================================== --- head/cddl/lib/libctf/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libctf/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -21,6 +21,14 @@ MAN= ctf.5 WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID + CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ @@ -28,6 +36,6 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common -LIBADD+= z +LIBADD+= spl z .include Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libdtrace/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -66,6 +66,16 @@ FILESMODE= ${NOBINMODE} WARNS?= 1 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID + + CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ -I${SRCTOP}/sys/cddl/compat/opensolaris \ Added: head/cddl/lib/libicp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libicp/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -0,0 +1,101 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp + +PACKAGE= runtime +LIB= icp +LIBADD= + + +.if ${MACHINE_ARCH} == "amd64" +ASM_SOURCES_C = asm-x86_64/aes/aeskey.c +ASM_SOURCES_AS = \ + asm-x86_64/aes/aes_amd64.S \ + asm-x86_64/aes/aes_aesni.S \ + asm-x86_64/modes/gcm_pclmulqdq.S \ + asm-x86_64/modes/aesni-gcm-x86_64.S \ + asm-x86_64/modes/ghash-x86_64.S \ + asm-x86_64/sha1/sha1-x86_64.S \ + asm-x86_64/sha2/sha256_impl.S \ + asm-x86_64/sha2/sha512_impl.S + +CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES +.else +ASM_SOURCES_C = +ASM_SOURCES_AS = +.endif + + +KERNEL_C = \ + spi/kcf_spi.c \ + api/kcf_ctxops.c \ + api/kcf_digest.c \ + api/kcf_cipher.c \ + api/kcf_miscapi.c \ + api/kcf_mac.c \ + algs/aes/aes_impl_aesni.c \ + algs/aes/aes_impl_generic.c \ + algs/aes/aes_impl_x86-64.c \ + algs/aes/aes_impl.c \ + algs/aes/aes_modes.c \ + algs/edonr/edonr.c \ + algs/modes/modes.c \ + algs/modes/cbc.c \ + algs/modes/gcm_generic.c \ + algs/modes/gcm_pclmulqdq.c \ + algs/modes/gcm.c \ + algs/modes/ctr.c \ + algs/modes/ccm.c \ + algs/modes/ecb.c \ + algs/sha1/sha1.c \ + algs/sha2/sha2.c \ + algs/skein/skein.c \ + algs/skein/skein_block.c \ + algs/skein/skein_iv.c \ + illumos-crypto.c \ + io/aes.c \ + io/edonr_mod.c \ + io/sha1_mod.c \ + io/sha2_mod.c \ + io/skein_mod.c \ + os/modhash.c \ + os/modconf.c \ + core/kcf_sched.c \ + core/kcf_prov_lib.c \ + core/kcf_callprov.c \ + core/kcf_mech_tabs.c \ + core/kcf_prov_tabs.c \ + $(ASM_SOURCES_C) + + + + + + +SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) + +WARNS?= 2 +SHLIB_MAJOR= 3 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + + +CFLAGS.aes_amd64.S+= -DLOCORE +CFLAGS.aes_aesni.S+= -DLOCORE +CFLAGS.gcm_pclmulqdq.S+= -DLOCORE +CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE +CFLAGS.ghash-x86_64.S+= -DLOCORE +CFLAGS.sha1-x86_64.S+= -DLOCORE +CFLAGS.sha256_impl.S+= -DLOCORE +CFLAGS.sha512_impl.S+= -DLOCORE + +.include Added: head/cddl/lib/libicp_rescue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libicp_rescue/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -0,0 +1,99 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp + +PACKAGE= runtime +LIB= icp_rescue +LIBADD= + + +.if ${MACHINE_ARCH} == "amd64" +ASM_SOURCES_C = asm-x86_64/aes/aeskey.c +ASM_SOURCES_AS = \ + asm-x86_64/aes/aes_amd64.S \ + asm-x86_64/aes/aes_aesni.S \ + asm-x86_64/modes/gcm_pclmulqdq.S \ + asm-x86_64/modes/aesni-gcm-x86_64.S \ + asm-x86_64/sha1/sha1-x86_64.S \ + asm-x86_64/sha2/sha256_impl.S \ + asm-x86_64/sha2/sha512_impl.S + +CFLAGS+= -D__amd64 -D_SYS_STACK_H +.else +ASM_SOURCES_C = +ASM_SOURCES_AS = +.endif + + +KERNEL_C = \ + spi/kcf_spi.c \ + api/kcf_ctxops.c \ + api/kcf_digest.c \ + api/kcf_cipher.c \ + api/kcf_miscapi.c \ + api/kcf_mac.c \ + algs/aes/aes_impl_aesni.c \ + algs/aes/aes_impl_generic.c \ + algs/aes/aes_impl_x86-64.c \ + algs/aes/aes_impl.c \ + algs/aes/aes_modes.c \ + algs/edonr/edonr.c \ + algs/modes/modes.c \ + algs/modes/cbc.c \ + algs/modes/gcm_generic.c \ + algs/modes/gcm_pclmulqdq.c \ + algs/modes/gcm.c \ + algs/modes/ctr.c \ + algs/modes/ccm.c \ + algs/modes/ecb.c \ + algs/sha1/sha1.c \ + algs/sha2/sha2.c \ + algs/skein/skein_block.c \ + illumos-crypto.c \ + io/aes.c \ + io/edonr_mod.c \ + io/sha1_mod.c \ + io/sha2_mod.c \ + io/skein_mod.c \ + os/modhash.c \ + os/modconf.c \ + core/kcf_sched.c \ + core/kcf_prov_lib.c \ + core/kcf_callprov.c \ + core/kcf_mech_tabs.c \ + core/kcf_prov_tabs.c \ + $(ASM_SOURCES_C) + + + + + + +SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) + +WARNS?= 2 +SHLIB_MAJOR= 3 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID -UHAVE_AVX -DRESCUE +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + + +CFLAGS.aes_amd64.S+= -DLOCORE +CFLAGS.aes_aesni.S+= -DLOCORE +CFLAGS.gcm_pclmulqdq.S+= -DLOCORE +CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE +CFLAGS.ghash-x86_64.S+= -DLOCORE +CFLAGS.sha1-x86_64.S+= -DLOCORE +CFLAGS.sha256_impl.S+= -DLOCORE +CFLAGS.sha512_impl.S+= -DLOCORE +CFLAGS.gcm.c+= -UCAN_USE_GCM_ASM + +.include Modified: head/cddl/lib/libnvpair/Makefile ============================================================================== --- head/cddl/lib/libnvpair/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libnvpair/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,36 +1,30 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/nvpair +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/nvpair +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libnvpair LIB= nvpair PACKAGE= runtime -INCS= libnvpair.h +# user SRCS= libnvpair.c \ - nvpair_alloc_system.c \ - nvpair_json.c \ - opensolaris_fnvpair.c \ - opensolaris_nvpair.c \ - opensolaris_nvpair_alloc_fixed.c + libnvpair_json.c \ + nvpair_alloc_system.c +# kernel +SRCS+= nvpair_alloc_fixed.c \ + nvpair.c \ + fnvpair.c -WARNS?= 1 -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +WARNS?= 2 +CFLAGS+= -DIN_BASE -DHAVE_RPC_TYPES +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd CFLAGS+= -I${SRCTOP}/sys -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID -DHAVE_CONFIG_H -DHAVE_XDR_BYTESREC -# This library uses macros to define fprintf behavior for several object types -# The compiler will see the non-string literal arguments to the fprintf calls and -# omit warnings for them. Quiesce these warnings in contrib code: -# -# cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format -# string is not a string literal (potentially insecure) [-Wformat-security] -# ARENDER(pctl, nvlist_array, nvl, name, val, nelem); -# -CFLAGS+= -Wno-format-security + +CFLAGS.nvpair.c+= -UHAVE_RPC_TYPES .include Added: head/cddl/lib/libspl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libspl/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + + +LIB= spl +LIBADD= +PACKAGE= runtime + +SRCS = \ + assert.c \ + list.c \ + mkdirp.c \ + page.c \ + strlcat.c \ + strlcpy.c \ + timestamp.c \ + zone.c \ + include/sys/list.h \ + include/sys/list_impl.h + +SRCS += \ + getexecname.c \ + gethostid.c \ + getmntany.c \ + mnttab.c + + +.if ${MACHINE_ARCH} == "amd64" +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-x86_64 +SRCS += atomic.S +.elif ${MACHINE_ARCH} == "i386" +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-i386 +SRCS += atomic.S +.else +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-generic +SRCS += atomic.c +.endif + + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS.atomic.S+= -DLOCORE + +.include Added: head/cddl/lib/libtpool/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/libtpool/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libtpool +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + + +LIB= tpool +LIBADD= spl +PACKAGE= runtime + +INCS= thread_pool_impl.h +SRCS= thread_pool.c + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + +.include Modified: head/cddl/lib/libuutil/Makefile ============================================================================== --- head/cddl/lib/libuutil/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libuutil/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,11 +1,10 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libuutil PACKAGE= runtime LIB= uutil -SRCS= avl.c \ +SRCS=\ uu_alloc.c \ uu_avl.c \ uu_dprintf.c \ @@ -14,14 +13,17 @@ SRCS= avl.c \ uu_misc.c \ uu_open.c \ uu_pname.c \ - uu_strtoint.c + uu_string.c -WARNS?= 1 -CFLAGS+= -DNATIVE_BUILD -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +WARNS?= 2 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h + +LIBADD= avl spl .include Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libzfs/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,62 +1,102 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils/common +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/include +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib PACKAGE= runtime LIB= zfs -LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core -SRCS= deviceid.c \ - fsshare.c \ - mkdirp.c \ - mnttab.c \ - thread_pool.c \ - zmount.c \ - zone.c +LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core zutil -SRCS+= nicenum.c +INCS= libzfs.h +USER_C = \ + libzfs_changelist.c \ + libzfs_config.c \ + libzfs_crypto.c \ + libzfs_dataset.c \ + libzfs_diff.c \ + libzfs_import.c \ + libzfs_iter.c \ + libzfs_mount.c \ + libzfs_pool.c \ + libzfs_sendrecv.c \ + libzfs_status.c \ + libzfs_util.c -SRCS+= libzfs_changelist.c \ - libzfs_compat.c \ - libzfs_config.c \ - libzfs_dataset.c \ - libzfs_diff.c \ - libzfs_import.c \ - libzfs_iter.c \ - libzfs_mount.c \ - libzfs_pool.c \ - libzfs_sendrecv.c \ - libzfs_status.c \ - libzfs_util.c \ - zfeature_common.c \ - zfs_comutil.c \ - zfs_deleg.c \ - zfs_fletcher.c \ - zfs_namecheck.c \ - zfs_prop.c \ - zpool_prop.c \ - zprop_common.c \ +# FreeBSD +USER_C += \ + libzfs_compat.c \ + libzfs_ioctl_compat.c \ + libzfs_zmount.c -WARNS?= 0 -SHLIB_MAJOR= 3 +# libshare +USER_C += \ + libshare.c \ + nfs.c \ + smb.c + + +KERNEL_C = \ + algs/sha2/sha2.c \ + cityhash.c \ + zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zfs_uio.c \ + zpool_prop.c \ + zprop_common.c + + +KERNEL_C+= zstd.c \ + zfs_zstd.c + + +ARCH_C = +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +ARCH_C += zfs_fletcher_intel.c \ + zfs_fletcher_sse.c +CFLAGS += -DHAVE_SSE2 +.endif +.if ${MACHINE_ARCH} == "amd64" +ARCH_C += zfs_fletcher_avx512.c +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F +.endif +.if ${MACHINE_ARCH} == "aarch64" +ARCH_C += zfs_fletcher_aarch64_neon.c +.endif + +SRCS= $(USER_C) $(KERNEL_C) $(ARCH_C) + +WARNS?= 2 +SHLIB_MAJOR= 4 CSTD= c99 -CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${SRCTOP}/sbin/mount -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libshare +CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include +CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -I${SRCDIR}/sys/contrib/openzfs/module/zstd/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zstd.c= -fno-tree-vectorize + .include Modified: head/cddl/lib/libzfs_core/Makefile ============================================================================== --- head/cddl/lib/libzfs_core/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libzfs_core/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,37 +1,28 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + LIB= zfs_core LIBADD= nvpair PACKAGE= runtime INCS= libzfs_core.h -SRCS= libzfs_core.c \ - libzfs_core_compat.c \ - zfs_ioctl_compat.c +SRCS= libzfs_core.c -SRCS+= libzfs_compat.c - -WARNS?= 0 +WARNS?= 2 CSTD= c99 -CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${SRCTOP}/sbin/mount -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h .include Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Tue Aug 25 02:14:36 2020 (r364745) +++ head/cddl/lib/libzpool/Makefile Tue Aug 25 02:21:27 2020 (r364746) @@ -1,20 +1,17 @@ # $FreeBSD$ -.include "${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/Makefile.files" # ZFS_COMMON_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/unicode # LUA_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua -# ZFS_SHARED_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -# LZ4_COMMON_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 -# KERNEL_SRCS -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common -# LIST_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/os -# ATOMIC_SRCS +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/lua + +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/linux/zfs + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzpool + .if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S @@ -23,40 +20,218 @@ ACFLAGS+= -Wa,--noexecstack .PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c .endif -# UNICODE_SRCS -.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/unicode -# LIBCMDUTILS_SRCS -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils/common +.if ${MACHINE_ARCH} == "powerpc" +# Don't waste GOT entries on small data. +PICFLAG= -fPIC +.endif + LIB= zpool -ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c -ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/} -LZ4_COMMON_SRCS= lz4.c -LUA_SRCS= ${LUA_OBJS:C/.o$/.c/} -KERNEL_SRCS= kernel.c taskq.c util.c -LIST_SRCS= list.c -UNICODE_SRCS= u8_textprep.c -LIBCMDUTILS_SRCS=nicenum.c -SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} ${LUA_SRCS} \ - ${LZ4_COMMON_SRCS} ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \ - ${UNICODE_SRCS} ${LIBCMDUTILS_SRCS} -WARNS?= 0 -CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 -CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils +USER_C = \ + kernel.c \ + taskq.c \ + util.c + +KERNEL_C = \ + zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zfs_uio.c \ + zpool_prop.c \ + zprop_common.c \ + abd.c \ + abd_os.c \ + aggsum.c \ + arc.c \ + arc_os.c \ + blkptr.c \ + bplist.c \ + bpobj.c \ + bptree.c \ + btree.c \ + bqueue.c \ + cityhash.c \ + dbuf.c \ + dbuf_stats.c \ + ddt.c \ + ddt_zap.c \ + dmu.c \ + dmu_diff.c \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 25 02:22:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2D873B5E54; Tue, 25 Aug 2020 02:22:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbCSn5Kbjz4cV7; Tue, 25 Aug 2020 02:22:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CB6E228B5; Tue, 25 Aug 2020 02:22:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P2Mnni046597; Tue, 25 Aug 2020 02:22:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P2Mnq7046596; Tue, 25 Aug 2020 02:22:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008250222.07P2Mnq7046596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 02:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364747 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 02:22:49 -0000 Author: mmacy Date: Tue Aug 25 02:22:49 2020 New Revision: 364747 URL: https://svnweb.freebsd.org/changeset/base/364747 Log: Bump __FreeBSD_version for OpenZFS switchover Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Aug 25 02:21:27 2020 (r364746) +++ head/sys/sys/param.h Tue Aug 25 02:22:49 2020 (r364747) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300111 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300112 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Aug 25 02:42:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B43FD3B7395; Tue, 25 Aug 2020 02:42:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbCvs4QmSz4dqd; Tue, 25 Aug 2020 02:42:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B6A822AD7; Tue, 25 Aug 2020 02:42:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P2gnZ9058809; Tue, 25 Aug 2020 02:42:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P2gngr058808; Tue, 25 Aug 2020 02:42:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008250242.07P2gngr058808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 02:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364749 - head X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 02:42:49 -0000 Author: mmacy Date: Tue Aug 25 02:42:48 2020 New Revision: 364749 URL: https://svnweb.freebsd.org/changeset/base/364749 Log: Mention OpenZFS merge in UPDATING Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Aug 25 02:42:07 2020 (r364748) +++ head/UPDATING Tue Aug 25 02:42:48 2020 (r364749) @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20200824: + OpenZFS support has been integrated. We caution against 'zpool upgrade' + for the next few weeks. The change should be transparent unless you + want to use new features. + + The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with other use. The old notification will be created as well, but From owner-svn-src-head@freebsd.org Tue Aug 25 03:43:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAF163BACC7; Tue, 25 Aug 2020 03:43:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbFGJ5yvdz3V5q; Tue, 25 Aug 2020 03:43:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B16332372E; Tue, 25 Aug 2020 03:43:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P3hqg4096569; Tue, 25 Aug 2020 03:43:52 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P3hqi8096568; Tue, 25 Aug 2020 03:43:52 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008250343.07P3hqi8096568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 03:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364751 - head/cddl/lib/libzfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/cddl/lib/libzfs X-SVN-Commit-Revision: 364751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 03:43:53 -0000 Author: mmacy Date: Tue Aug 25 03:43:52 2020 New Revision: 364751 URL: https://svnweb.freebsd.org/changeset/base/364751 Log: Fix libzfs build failures for some In some environments adding zstd/include to the include path would cause zstd's stdlib.h to hide the system one. Modified: head/cddl/lib/libzfs/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Tue Aug 25 02:54:48 2020 (r364750) +++ head/cddl/lib/libzfs/Makefile Tue Aug 25 03:43:52 2020 (r364751) @@ -91,7 +91,6 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include -CFLAGS+= -I${SRCDIR}/sys/contrib/openzfs/module/zstd/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h From owner-svn-src-head@freebsd.org Tue Aug 25 06:49:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEB6C3C0E79; Tue, 25 Aug 2020 06:49:11 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbKN762sMz3gYl; Tue, 25 Aug 2020 06:49:11 +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 B2C5A25AF4; Tue, 25 Aug 2020 06:49:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P6nBiS006832; Tue, 25 Aug 2020 06:49:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P6nBGp006829; Tue, 25 Aug 2020 06:49:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008250649.07P6nBGp006829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 25 Aug 2020 06:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364753 - in head: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt sys/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt sys/sys X-SVN-Commit-Revision: 364753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 06:49:12 -0000 Author: dim Date: Tue Aug 25 06:49:10 2020 New Revision: 364753 URL: https://svnweb.freebsd.org/changeset/base/364753 Log: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26159 Modified: head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c head/lib/libcompiler_rt/Makefile.inc head/sys/sys/param.h Modified: head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Aug 25 05:15:40 2020 (r364752) +++ head/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Aug 25 06:49:10 2020 (r364753) @@ -125,8 +125,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Tue Aug 25 05:15:40 2020 (r364752) +++ head/lib/libcompiler_rt/Makefile.inc Tue Aug 25 06:49:10 2020 (r364753) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins @@ -18,6 +20,9 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -120,6 +125,10 @@ SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 +.if "${COMPILER_TYPE}" == "clang" +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -212,12 +221,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -239,19 +242,11 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif .if ${MACHINE_ARCH:Mriscv*sf} Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Aug 25 05:15:40 2020 (r364752) +++ head/sys/sys/param.h Tue Aug 25 06:49:10 2020 (r364753) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300112 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300113 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Aug 25 09:42:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78FAF3C51D3; Tue, 25 Aug 2020 09:42:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbPCc2fw3z46hb; Tue, 25 Aug 2020 09:42:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E82127E00; Tue, 25 Aug 2020 09:42:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07P9g40P016441; Tue, 25 Aug 2020 09:42:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07P9g3gN016439; Tue, 25 Aug 2020 09:42:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202008250942.07P9g3gN016439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 25 Aug 2020 09:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364754 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 364754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 09:42:04 -0000 Author: tuexen Date: Tue Aug 25 09:42:03 2020 New Revision: 364754 URL: https://svnweb.freebsd.org/changeset/base/364754 Log: RFC 3465 defines a limit L used in TCP slow start for limiting the number of acked bytes as described in Section 2.2 of that document. This patch ensures that this limit is not also applied in congestion avoidance. Applying this limit also in congestion avoidance can result in using less bandwidth than allowed. Reported by: l.tian.email@gmail.com Reviewed by: rrs, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26120 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Aug 25 06:49:10 2020 (r364753) +++ head/sys/netinet/tcp_input.c Tue Aug 25 09:42:03 2020 (r364754) @@ -349,8 +349,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, u } #endif /* STATS */ if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Aug 25 06:49:10 2020 (r364753) +++ head/sys/netinet/tcp_stacks/rack.c Tue Aug 25 09:42:03 2020 (r364754) @@ -3911,8 +3911,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r #endif } if (rack->r_ctl.cwnd_to_use > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * ctf_fixed_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= rack->r_ctl.cwnd_to_use) { tp->t_bytes_acked -= rack->r_ctl.cwnd_to_use; tp->ccv->flags |= CCF_ABC_SENTAWND; From owner-svn-src-head@freebsd.org Tue Aug 25 13:18:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 876FB3CB0D7; Tue, 25 Aug 2020 13:18:57 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbV1s3K3yz4P6f; Tue, 25 Aug 2020 13:18:57 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54F542A159; Tue, 25 Aug 2020 13:18:57 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDIv7p048677; Tue, 25 Aug 2020 13:18:57 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDIsYD048661; Tue, 25 Aug 2020 13:18:54 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251318.07PDIsYD048661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364757 - in head/tools/build/cross-build/include: . common common/machine common/sys linux linux/sys mac mac/sys X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/tools/build/cross-build/include: . common common/machine common/sys linux linux/sys mac mac/sys X-SVN-Commit-Revision: 364757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:18:57 -0000 Author: arichardson Date: Tue Aug 25 13:18:53 2020 New Revision: 364757 URL: https://svnweb.freebsd.org/changeset/base/364757 Log: Add Linux/macOS compatibility system headers to tools/build/cross-build These headers are required in order to build the bootstrap tools on macOS and Linux. A follow-up commit will add implementations of functions that don't exist on those operating systems to -legacy when bootstrapping. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D14316 Added: head/tools/build/cross-build/include/ head/tools/build/cross-build/include/common/ head/tools/build/cross-build/include/common/db.h (contents, props changed) head/tools/build/cross-build/include/common/getopt.h (contents, props changed) head/tools/build/cross-build/include/common/grp.h (contents, props changed) head/tools/build/cross-build/include/common/libcasper.h (contents, props changed) head/tools/build/cross-build/include/common/libelf.h (contents, props changed) head/tools/build/cross-build/include/common/libutil.h (contents, props changed) head/tools/build/cross-build/include/common/machine/ head/tools/build/cross-build/include/common/machine/endian.h (contents, props changed) head/tools/build/cross-build/include/common/netconfig.h (contents, props changed) head/tools/build/cross-build/include/common/netdb.h (contents, props changed) head/tools/build/cross-build/include/common/osreldate.h (contents, props changed) head/tools/build/cross-build/include/common/pwd.h (contents, props changed) head/tools/build/cross-build/include/common/string.h (contents, props changed) head/tools/build/cross-build/include/common/sys/ head/tools/build/cross-build/include/common/sys/_iovec.h (contents, props changed) head/tools/build/cross-build/include/common/sys/_null.h (contents, props changed) head/tools/build/cross-build/include/common/sys/_types.h (contents, props changed) head/tools/build/cross-build/include/common/sys/cdefs.h (contents, props changed) head/tools/build/cross-build/include/common/sys/ctype.h (contents, props changed) head/tools/build/cross-build/include/common/sys/limits.h (contents, props changed) head/tools/build/cross-build/include/common/sys/mman.h (contents, props changed) head/tools/build/cross-build/include/common/sys/param.h (contents, props changed) head/tools/build/cross-build/include/common/sys/stdint.h (contents, props changed) head/tools/build/cross-build/include/common/sys/sysctl.h (contents, props changed) head/tools/build/cross-build/include/common/sys/types.h (contents, props changed) head/tools/build/cross-build/include/common/sys/uio.h (contents, props changed) head/tools/build/cross-build/include/common/unistd.h (contents, props changed) head/tools/build/cross-build/include/linux/ head/tools/build/cross-build/include/linux/__unused_workaround_end.h (contents, props changed) head/tools/build/cross-build/include/linux/__unused_workaround_start.h (contents, props changed) head/tools/build/cross-build/include/linux/ctype.h (contents, props changed) head/tools/build/cross-build/include/linux/endian.h (contents, props changed) head/tools/build/cross-build/include/linux/errno.h (contents, props changed) head/tools/build/cross-build/include/linux/fcntl.h (contents, props changed) head/tools/build/cross-build/include/linux/libutil.h (contents, props changed) head/tools/build/cross-build/include/linux/limits.h (contents, props changed) head/tools/build/cross-build/include/linux/nbtool_config.h (contents, props changed) head/tools/build/cross-build/include/linux/netdb.h (contents, props changed) head/tools/build/cross-build/include/linux/regex.h (contents, props changed) head/tools/build/cross-build/include/linux/resolv.h (contents, props changed) head/tools/build/cross-build/include/linux/signal.h (contents, props changed) head/tools/build/cross-build/include/linux/stdio.h (contents, props changed) head/tools/build/cross-build/include/linux/stdlib.h (contents, props changed) head/tools/build/cross-build/include/linux/string.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/ head/tools/build/cross-build/include/linux/sys/disk.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/endian.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/filio.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/ioccom.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/mount.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/param.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/stat.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/sysctl.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/time.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/ttycom.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/types.h (contents, props changed) head/tools/build/cross-build/include/linux/sys/ucred.h (contents, props changed) head/tools/build/cross-build/include/linux/time.h (contents, props changed) head/tools/build/cross-build/include/linux/unistd.h (contents, props changed) head/tools/build/cross-build/include/linux/wctype.h (contents, props changed) head/tools/build/cross-build/include/mac/ head/tools/build/cross-build/include/mac/libutil.h (contents, props changed) head/tools/build/cross-build/include/mac/nbtool_config.h (contents, props changed) head/tools/build/cross-build/include/mac/signal.h (contents, props changed) head/tools/build/cross-build/include/mac/stdlib.h (contents, props changed) head/tools/build/cross-build/include/mac/string.h (contents, props changed) head/tools/build/cross-build/include/mac/sys/ head/tools/build/cross-build/include/mac/sys/_types.h (contents, props changed) head/tools/build/cross-build/include/mac/sys/endian.h (contents, props changed) head/tools/build/cross-build/include/mac/sys/stat.h (contents, props changed) head/tools/build/cross-build/include/mac/sys/time.h (contents, props changed) head/tools/build/cross-build/include/mac/unistd.h (contents, props changed) Added: head/tools/build/cross-build/include/common/db.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/db.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +/* Ensure that we use the FreeBSD version of the db functions */ +#define dbopen __freebsd_dbopen +#include_next Added: head/tools/build/cross-build/include/common/getopt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/getopt.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#define getopt __freebsd_getopt +#define getopt_long __freebsd_getopt_long +#define getopt_long_only __freebsd_getopt_long_only +#define opterr __freebsd_opterr +#define optind __freebsd_optind +#define optopt __freebsd_optopt +#define optreset __freebsd_optreset +#define optarg __freebsd_optarg + +/* Since we are building the FreeBSD getopt.c also use the matching header */ +#include_next + +#undef getopt +#define getopt(argc, argv, optstr) __freebsd_getopt(argc, argv, optstr) Added: head/tools/build/cross-build/include/common/grp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/grp.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,61 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include_next + +#define group_from_gid __nbcompat_group_from_gid + +int pwcache_groupdb(int (*a_setgroupent)(int), void (*a_endgrent)(void), + struct group *(*a_getgrnam)(const char *), + struct group *(*a_getgrgid)(gid_t)); + +int gid_from_group(const char *name, gid_t *gid); + +int gid_from_group(const char *name, gid_t *gid); + +const char *group_from_gid(gid_t gid, int noname); + +#ifdef __linux__ +static inline int +setgroupent(int stayopen) +{ + setgrent(); + return (1); +} +#endif Added: head/tools/build/cross-build/include/common/libcasper.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/libcasper.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include_next + +_Static_assert(CASPER_SUPPORT == 0, "Should not have casper support"); Added: head/tools/build/cross-build/include/common/libelf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/libelf.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once +/* Needed to get opensolaris stuff to compile */ +#ifdef _OPENSOLARIS_SYS_TYPES_H_ +#include + +#include_next +#endif Added: head/tools/build/cross-build/include/common/libutil.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/libutil.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#if __has_include_next() +#include_next +#endif + +int expand_number(const char *_buf, uint64_t *_num); Added: head/tools/build/cross-build/include/common/machine/endian.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/machine/endian.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#if __has_include_next() +#include_next +#endif Added: head/tools/build/cross-build/include/common/netconfig.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/netconfig.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +/* Not actually needed. Only exists to keep rpc/types.h happy */ +#if __has_include_next() +#include_next +#endif Added: head/tools/build/cross-build/include/common/netdb.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/netdb.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,41 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once +#include_next + +#define _PATH_SERVICES_DB "/var/db/services.db" Added: head/tools/build/cross-build/include/common/osreldate.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/osreldate.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#define __FreeBSD_version 0 Added: head/tools/build/cross-build/include/common/pwd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/pwd.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,60 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include_next + +#define user_from_uid __nbcompat_user_from_uid + +int pwcache_userdb(int (*a_setpassent)(int), void (*a_endpwent)(void), + struct passwd *(*a_getpwnam)(const char *), + struct passwd *(*a_getpwuid)(uid_t)); + +int uid_from_user(const char *name, uid_t *uid); + +int uid_from_user(const char *name, uid_t *uid); +const char *user_from_uid(uid_t uid, int noname); + +#ifdef __linux__ +static inline int +setpassent(int stayopen) +{ + setpwent(); + return (1); +} +#endif Added: head/tools/build/cross-build/include/common/string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/string.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include_next +/* + * FreeBSD string.h #includes strings.h and all libmd code depends on + * string.h providing explicit_bzero. + */ +#include Added: head/tools/build/cross-build/include/common/sys/_iovec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/sys/_iovec.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once Added: head/tools/build/cross-build/include/common/sys/_null.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/sys/_null.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#if __has_include_next() +#include_next +#else +#include +#endif Added: head/tools/build/cross-build/include/common/sys/_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/sys/_types.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#if __has_include_next() +#include_next +#else +#include +#endif + +/* + * Neither GLibc nor macOS define __va_list but many FreeBSD headers require it. + */ +typedef __builtin_va_list __va_list; Added: head/tools/build/cross-build/include/common/sys/cdefs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/include/common/sys/cdefs.h Tue Aug 25 13:18:53 2020 (r364757) @@ -0,0 +1,278 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once +/* musl libc does not provide a sys/cdefs.h header */ +#if __has_include_next() +#include_next +#else +/* No sys/cdefs.h header exists so we have to provide some basic macros */ +#ifdef __cplusplus +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif + +#endif + +#ifndef __FBSDID +#define __FBSDID(id) +#endif + +#ifndef __IDSTRING +#define __IDSTRING(name, string) +#endif + +#ifndef rounddown +#define rounddown(x, y) (((x) / (y)) * (y)) +#define rounddown2(x, y) ((x) & (~((y)-1))) /* if y is power of two */ +#define roundup(x, y) ((((x) + ((y)-1)) / (y)) * (y)) /* to any y */ +#define roundup2(x, y) \ + (((x) + ((y)-1)) & (~((y)-1))) /* if y is powers of two */ +#define powerof2(x) ((((x)-1) & (x)) == 0) +#endif + +#ifndef __pure +#define __pure __attribute__((__pure__)) +#endif +#ifndef __packed +#define __packed __attribute__((__packed__)) +#endif +#ifndef __dead2 +#define __dead2 __attribute__((__noreturn__)) +#endif +#ifndef __pure2 +#define __pure2 __attribute__((__const__)) +#endif +#ifndef __used +#define __used __attribute__((__used__)) +#endif +#ifndef __aligned +#define __aligned(x) __attribute__((__aligned__(x))) +#endif +#ifndef __section +#define __section(x) __attribute__((__section__(x))) +#endif + +#ifndef __alloc_size +#define __alloc_size(...) __attribute__((__alloc_size__(__VA_ARGS__))) +#endif +#ifndef __alloc_size2 +#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x))) +#endif +#ifndef __alloc_align +#define __alloc_align(x) __attribute__((__alloc_align__(x))) +#endif +#ifndef __result_use_check +#define __result_use_check __attribute__((__warn_unused_result__)) +#endif +#ifndef __printflike +#define __printflike(fmtarg, firstvararg) \ + __attribute__((__format__(__printf__, fmtarg, firstvararg))) +#endif +#ifndef __printf0like +#define __printf0like(fmtarg, firstvararg) \ + __attribute__((__format__(__printf0__, fmtarg, firstvararg))) +#endif + +#ifndef __predict_true +#define __predict_true(exp) __builtin_expect((exp), 1) +#endif +#ifndef __predict_false +#define __predict_false(exp) __builtin_expect((exp), 0) +#endif + +#ifndef __weak_reference +#ifdef __ELF__ +#define __weak_reference(sym, alias) \ + __asm__(".weak " #alias); \ + __asm__(".equ " #alias ", " #sym) +#else +#define __weak_reference(sym, alias) \ + static int alias() __attribute__((weakref(#sym))); +#endif +#endif + +/* Some files built as part of the bootstrap libegacy use these macros, but + * since we aren't actually building libc.so, we can defined them to be empty */ +#ifndef __sym_compat +#define __sym_compat(sym, impl, verid) /* not needed for bootstrapping */ +#endif +#ifndef __sym_default +#define __sym_default(sym, impl, verid) /* not needed for bootstrapping */ +#endif +#ifndef __sym_default +#define __warn_references(sym, msg) /* not needed for bootstrapping */ +#endif + +#ifndef __malloc_like +#define __malloc_like __attribute__((__malloc__)) +#endif + +#ifndef nitems +// https://stackoverflow.com/questions/1598773/is-there-a-standard-function-in-c-that-would-return-the-length-of-an-array/1598827#1598827 +#define nitems(x) \ + ((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x]))))) +#endif + +#ifndef __min_size +#if !defined(__cplusplus) +#define __min_size(x) static(x) +#else +#define __min_size(x) (x) +#endif +#endif + +#ifndef __unused +#define __unused __attribute__((unused)) +#endif +#define __format_arg(fmtarg) __attribute__((__format_arg__(fmtarg))) + +#ifndef __exported +#define __exported __attribute__((__visibility__("default"))) +#endif +#ifndef __hidden +#define __hidden __attribute__((__visibility__("hidden"))) +#endif + +#ifndef __unreachable +#define __unreachable() __builtin_unreachable() +#endif + +#ifndef __clang__ +/* GCC doesn't like the printf0 format specifier. Clang treats it the same as + * printf so add the compatibility macro here. */ +#define __printf0__ __printf__ +#endif + +/* + * These should probably be in sys/types.h but mtree expects them to exist + * without including + */ +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; + +/* This is needed so that BSNMP doesn't redeclare an incompatible version */ +#define HAVE_STRLCPY 1 +/* The compiler supports __func__ */ +#define HAVE_DECL___FUNC__ 1 + +/* On MacOS __CONCAT is defined as x ## y, which won't expand macros */ +#undef __CONCAT +#define __CONCAT1(x, y) x##y +#define __CONCAT(x, y) __CONCAT1(x, y) + +#ifndef __STRING +#define __STRING(x) #x /* stringify without expanding x */ +#endif +#ifndef __XSTRING +#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ +#endif + +#ifndef __has_feature +#define __has_feature(...) 0 +#endif + +#ifndef __has_builtin +#define __has_builtin(...) 0 +#endif + +/* + * Nullability qualifiers: currently only supported by Clang. + */ +#if !(defined(__clang__) && __has_feature(nullability)) +#define _Nonnull +#define _Nullable +#define _Null_unspecified +#define __NULLABILITY_PRAGMA_PUSH +#define __NULLABILITY_PRAGMA_POP +#else +#define __NULLABILITY_PRAGMA_PUSH \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"") +#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop") +#endif + +#ifndef __offsetof +#define __offsetof(type, field) __builtin_offsetof(type, field) +#endif + +#define __rangeof(type, start, end) \ + (__offsetof(type, end) - __offsetof(type, start)) + +#ifndef __containerof +#define __containerof(x, s, m) \ + ({ \ + const volatile __typeof(((s *)0)->m) *__x = (x); \ + __DEQUALIFY( \ + s *, (const volatile char *)__x - __offsetof(s, m)); \ + }) +#endif + +#ifndef __RCSID +#define __RCSID(x) +#endif +#ifndef __FBSDID +#define __FBSDID(x) +#endif +#ifndef __RCSID +#define __RCSID(x) +#endif +#ifndef __RCSID_SOURCE +#define __RCSID_SOURCE(x) +#endif +#ifndef __SCCSID +#define __SCCSID(x) +#endif +#ifndef __COPYRIGHT +#define __COPYRIGHT(x) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 25 13:21:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0F3D3CB326; Tue, 25 Aug 2020 13:21:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbV5B4Ltsz4PTl; Tue, 25 Aug 2020 13:21: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 78E462A751; Tue, 25 Aug 2020 13:21: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 07PDLo5c054236; Tue, 25 Aug 2020 13:21:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDLoKW054235; Tue, 25 Aug 2020 13:21:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008251321.07PDLoKW054235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Aug 2020 13:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364758 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 364758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:21:50 -0000 Author: hselasky Date: Tue Aug 25 13:21:49 2020 New Revision: 364758 URL: https://svnweb.freebsd.org/changeset/base/364758 Log: Add mlx5en(4) to the list of supported netdump network drivers. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/share/man/man4/netdump.4 Modified: head/share/man/man4/netdump.4 ============================================================================== --- head/share/man/man4/netdump.4 Tue Aug 25 13:18:53 2020 (r364757) +++ head/share/man/man4/netdump.4 Tue Aug 25 13:21:49 2020 (r364758) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2019 +.Dd August 25, 2020 .Dt NETDUMP 4 .Os .Sh NAME @@ -110,6 +110,7 @@ The following network drivers support netdump: .Xr ix 4 , .Xr ixl 4 , .Xr mlx4en 4 , +.Xr mlx5en 4 , .Xr re 4 , .Xr vtnet 4 . .Sh SYSCTL VARIABLES From owner-svn-src-head@freebsd.org Tue Aug 25 13:23:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F38743CB489; Tue, 25 Aug 2020 13:23:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbV796Xx4z4PcH; Tue, 25 Aug 2020 13:23:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3BB32A5E0; Tue, 25 Aug 2020 13:23:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDNXL3055074; Tue, 25 Aug 2020 13:23:33 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDNV7f055061; Tue, 25 Aug 2020 13:23:31 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251323.07PDNV7f055061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364759 - in head: lib/libc/gen lib/libcapsicum tools/build tools/build/cross-build tools/build/libc-bootstrap tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: lib/libc/gen lib/libcapsicum tools/build tools/build/cross-build tools/build/libc-bootstrap tools/build/mk X-SVN-Commit-Revision: 364759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:23:34 -0000 Author: arichardson Date: Tue Aug 25 13:23:31 2020 New Revision: 364759 URL: https://svnweb.freebsd.org/changeset/base/364759 Log: Add missing FreeBSD functions to -legacy when building on macOS/Linux In most cases this simply builds the file from lib/libc for missing functions (e.g. strlcpy on Linux etc.). In cases where this is not possible I've added an implementation to tools/build/cross-build. The fgetln.c/fgetwln.c/closefrom.c compatibility code was obtained from https://gitlab.freedesktop.org/libbsd/libbsd, but I'm not sure it makes sense to import it into to contrib just for these three bootstrap files. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25978 Added: head/tools/build/cross-build/capsicum_stubs.c (contents, props changed) head/tools/build/cross-build/closefrom.c (contents, props changed) head/tools/build/cross-build/fake_sysctl.c (contents, props changed) head/tools/build/cross-build/fgetln_fallback.c (contents, props changed) head/tools/build/cross-build/fgetwln_fallback.c (contents, props changed) head/tools/build/cross-build/local-link.h (contents, props changed) head/tools/build/cross-build/progname.c (contents, props changed) head/tools/build/libc-bootstrap/ head/tools/build/libc-bootstrap/libc_private.h (contents, props changed) head/tools/build/libc-bootstrap/namespace.h (contents, props changed) head/tools/build/libc-bootstrap/un-namespace.h (contents, props changed) head/tools/build/mk/Makefile.boot.pre (contents, props changed) Modified: head/lib/libc/gen/arc4random.h head/lib/libcapsicum/capsicum_helpers.h head/tools/build/Makefile head/tools/build/mk/Makefile.boot head/tools/build/mk/bsd.lib.mk head/tools/build/mk/bsd.prog.mk Modified: head/lib/libc/gen/arc4random.h ============================================================================== --- head/lib/libc/gen/arc4random.h Tue Aug 25 13:21:49 2020 (r364758) +++ head/lib/libc/gen/arc4random.h Tue Aug 25 13:23:31 2020 (r364759) @@ -58,11 +58,13 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) if ((p = mmap(NULL, sizeof(*p), PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) return (-1); + /* Allow bootstrapping arc4random.c on Linux/macOS */ +#ifdef INHERIT_ZERO if (minherit(p, sizeof(*p), INHERIT_ZERO) == -1) { munmap(p, sizeof(*p)); return (-1); } - +#endif *rsp = &p->rs; *rsxp = &p->rsx; return (0); Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Tue Aug 25 13:21:49 2020 (r364758) +++ head/lib/libcapsicum/capsicum_helpers.h Tue Aug 25 13:23:31 2020 (r364759) @@ -49,7 +49,17 @@ __BEGIN_DECLS static const unsigned long caph_stream_cmds[] = - { TIOCGETA, TIOCGWINSZ, FIODTYPE }; + { +#ifdef TIOCGETA + TIOCGETA, +#endif +#ifdef TIOCGWINSZ + TIOCGWINSZ, +#endif +#ifdef FIODTYPE + FIODTYPE, +#endif + }; static const uint32_t caph_stream_fcntls = CAP_FCNTL_GETFL; static __inline void Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Tue Aug 25 13:21:49 2020 (r364758) +++ head/tools/build/Makefile Tue Aug 25 13:23:31 2020 (r364759) @@ -5,6 +5,7 @@ LIB= egacy SRC= INCSGROUPS= INCS SYSINCS CASPERINC UFSINCS FFSINCS MSDOSFSINCS DISKINCS +INCSGROUPS+= MACHINESYSINCS RPCINCS INCS= SYSINCSDIR= ${INCLUDEDIR}/sys @@ -14,49 +15,83 @@ UFSINCSDIR= ${INCLUDEDIR}/ufs/ufs FFSINCSDIR= ${INCLUDEDIR}/ufs/ffs MSDOSFSINCSDIR= ${INCLUDEDIR}/fs/msdosfs DISKINCSDIR= ${INCLUDEDIR}/sys/disk +MACHINESYSINCSDIR= ${INCLUDEDIR}/machine +RPCINCSDIR= ${INCLUDEDIR}/rpc BOOTSTRAPPING?= 0 -_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/grp.h || true + +.if ${.MAKE.OS} == "Darwin" +_XCODE_ROOT!=xcode-select -p +# since macOS 10.14 C headers are no longer installed in /usr but only +# provided via the SDK +.if ${_XCODE_ROOT} == "/Library/Developer/CommandLineTools" +# Only command line tools installed -> host headers are in the SDKs directory +_MACOS_SDK_DIR=${_XCODE_ROOT}/SDKs/MacOSX.sdk/ +.else +# Full XCode installed -> host headers are below Platforms/MacOSX.platform +_MACOS_SDK_DIR=${_XCODE_ROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk +.endif +HOST_INCLUDE_ROOT=${_MACOS_SDK_DIR}/usr/include +.if !exists(${HOST_INCLUDE_ROOT}/stdio.h) +.error "You must install the macOS SDK (try xcode-select --install)" +.endif +.else +HOST_INCLUDE_ROOT=/usr/include +.endif + +# Allow building libc-internal files (also on non-FreeBSD hosts) +CFLAGS+= -I${.CURDIR}/libc-bootstrap +# Symbol versioning is not required for -legacy (and macOS bootstrap) +MK_SYMVER= no + +_WITH_PWCACHEDB!= grep -c pwcache_groupdb ${HOST_INCLUDE_ROOT}/grp.h || true .if ${_WITH_PWCACHEDB} == 0 .PATH: ${.CURDIR}/../../contrib/libc-pwcache -CFLAGS+= -I${.CURDIR}/../../contrib/libc-pwcache \ - -I${.CURDIR}/../../lib/libc/include +CFLAGS.pwcache.c+= -I${.CURDIR}/../../contrib/libc-pwcache SRCS+= pwcache.c .endif -_WITH_STRSVIS!= grep -c strsvis /usr/include/vis.h || true +_WITH_STRSVIS!= grep -c strsvis ${HOST_INCLUDE_ROOT}/vis.h 2>/dev/null || true .if ${_WITH_STRSVIS} == 0 .PATH: ${.CURDIR}/../../contrib/libc-vis -SRCS+= vis.c -CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis \ - -I${.CURDIR}/../../lib/libc/include +INCS+= vis.h +SRCS+= vis.c unvis.c +CFLAGS.vis.c+= -I${.CURDIR}/../../contrib/libc-vis +CFLAGS.unvis.c+= -I${.CURDIR}/../../contrib/libc-vis .endif -_WITH_REALLOCARRAY!= grep -c reallocarray /usr/include/stdlib.h || true +_WITH_REALLOCARRAY!= grep -c reallocarray ${HOST_INCLUDE_ROOT}/stdlib.h || true .if ${_WITH_REALLOCARRAY} == 0 .PATH: ${.CURDIR}/../../lib/libc/stdlib INCS+= stdlib.h SRCS+= reallocarray.c -CFLAGS+= -I${.CURDIR}/../../lib/libc/include .endif -_WITH_UTIMENS!= grep -c utimensat /usr/include/sys/stat.h || true +_WITH_UTIMENS!= grep -c utimensat ${HOST_INCLUDE_ROOT}/sys/stat.h || true .if ${_WITH_UTIMENS} == 0 SYSINCS+= stat.h SRCS+= futimens.c utimensat.c .endif -_WITH_EXPLICIT_BZERO!= grep -c explicit_bzero /usr/include/strings.h || true +_WITH_EXPLICIT_BZERO!= grep -c explicit_bzero ${HOST_INCLUDE_ROOT}/strings.h || true .if ${_WITH_EXPLICIT_BZERO} == 0 -.PATH: ${SRCTOP}/sys/libkern +# .PATH: ${SRCTOP}/sys/libkern +# Adding sys/libkern to .PATH breaks building the cross-build compat library +# since that attempts to build strlcpy.c from libc and adding libkern here will +# cause it to pick the file from libkern instead (which won't compile). +# Avoid modifying .PATH by creating a copy in the build directory instead. +explicit_bzero.c: ${SRCTOP}/sys/libkern/explicit_bzero.c + cp ${.ALLSRC} ${.TARGET} +CLEANFILES+= explicit_bzero.c INCS+= strings.h SRCS+= explicit_bzero.c .endif -.if exists(/usr/include/capsicum_helpers.h) -_WITH_CAPH_ENTER!= grep -c caph_enter /usr/include/capsicum_helpers.h || true -_WITH_CAPH_RIGHTS_LIMIT!= grep -c caph_rights_limit /usr/include/capsicum_helpers.h || true + +.if exists(${HOST_INCLUDE_ROOT}/capsicum_helpers.h) +_WITH_CAPH_ENTER!= grep -c caph_enter ${HOST_INCLUDE_ROOT}/capsicum_helpers.h || true +_WITH_CAPH_RIGHTS_LIMIT!= grep -c caph_rights_limit ${HOST_INCLUDE_ROOT}/capsicum_helpers.h || true .endif .if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0 || ${_WITH_CAPH_RIGHTS_LIMIT} == 0 .PATH: ${SRCTOP}/lib/libcapsicum @@ -65,6 +100,105 @@ INCS+= capsicum_helpers.h INCS+= libcasper.h .endif +# rpcgen should build against the source tree rpc/types.h and not the host. +# This is especially important on non-FreeBSD systems where the types may +# not match. +RPCINCS+= ${SRCTOP}/sys/rpc/types.h + +.if ${.MAKE.OS} != "FreeBSD" +.PATH: ${.CURDIR}/cross-build + +INCS+= ${SRCTOP}/include/mpool.h +INCS+= ${SRCTOP}/include/ndbm.h +INCS+= ${SRCTOP}/include/err.h +INCS+= ${SRCTOP}/include/stringlist.h + +# Needed to build arc4random.c +INCSGROUPS+= CHACHA20INCS +CHACHA20INCSDIR= ${INCLUDEDIR}/crypto/chacha20 +CHACHA20INCS+= ${SRCTOP}/sys/crypto/chacha20/_chacha.h \ + ${SRCTOP}/sys/crypto/chacha20/chacha.h + +_host_arch=${MACHINE} +.if ${_host_arch} == "x86_64" +# bmake on Linux/mac often prints that instead of amd64 +_host_arch=amd64 +.endif +.if ${_host_arch} == "unknown" +# HACK: If MACHINE is unknown, assume we are building on x86 +_host_arch=amd64 +.endif +MACHINESYSINCS+= ${SRCTOP}/sys/${_host_arch}/include/elf.h +.if ${_host_arch} == "amd64" || ${_host_arch} == "i386" +INCSGROUPS+= X86INCS +X86INCSDIR= ${INCLUDEDIR}/x86 +X86INCS+= ${SRCTOP}/sys/x86/include/elf.h +.endif + +# needed for btxld: +MACHINESYSINCS+= ${SRCTOP}/sys/${_host_arch}/include/exec.h +MACHINESYSINCS+= ${SRCTOP}/sys/${_host_arch}/include/reloc.h +INCS+= ${SRCTOP}/include/a.out.h +INCS+= ${SRCTOP}/include/nlist.h +SYSINCS+= ${SRCTOP}/sys/sys/imgact_aout.h +SYSINCS+= ${SRCTOP}/sys/sys/nlist_aout.h + +# dbopen() behaves differently on Linux and FreeBSD so we ensure that we +# bootstrap the FreeBSD db code. The cross-build headers #define dbopen() to +# __freebsd_dbopen() so that we don't ever use the host version +INCS+= ${SRCTOP}/include/db.h +LIBC_SRCTOP= ${SRCTOP}/lib/libc/ +.include "${LIBC_SRCTOP}/db/Makefile.inc" +# Do the same as we did for dbopen() for getopt() on since it's not compatible +# on Linux (and to avoid surprises also compile the FreeBSD code on macOS) +.PATH: ${LIBC_SRCTOP}/stdlib +SRCS+= getopt.c getopt_long.c +INCS+= ${SRCTOP}/include/getopt.h + +# getcap.c is needed for cap_mkdb: +.PATH: ${LIBC_SRCTOP}/gen +SRCS+= getcap.c +# Add various libbc functions that are not available in glibc: +SRCS+= stringlist.c setmode.c +SRCS+= strtonum.c merge.c heapsort.c reallocf.c +.PATH: ${LIBC_SRCTOP}/locale +SRCS+= rpmatch.c + +.if ${.MAKE.OS} == "Linux" +# On Linux, glibc does not provide strlcpy,strlcat or strmode. +.PATH: ${LIBC_SRCTOP}/string +SRCS+= strlcpy.c strlcat.c strmode.c +# Compile the fgetln/fgetwln/closefrom fallback code from libbsd: +SRCS+= fgetln_fallback.c fgetwln_fallback.c closefrom.c +CFLAGS.closefrom.c+= -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \ + -DHAVE_DIRFD -DHAVE_SYSCONF +# Provide warnc/errc/getprogname/setprograme +SRCS+= err.c progname.c +.endif +# Provide the same arc4random implementation on Linux/macOS +CFLAGS.arc4random.c+= -I${SRCTOP}/sys/crypto/chacha20 -D__isthreaded=1 +SRCS+= arc4random.c arc4random_uniform.c + +# expand_number() is not provided by either Linux or MacOS libutil +.PATH: ${SRCTOP}/lib/libutil +SRCS+= expand_number.c +# Linux libutil also doesn't have fparseln +SRCS+= fparseln.c +# A dummy sysctl for tzsetup: +SRCS+= fake_sysctl.c + +# capsicum support +SYSINCS+= ${SRCTOP}/sys/sys/capsicum.h +SYSINCS+= ${SRCTOP}/sys/sys/caprights.h +SRCS+= capsicum_stubs.c +# XXX: we can't add ${SRCTOP}/sys/kern to .PATH since that will causes +# conflicts with other files. Instead copy subr_capability to the build dir. +subr_capability.c: ${SRCTOP}/sys/kern/subr_capability.c + cp ${.ALLSRC} ${.TARGET} +SRCS+= subr_capability.c +CLEANFILES+= subr_capability.c +.endif + CASPERINC+= ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h .if empty(SRCS) @@ -97,9 +231,22 @@ SYSINCS+= ${SRCTOP}/sys/sys/elf32.h SYSINCS+= ${SRCTOP}/sys/sys/elf64.h SYSINCS+= ${SRCTOP}/sys/sys/elf_common.h SYSINCS+= ${SRCTOP}/sys/sys/elf_generic.h +SYSINCS+= ${SRCTOP}/sys/sys/queue.h +SYSINCS+= ${SRCTOP}/sys/sys/md5.h +SYSINCS+= ${SRCTOP}/sys/sys/sbuf.h +SYSINCS+= ${SRCTOP}/sys/sys/tree.h # vtfontcvt is using sys/font.h SYSINCS+= ${SRCTOP}/sys/sys/font.h +# For mkscrfil.c: +SYSINCS+= ${SRCTOP}/sys/sys/consio.h +# for gencat: +INCS+= ${SRCTOP}/include/nl_types.h +# for vtfontcvt: +SYSINCS+= ${SRCTOP}/sys/sys/fnv_hash.h +# opensolaris compatibility +INCS+= ${SRCTOP}/include/elf.h +SYSINCS+= ${SRCTOP}/sys/sys/elf.h # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't # accidentally run tools that are incompatible but happen to be in $PATH. @@ -121,6 +268,19 @@ _host_tools_to_symlink= basename bzip2 bunzip2 chmod c # since e.g. on Linux and MacOS that will be GNU make. _make_abs!= which "${MAKE}" _host_abs_tools_to_symlink= ${_make_abs}:make ${_make_abs}:bmake + +.if ${.MAKE.OS} != "FreeBSD" +_make_abs!= which "${MAKE}" +_host_abs_tools_to_symlink+= ${_make_abs}:make ${_make_abs}:bmake +.if ${.MAKE.OS} == "Darwin" +# /usr/bin/cpp may invoke xcrun: +_host_tools_to_symlink+=xcrun +.endif # ${.MAKE.OS} == "Darwin" +# On Ubuntu /bin/sh is dash which is totally useless. Let's just link bash +# as the build sh since that will work fine. +_host_abs_tools_to_symlink+= /bin/bash:sh +_host_tools_to_symlink:=${_host_tools_to_symlink:Nsh} +.endif host-symlinks: @echo "Linking host tools into ${DESTDIR}/bin" Added: head/tools/build/cross-build/capsicum_stubs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/capsicum_stubs.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +int +cap_ioctls_limit(int fd, const cap_ioctl_t *cmds, size_t ncmds) +{ + return 0; /* Just pretend that it succeeded */ +} + +int +cap_fcntls_limit(int fd, uint32_t fcntlrights) +{ + return 0; /* Just pretend that it succeeded */ +} + +int +cap_rights_limit(int fd, const cap_rights_t *rights) +{ + return 0; /* Just pretend that it succeeded */ +} + +int +cap_enter(void) +{ + errno = ENOSYS; + return -1; +} Added: head/tools/build/cross-build/closefrom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/closefrom.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2004-2005, 2007, 2010, 2012-2014 + * Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// #include + +#include +#include +#include +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif /* STDC_HEADERS */ +#include +#include +#ifdef HAVE_PSTAT_GETPROC +# include +# include +#else +# ifdef HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +# else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +# endif +#endif + +#ifndef OPEN_MAX +# define OPEN_MAX 256 +#endif + +#if defined(HAVE_FCNTL_CLOSEM) && !defined(HAVE_DIRFD) +# define closefrom closefrom_fallback +#endif + +static inline void +closefrom_close(int fd) +{ +#ifdef __APPLE__ + /* Avoid potential libdispatch crash when we close its fds. */ + (void)fcntl(fd, F_SETFD, FD_CLOEXEC); +#else + (void)close(fd); +#endif +} + +/* + * Close all file descriptors greater than or equal to lowfd. + * This is the expensive (fallback) method. + */ +void +closefrom_fallback(int lowfd) +{ + long fd, maxfd; + + /* + * Fall back on sysconf() or getdtablesize(). We avoid checking + * resource limits since it is possible to open a file descriptor + * and then drop the rlimit such that it is below the open fd. + */ +#ifdef HAVE_SYSCONF + maxfd = sysconf(_SC_OPEN_MAX); +#else + maxfd = getdtablesize(); +#endif /* HAVE_SYSCONF */ + if (maxfd < 0) + maxfd = OPEN_MAX; + + for (fd = lowfd; fd < maxfd; fd++) + closefrom_close(fd); +} + +/* + * Close all file descriptors greater than or equal to lowfd. + * We try the fast way first, falling back on the slow method. + */ +#if defined(HAVE_FCNTL_CLOSEM) +void +closefrom(int lowfd) +{ + if (fcntl(lowfd, F_CLOSEM, 0) == -1) + closefrom_fallback(lowfd); +} +#elif defined(HAVE_PSTAT_GETPROC) +void +closefrom(int lowfd) +{ + struct pst_status pstat; + int fd; + + if (pstat_getproc(&pstat, sizeof(pstat), 0, getpid()) != -1) { + for (fd = lowfd; fd <= pstat.pst_highestfd; fd++) + (void)close(fd); + } else { + closefrom_fallback(lowfd); + } +} +#elif defined(HAVE_DIRFD) +static int +closefrom_procfs(int lowfd) +{ + const char *path; + DIR *dirp; + struct dirent *dent; + int *fd_array = NULL; + int fd_array_used = 0; + int fd_array_size = 0; + int ret = 0; + int i; + + /* Use /proc/self/fd (or /dev/fd on FreeBSD) if it exists. */ +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) + path = "/dev/fd"; +# else + path = "/proc/self/fd"; +# endif + dirp = opendir(path); + if (dirp == NULL) + return -1; + + while ((dent = readdir(dirp)) != NULL) { + const char *errstr; + int fd; + + fd = strtonum(dent->d_name, lowfd, INT_MAX, &errstr); + if (errstr != NULL || fd == dirfd(dirp)) + continue; + + if (fd_array_used >= fd_array_size) { + int *ptr; + + if (fd_array_size > 0) + fd_array_size *= 2; + else + fd_array_size = 32; + + ptr = reallocarray(fd_array, fd_array_size, sizeof(int)); + if (ptr == NULL) { + ret = -1; + break; + } + fd_array = ptr; + } + + fd_array[fd_array_used++] = fd; + } + + for (i = 0; i < fd_array_used; i++) + closefrom_close(fd_array[i]); + + free(fd_array); + (void)closedir(dirp); + + return ret; +} + +void +closefrom(int lowfd) +{ + if (closefrom_procfs(lowfd) == 0) + return; + + closefrom_fallback(lowfd); +} +#endif /* HAVE_FCNTL_CLOSEM */ Added: head/tools/build/cross-build/fake_sysctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/fake_sysctl.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,58 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* This file contains wrappers for sysctls used during build/install */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +int +__freebsd_sysctlbyname( + const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) +{ + if (strcmp(name, "kern.vm_guest") == 0) { + if (!oldp || !oldlenp) + errx(EX_USAGE, "Missing arguments for kern.vm_guest"); + + if (newp || newlen) + errx(EX_USAGE, "kern.vm_guest is read-only"); + strlcpy(oldp, "none", *oldlenp); + *oldlenp = strlen("none"); + } + errx(EX_USAGE, "fatal: unknown sysctl %s\n", name); +} Added: head/tools/build/cross-build/fgetln_fallback.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/fgetln_fallback.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,84 @@ +/* + * Copyright © 2005 Hector Garcia Alvarez + * Copyright © 2005, 2008-2012 Guillem Jover + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include + +#include "local-link.h" + +#define HAVE_GETLINE 1 +#ifdef HAVE_GETLINE +struct filebuf { + FILE *fp; + char *buf; + size_t len; +}; + +#define FILEBUF_POOL_ITEMS 32 + +static struct filebuf fb_pool[FILEBUF_POOL_ITEMS]; +static int fb_pool_cur; + +char * +fgetln(FILE *stream, size_t *len) +{ + struct filebuf *fb; + ssize_t nread; + + flockfile(stream); + + /* Try to diminish the possibility of several fgetln() calls being + * used on different streams, by using a pool of buffers per file. */ + fb = &fb_pool[fb_pool_cur]; + if (fb->fp != stream && fb->fp != NULL) { + fb_pool_cur++; + fb_pool_cur %= FILEBUF_POOL_ITEMS; + fb = &fb_pool[fb_pool_cur]; + } + fb->fp = stream; + + nread = getline(&fb->buf, &fb->len, stream); + + funlockfile(stream); + + /* Note: the getdelim/getline API ensures nread != 0. */ + if (nread == -1) { + *len = 0; + return NULL; + } else { + *len = (size_t)nread; + return fb->buf; + } +} +libbsd_link_warning(fgetln, + "This function cannot be safely ported, use getline(3) " + "instead, as it is supported by GNU and POSIX.1-2008.") +#else +#error "Function fgetln() needs to be ported." +#endif Added: head/tools/build/cross-build/fgetwln_fallback.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/fgetwln_fallback.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,93 @@ +/* + * Copyright 2012 Guillem Jover + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include +#include + +#include "local-link.h" + +struct filewbuf { + FILE *fp; + wchar_t *wbuf; + size_t len; +}; + +#define FILEWBUF_INIT_LEN 128 +#define FILEWBUF_POOL_ITEMS 32 + +static struct filewbuf fb_pool[FILEWBUF_POOL_ITEMS]; +static int fb_pool_cur; + +wchar_t * +fgetwln(FILE *stream, size_t *lenp) +{ + struct filewbuf *fb; + wint_t wc; + size_t wused = 0; + + /* Try to diminish the possibility of several fgetwln() calls being + * used on different streams, by using a pool of buffers per file. */ + fb = &fb_pool[fb_pool_cur]; + if (fb->fp != stream && fb->fp != NULL) { + fb_pool_cur++; + fb_pool_cur %= FILEWBUF_POOL_ITEMS; + fb = &fb_pool[fb_pool_cur]; + } + fb->fp = stream; + + while ((wc = fgetwc(stream)) != WEOF) { + if (!fb->len || wused >= fb->len) { + wchar_t *wp; + + if (fb->len) + fb->len *= 2; + else + fb->len = FILEWBUF_INIT_LEN; + + wp = reallocarray(fb->wbuf, fb->len, sizeof(wchar_t)); + if (wp == NULL) { + wused = 0; + break; + } + fb->wbuf = wp; + } + + fb->wbuf[wused++] = wc; + + if (wc == L'\n') + break; + } + + *lenp = wused; + return wused ? fb->wbuf : NULL; +} + +libbsd_link_warning(fgetwln, + "This function cannot be safely ported, use fgetwc(3) " + "instead, as it is supported by C99 and POSIX.1-2001.") Added: head/tools/build/cross-build/local-link.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/local-link.h Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,38 @@ +/* + * Copyright © 2015 Guillem Jover + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LIBBSD_LOCAL_LINK_H +#define LIBBSD_LOCAL_LINK_H + +#ifdef notyet +#define libbsd_link_warning(symbol, msg) \ + static const char libbsd_emit_link_warning_##symbol[] \ + __attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg; +#else +#define libbsd_link_warning(symbol, msg) +#endif + +#endif Added: head/tools/build/cross-build/progname.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/cross-build/progname.c Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include + +#ifdef __GLIBC__ +extern const char *__progname; +const char * +getprogname(void) +{ + return (__progname); +} +void +setprogname(const char *progname) +{ + __progname = progname; +} +#endif /* __GLIBC__ */ Added: head/tools/build/libc-bootstrap/libc_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/libc-bootstrap/libc_private.h Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#define __libc_sigprocmask(a, b, c) sigprocmask(a, b, c) Added: head/tools/build/libc-bootstrap/namespace.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/libc-bootstrap/namespace.h Tue Aug 25 13:23:31 2020 (r364759) @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2018-2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#define _open(...) open(__VA_ARGS__) +#define _close(a) close(a) +#define _fstat(a, b) fstat(a, b) +#define _read(a, b, c) read(a, b, c) +#define _write(a, b, c) write(a, b, c) +#define _writev(a, b, c) writev(a, b, c) +#define _fsync(a) fsync(a) +#define _getprogname() getprogname() +#define _err(...) err(__VA_ARGS__) + +#define _pthread_mutex_unlock pthread_mutex_unlock +#define _pthread_mutex_lock pthread_mutex_lock + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 25 13:29:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B876B3CB44A; Tue, 25 Aug 2020 13:29:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVGZ4lbWz4Pyj; Tue, 25 Aug 2020 13:29:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85FF42A178; Tue, 25 Aug 2020 13:29:58 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDTwd4055477; Tue, 25 Aug 2020 13:29:58 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDTvTR055471; Tue, 25 Aug 2020 13:29:57 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251329.07PDTvTR055471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364760 - in head: . sys/conf tools/build tools/build/bootstrap-m4 tools/build/cross-build/fake_chflags usr.bin/m4 X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . sys/conf tools/build tools/build/bootstrap-m4 tools/build/cross-build/fake_chflags usr.bin/m4 X-SVN-Commit-Revision: 364760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:29:58 -0000 Author: arichardson Date: Tue Aug 25 13:29:57 2020 New Revision: 364760 URL: https://svnweb.freebsd.org/changeset/base/364760 Log: Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD The most awkward bit in this patch is the bootstrapping of m4: We can't simply use the host version of m4 since that is not compatible with the flags passed by lex (at least on macOS, possibly also on Linux). Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also depends on lex (which needs m4 to generate any files). To work around this cyclic dependency we can build a bootstrap version of m4 (with pre-generated files) then use that to build the real m4. This patch also changes the xz/unxz/dd tools to always use the host version since the version in the source tree cannot easily be bootstrapped on macOS or Linux. Reviewed By: brooks, imp (earlier version) Differential Revision: https://reviews.freebsd.org/D25992 Added: head/tools/build/bootstrap-m4/ head/tools/build/bootstrap-m4/Makefile (contents, props changed) head/tools/build/bootstrap-m4/inittokenizer.c (contents, props changed) head/tools/build/cross-build/fake_chflags/ head/tools/build/cross-build/fake_chflags/Makefile (contents, props changed) head/tools/build/cross-build/fake_chflags/chflags (contents, props changed) Modified: head/Makefile.inc1 head/sys/conf/kern.post.mk head/tools/build/Makefile head/usr.bin/m4/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 25 13:23:31 2020 (r364759) +++ head/Makefile.inc1 Tue Aug 25 13:29:57 2020 (r364760) @@ -167,6 +167,19 @@ _t= ${TARGET_ARCH}/${TARGET} .endif .endfor +.if ${.MAKE.OS} != "FreeBSD" +CROSSBUILD_HOST=${.MAKE.OS} +.if ${.MAKE.OS} != "Linux" && ${.MAKE.OS} != "Darwin" +.warning "Unsupported crossbuild system: ${.MAKE.OS}. Build will probably fail!" +.endif +# We need to force NO_ROOT/DB_FROM_SRC builds when building on other operating +# systems since the BSD.foo.dist specs contain users and groups that do not +# exist by default on a Linux/MacOS system. +NO_ROOT:= 1 +DB_FROM_SRC:= 1 +.export NO_ROOT +.endif + # If all targets are disabled for system llvm then don't expect it to work # for cross-builds. .if !defined(TOOLS_PREFIX) && ${MK_LLVM_TARGET_ALL} == "no" && \ @@ -568,13 +581,16 @@ _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAK .endif .if make(buildworld) BUILD_ARCH!= uname -p -.if ${MACHINE_ARCH} != ${BUILD_ARCH} +# On some Linux systems uname -p returns "unknown" so skip this check there. +# This check only exists to tell people to use TARGET_ARCH instead of +# MACHINE_ARCH so skipping it when crossbuilding on non-FreeBSD should be fine. +.if ${MACHINE_ARCH} != ${BUILD_ARCH} && ${.MAKE.OS} == "FreeBSD" .error To cross-build, set TARGET_ARCH. .endif .endif WORLDTMP?= ${OBJTOP}/tmp BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec -XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin +XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin # When building we want to find the cross tools before the host tools in ${BPATH}. # We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared @@ -589,6 +605,13 @@ STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_ # USING_SYSTEM_LINKER/USING_SYSTEM_COMPILER. Once these issues have been # resolved it will be turned on by default. BUILD_WITH_STRICT_TMPPATH?=0 +.if defined(CROSSBUILD_HOST) +# When building on non-FreeBSD we can't rely on the tools in /usr/bin being compatible +# with what FreeBSD expects. Therefore we only use tools from STRICTTMPPATH +# during the world build stage. We build most tools during the bootstrap-tools +# phase but symlink host tools that are known to work instead of building them +BUILD_WITH_STRICT_TMPPATH:=1 +.endif .if ${BUILD_WITH_STRICT_TMPPATH} != 0 TMPPATH= ${STRICTTMPPATH} .else @@ -724,7 +747,9 @@ XMAKE= ${BMAKE} \ # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${BPATH}:${PATH} \ - WORLDTMP=${WORLDTMP} + WORLDTMP=${WORLDTMP} \ + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" + KTMAKE= \ TOOLS_PREFIX=${TOOLS_PREFIX_UNDEF:U${WORLDTMP}} \ ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ @@ -845,7 +870,13 @@ NO_META_IGNORE_HOST_HEADERS= 1 # allows tracking the oldest osreldate to force rebuilds via # META_MODE_BADABI_REVS above. host-osreldate.h: # DO NOT ADD /usr/include/osreldate.h here +.if !defined(CROSSBUILD_HOST) @cp -f /usr/include/osreldate.h ${.TARGET} +.else + @echo "#ifndef __FreeBSD_version" > ${.TARGET} + @echo "#define __FreeBSD_version ${OSRELDATE}" >> ${.TARGET} + @echo "#endif" >> ${.TARGET} +.endif WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ BWPHASE=${.TARGET:C,^_,,} \ @@ -1022,7 +1053,8 @@ _bootstrap-tools: @echo ">>> stage 1.2: bootstrap tools" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools - mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom + mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom \ + ${WORLDTMP}/bin ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ -p ${WORLDTMP}/usr >/dev/null ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ @@ -1277,11 +1309,15 @@ __installcheck_sh_check: .PHONY _zoneinfo= zic tzsetup .endif +.if !defined(CROSSBUILD_HOST) +_sysctl=sysctl +.endif + ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \ date echo egrep find grep id install ${_install-info} \ ln make mkdir mtree mv pwd_mkdb \ - rm sed services_mkdb sh sort strip sysctl test true uname wc ${_zoneinfo} \ - ${LOCAL_ITOOLS} + rm sed services_mkdb sh sort strip ${_sysctl} test true uname wc \ + ${_zoneinfo} ${LOCAL_ITOOLS} # Needed for share/man .if ${MK_MAN_UTILS} != "no" @@ -1317,23 +1353,25 @@ MTREE_MAGIC?= mtree 2.0 distributeworld installworld stageworld: _installcheck_world .PHONY mkdir -p ${INSTALLTMP} progs=$$(for prog in ${ITOOLS}; do \ - if progpath=`which $$prog`; then \ + if progpath=`env PATH=${TMPPATH} which $$prog`; then \ echo $$progpath; \ else \ - echo "Required tool $$prog not found in PATH." >&2; \ + echo "Required tool $$prog not found in PATH ($$PATH)." >&2; \ exit 1; \ fi; \ done); \ - libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ - while read line; do \ - set -- $$line; \ - if [ "$$2 $$3" != "not found" ]; then \ - echo $$2; \ - else \ - echo "Required library $$1 not found." >&2; \ - exit 1; \ - fi; \ - done); \ + if [ -z "${CROSSBUILD_HOST}" ] ; then \ + libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ + while read line; do \ + set -- $$line; \ + if [ "$$2 $$3" != "not found" ]; then \ + echo $$2; \ + else \ + echo "Required library $$1 not found." >&2; \ + exit 1; \ + fi; \ + done); \ + fi; \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale .if defined(NO_ROOT) @@ -2043,10 +2081,9 @@ update: .PHONY # build-tools or cross-tools. # - -# libnv is a requirement for config(8), which is an unconditional +# libnv and libsbuf are requirements for config(8), which is an unconditional # bootstrap-tool. -_config_deps= lib/libnv +_config_deps= lib/libnv lib/libsbuf legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @@ -2054,7 +2091,7 @@ legacy: .PHONY false .endif -.for _tool in tools/build ${_config_deps} +.for _tool in tools/build ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ @@ -2090,12 +2127,23 @@ _bt= _bootstrap-tools # If BOOTSTRAP_ALL_TOOLS is set we will build all the required tools from the # current source tree. Otherwise we create a symlink to the version found in # $PATH during the bootstrap-tools stage. +# When building on non-FreeBSD systems we can't assume that the host binaries +# accept compatible flags or produce compatible output. Therefore we force +# BOOTSTRAP_ALL_TOOLS and just build the FreeBSD version of the binary. +.if defined(CROSSBUILD_HOST) +BOOTSTRAP_ALL_TOOLS:= 1 +.endif .if defined(BOOTSTRAP_ALL_TOOLS) # BOOTSTRAPPING will be set on the command line so we can't override it here. # Instead set BOOTSTRAPPING_OSRELDATE so that the value 0 is set ${BSARGS} BOOTSTRAPPING_OSRELDATE:= 0 .endif +# libnv and libsbuf are requirements for config(8), which is an unconditional +# bootstrap-tool. +_config=usr.sbin/config lib/libnv lib/libsbuf +${_bt}-usr.sbin/config: ${_bt}-lib/libnv ${_bt}-lib/libsbuf + .if ${MK_GAMES} != "no" _strfile= usr.bin/fortune/strfile .endif @@ -2111,13 +2159,20 @@ _vtfontcvt= usr.bin/vtfontcvt # please ensure that you also add a .else case where you add the tool to the # _bootstrap_tools_links variable. .if ${BOOTSTRAPPING} < 1000033 -_m4= usr.bin/m4 +# Note: lex needs m4 to build but m4 also depends on lex (which needs m4 to +# generate any files). To fix this cyclic dependency we can build a bootstrap +# version of m4 (with pre-generated files) then use that to build the real m4. +# We can't simply use the host m4 since e.g. the macOS version does not accept +# the flags that are passed by lex. +# For lex we also use the pre-gerated files since we would otherwise need to +# build awk and sed first (which need lex to build) +# TODO: add a _bootstrap_lex and then build the real lex afterwards _lex= usr.bin/lex -# Note: lex needs m4 to build but m4 also depends on lex. However, lex can be -# bootstrapped so we build lex first. -${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-${_lex} -_bt_m4_depend=${_bt}-${_m4} -_bt_lex_depend=${_bt}-${_lex} ${_bt_m4_depend} +_m4= tools/build/bootstrap-m4 usr.bin/m4 +${_bt}-tools/build/bootstrap-m4: ${_bt}-usr.bin/lex ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc +${_bt}-usr.bin/m4: ${_bt}-lib/libopenbsd ${_bt}-usr.bin/yacc ${_bt}-usr.bin/lex ${_bt}-tools/build/bootstrap-m4 +_bt_m4_depend=${_bt}-usr.bin/m4 +_bt_lex_depend=${_bt}-usr.bin/lex ${_bt_m4_depend} .else _bootstrap_tools_links+=m4 lex .endif @@ -2183,12 +2238,15 @@ _bootstrap_tools_links+=crunchgen .endif # r296926 -P keymap search path, MFC to stable/10 in r298297 -.if ${BOOTSTRAPPING} < 1003501 || \ - (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) +# Note: kbdcontrol can not be bootstrapped on non-FreeBSD systems +.if !defined(CROSSBUILD_HOST) +.if (${BOOTSTRAPPING} < 1003501 || \ + (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)) _kbdcontrol= usr.sbin/kbdcontrol .else _bootstrap_tools_links+=kbdcontrol .endif +.endif _yacc= usr.bin/yacc @@ -2215,6 +2273,7 @@ ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/lib .if ${MK_LOCALES} != "no" _localedef= usr.bin/localedef +${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .endif .if ${MK_KERBEROS} != "no" @@ -2244,8 +2303,8 @@ ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd _basic_bootstrap_tools_multilink=usr.bin/grep grep,egrep,fgrep _basic_bootstrap_tools_multilink+=bin/test test,[ # bootstrap tools needed by buildworld: -_basic_bootstrap_tools=usr.bin/cut bin/expr usr.bin/gencat \ - usr.bin/join usr.bin/mktemp bin/rmdir usr.bin/sed usr.bin/sort \ +_basic_bootstrap_tools+=usr.bin/cut bin/expr usr.bin/gencat usr.bin/join \ + usr.bin/mktemp bin/realpath bin/rmdir usr.bin/sed usr.bin/sort \ usr.bin/truncate usr.bin/tsort # Some build scripts use nawk instead of awk (this happens at least in # cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh) so we need both awk @@ -2259,25 +2318,30 @@ _basic_bootstrap_tools+=usr.bin/uuencode usr.bin/uudec _basic_bootstrap_tools+=usr.bin/xargs # cap_mkdb is required for share/termcap: _basic_bootstrap_tools+=usr.bin/cap_mkdb -# ldd is required for installcheck (TODO: just always use /usr/bin/ldd instead?) -_basic_bootstrap_tools+=usr.bin/ldd # services_mkdb/pwd_mkdb are required for installworld: _basic_bootstrap_tools+=usr.sbin/services_mkdb usr.sbin/pwd_mkdb +# ldd is required for installcheck (TODO: just always use /usr/bin/ldd instead?) +.if !defined(CROSSBUILD_HOST) +# ldd is only needed for updating the running system so we don't need to +# bootstrap ldd on non-FreeBSD systems +_basic_bootstrap_tools+=usr.bin/ldd +.endif # sysctl/chflags are required for installkernel: +.if !defined(CROSSBUILD_HOST) _basic_bootstrap_tools+=sbin/sysctl bin/chflags +.else +# When building on non-FreeBSD, install a fake chflags instead since the +# version from the source tree cannot work. We also don't need sysctl since we +# are install with -DNO_ROOT. +_other_bootstrap_tools+=tools/build/cross-build/fake_chflags +.endif # mkfifo is used by sys/conf/newvers.sh _basic_bootstrap_tools+=usr.bin/mkfifo .if ${MK_BOOT} != "no" -_basic_bootstrap_tools+=bin/dd -# xz/unxz is used by EFI -_basic_bootstrap_tools_multilink+=usr.bin/xz xz,unxz # md5 is used by boot/beri (and possibly others) _basic_bootstrap_tools+=sbin/md5 -.if defined(BOOTSTRAP_ALL_TOOLS) -${_bt}-sbin/md5: ${_bt}-lib/libmd .endif -.endif .if ${MK_ZONEINFO} != "no" _basic_bootstrap_tools+=usr.sbin/zic usr.sbin/tzsetup @@ -2297,6 +2361,10 @@ ${_bt}-usr.sbin/config: ${_bt}-usr.bin/file2c ${_bt_le # `make legacy` step. Not adding a link to make is important on non-FreeBSD # since "make" will usually point to GNU make there. _other_bootstrap_tools+=usr.bin/bmake + +# Avoid dependency on host bz2 headers: +_other_bootstrap_tools+=lib/libbz2 +${_bt}-usr.bin/grep: ${_bt}-lib/libbz2 .else # All tools in _basic_bootstrap_tools have the same name as the subdirectory # so we can use :T to get the name of the symlinks that we need to create. @@ -2346,7 +2414,7 @@ bootstrap-tools: ${_bt}-links .PHONY ${_other_bootstrap_tools} \ usr.bin/xinstall \ ${_gensnmptree} \ - usr.sbin/config \ + ${_config} \ ${_flua} \ ${_crunchide} \ ${_crunchgen} \ @@ -2365,6 +2433,14 @@ ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE bootstrap-tools: ${_bt}-${_tool} .endfor +.if target(${_bt}-lib/libmd) +# If we are bootstrapping libmd (e.g. when building on macOS/Linux) add the +# necessary dependencies: +${_bt}-usr.bin/sort: ${_bt}-lib/libmd +${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd +${_bt}-sbin/md5: ${_bt}-lib/libmd +.endif + # # build-tools: Build special purpose build tools Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Aug 25 13:23:31 2020 (r364759) +++ head/sys/conf/kern.post.mk Tue Aug 25 13:29:57 2020 (r364760) @@ -395,7 +395,7 @@ kernel-install: .PHONY exit 1 ; \ fi .if exists(${DESTDIR}${KODIR}) - -thiskernel=`sysctl -n kern.bootfile` ; \ + -thiskernel=`sysctl -n kern.bootfile || echo /boot/kernel/kernel` ; \ if [ ! "`dirname "$$thiskernel"`" -ef ${DESTDIR}${KODIR} ] ; then \ chflags -R noschg ${DESTDIR}${KODIR} ; \ rm -rf ${DESTDIR}${KODIR} ; \ Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Tue Aug 25 13:23:31 2020 (r364759) +++ head/tools/build/Makefile Tue Aug 25 13:29:57 2020 (r364760) @@ -260,8 +260,8 @@ SYSINCS+= ${SRCTOP}/sys/sys/elf.h # Linux/MacOS since we only use flags that are supported by all of them. _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \ dirname echo env false find fmt gzip gunzip head hostname id ln ls \ - mkdir mv nice patch rm realpath sh sleep stat tee touch tr true \ - uname uniq wc which + mkdir mv nice patch rm sh sleep stat tee touch tr true uname uniq unxz \ + wc which xz # We also need a symlink to the absolute path to the make binary used for # the toplevel makefile. This is not necessarily the same as `which make` @@ -285,9 +285,9 @@ _host_tools_to_symlink:=${_host_tools_to_symlink:Nsh} host-symlinks: @echo "Linking host tools into ${DESTDIR}/bin" .for _tool in ${_host_tools_to_symlink} - @source_path=`which ${_tool}`; \ + @export PATH=$${PATH}:/usr/local/bin; source_path=`which ${_tool}`; \ if [ ! -e "$${source_path}" ] ; then \ - echo "Cannot find host tool '${_tool}'"; false; \ + echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \ fi; \ rm -f "${DESTDIR}/bin/${_tool}"; \ cp -pf "$${source_path}" "${DESTDIR}/bin/${_tool}" @@ -330,7 +330,7 @@ installdirs: .for _dir in sbin usr/sbin usr/bin # delete existing directories from before r340157 - @if [ ! -L ${DESTDIR}/${_dir} ]; then \ + @if [ -e ${DESTDIR}/${_dir} ] && [ ! -L ${DESTDIR}/${_dir} ]; then \ echo "removing old non-symlink ${DESTDIR}/${_dir}"; \ rm -rf "${DESTDIR}/${_dir}"; \ fi Added: head/tools/build/bootstrap-m4/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/bootstrap-m4/Makefile Tue Aug 25 13:29:57 2020 (r364760) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +# Build a bootstrap version of m4 (needed in order to build libelf and lex) +.PATH: ${SRCTOP}/usr.bin/m4 ${.CURDIR} + +# Avoid using lex or yacc to generate sources +LEX:=/this/should/not/be/used + +tokenizer.c: bootstrap_m4_tokenizer + test -e ${.TARGET} + +# This target is used as a marker in usr.bin/m4/Makefile to not add the +# lex and yacc includes. Therefore we must define it before including +# the other Makefile. +bootstrap_m4_tokenizer: inittokenizer.c +.for _f in tokenizer.c + @cmp -s ${.CURDIR}/init${_f} ${_f} || { \ + echo "Bootstrapping ${_f}" ; \ + ${CP} ${.CURDIR}/init${_f} ${_f} ; \ + } +.endfor + +BINDIR= /usr/bin +.include "${SRCTOP}/usr.bin/m4/Makefile" + +regen: + (cd ${SRCTOP}/usr.bin/m4 && lex -t ${SRCTOP}/usr.bin/m4/tokenizer.l) | grep -v '#line' > inittokenizer.c Added: head/tools/build/bootstrap-m4/inittokenizer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/bootstrap-m4/inittokenizer.c Tue Aug 25 13:29:57 2020 (r364760) @@ -0,0 +1,1850 @@ + + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 37 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +#if defined(__FreeBSD__) +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#include +#include +#else +#define __dead2 +#endif + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined(__FreeBSD__) || \ + (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart(yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +#define yy_current_buffer YY_CURRENT_BUFFER + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); + +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define yywrap() 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ) __dead2; + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 14 +#define YY_END_OF_BUFFER 15 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[35] = + { 0, + 0, 0, 15, 13, 1, 1, 13, 13, 13, 2, + 2, 13, 13, 13, 13, 1, 9, 10, 12, 2, + 0, 0, 2, 6, 4, 8, 5, 7, 11, 0, + 2, 0, 3, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 1, 5, 1, 1, + 1, 6, 1, 1, 1, 1, 1, 7, 8, 8, + 8, 8, 8, 8, 8, 9, 9, 10, 1, 11, + 12, 13, 1, 1, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 16, 15, 15, 15, 15, 15, 17, 15, 15, + 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, + + 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 16, 15, 15, 15, 15, 15, 17, + 15, 15, 1, 18, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[19] = + { 0, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, + 1, 1, 1, 3, 4, 4, 4, 1 + } ; + +static yyconst flex_int16_t yy_base[39] = + { 0, + 0, 0, 48, 49, 17, 19, 35, 41, 39, 16, + 0, 14, 32, 15, 25, 27, 49, 49, 49, 27, + 0, 0, 0, 49, 49, 49, 49, 49, 49, 32, + 0, 0, 0, 49, 39, 29, 34, 36 + } ; + +static yyconst flex_int16_t yy_def[39] = + { 0, + 34, 1, 34, 34, 34, 34, 34, 34, 34, 34, + 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 36, 37, 35, 34, 34, 34, 34, 34, 34, 36, + 37, 38, 38, 0, 34, 34, 34, 34 + } ; + +static yyconst flex_int16_t yy_nxt[68] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 11, 4, + 12, 13, 14, 4, 4, 4, 4, 15, 16, 16, + 16, 16, 20, 20, 24, 25, 27, 28, 16, 16, + 30, 21, 22, 20, 20, 31, 31, 33, 33, 33, + 23, 32, 29, 26, 19, 18, 17, 34, 3, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34 + } ; + +static yyconst flex_int16_t yy_chk[68] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, + 6, 6, 10, 10, 12, 12, 14, 14, 16, 16, + 36, 10, 10, 20, 20, 37, 37, 38, 38, 38, + 35, 30, 15, 13, 9, 8, 7, 3, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#define YY_NO_INPUT 1 +/* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ +/* + * Copyright (c) 2004 Marc Espie + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#include "parser.h" +#include +#include +#include +#include +#include + +extern void m4_warnx(const char *, ...); +extern int mimic_gnu; +extern int32_t yylval; + +int32_t number(void); +int32_t parse_radix(void); +extern int yylex(void); + +#define YY_DECL int yylex(void) + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (void ); +#else +extern int yywrap (void ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A4E23CB37B; Tue, 25 Aug 2020 13:30:07 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVGk1syTz4Ptt; Tue, 25 Aug 2020 13:30:05 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 587792A5E5; Tue, 25 Aug 2020 13:30:05 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDU5C7055576; Tue, 25 Aug 2020 13:30:05 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDU4WQ055570; Tue, 25 Aug 2020 13:30:04 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDU4WQ055570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364761 - in head: share/mk sys/conf sys/modules/cloudabi32 sys/modules/cloudabi64 sys/modules/linux sys/modules/linux64 X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: share/mk sys/conf sys/modules/cloudabi32 sys/modules/cloudabi64 sys/modules/linux sys/modules/linux64 X-SVN-Commit-Revision: 364761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:07 -0000 Author: arichardson Date: Tue Aug 25 13:30:03 2020 New Revision: 364761 URL: https://svnweb.freebsd.org/changeset/base/364761 Log: Pass -fuse-ld=/path/to/ld if ${LD} != "ld" This is needed so that setting LD/XLD is not ignored when linking with $CC instead of directly using $LD. Currently only clang accepts an absolute path for -fuse-ld= (Clang 12+ will add a new --ld-path flag), so we now warn when building with GCC and $LD != "ld" since that might result in the wrong linker being used. We have been setting XLD=/path/to/cheri/ld.lld in CheriBSD for a long time and used a similar version of this patch to avoid linking with /usr/bin/ld. This change is also required when building FreeBSD on an Ubuntu with Clang: In that case we set XCC=/usr/lib/llvm-10/bin/clang and since /usr/lib/llvm-10/bin/ does not contain a "ld" binary the build fails with `clang: error: unable to execute command: Executable "ld" doesn't exist!` unless we pass -fuse-ld=/usr/lib/llvm-10/bin/ld.lld. This change passes -fuse-ld instead of copying ${XLD} to WOLRDTMP/bin/ld since then we would have to ensure that this file does not exist while building the bootstrap tools. The cross-linker might not be compatible with the host linker (e.g. when building on macos: host-linker= Mach-O /usr/bin/ld, cross-linker=LLVM ld.lld). Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D26055 Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/modules/cloudabi32/Makefile head/sys/modules/cloudabi64/Makefile head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 25 13:29:57 2020 (r364760) +++ head/share/mk/bsd.sys.mk Tue Aug 25 13:30:03 2020 (r364761) @@ -284,6 +284,19 @@ CFLAGS+= ERROR-tried-to-rebuild-during-make-install .endif .endif +# Please keep this if in sync with kern.mk +.if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") +# Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". +# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. +.if ${COMPILER_TYPE} == "clang" +LDFLAGS+= -fuse-ld=${LD:[1]} +.else +# GCC does not support an absolute path for -fuse-ld so we just print this +# warning instead and let the user add the required symlinks. +.warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported +.endif +.endif + # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend beforeinstall \ Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/conf/kern.mk Tue Aug 25 13:30:03 2020 (r364761) @@ -270,6 +270,22 @@ CFLAGS+= -std=iso9899:1999 CFLAGS+= -std=${CSTD} .endif # CSTD +# Please keep this if in sync with bsd.sys.mk +.if ${LD} != "ld" && (${CC:[1]:H} != ${LD:[1]:H} || ${LD:[1]:T} != "ld") +# Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". +# Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. +.if ${COMPILER_TYPE} == "clang" +# Note: unlike bsd.sys.mk we can't use LDFLAGS here since that is used for the +# flags required when linking the kernel. We don't need those flags when +# building the vdsos. However, we do need -fuse-ld, so use ${CCLDFLAGS} instead. +CCLDFLAGS+= -fuse-ld=${LD:[1]} +.else +# GCC does not support an absolute path for -fuse-ld so we just print this +# warning instead and let the user add the required symlinks. +.warning LD (${LD}) is not the default linker for ${CC} but -fuse-ld= is not supported +.endif +.endif + # Set target-specific linker emulation name. LD_EMULATION_aarch64=aarch64elf LD_EMULATION_amd64=elf_x86_64_fbsd Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/conf/kern.post.mk Tue Aug 25 13:30:03 2020 (r364761) @@ -228,7 +228,7 @@ kernel-clean: # in the a.out ld. For now, this works. hack.pico: Makefile :> hack.c - ${CC} -shared ${CFLAGS} -nostdlib hack.c -o hack.pico + ${CC} ${CCLDFLAGS} -shared ${CFLAGS} -nostdlib hack.c -o hack.pico rm -f hack.c offset.inc: $S/kern/genoffset.sh genoffset.o Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi32/Makefile Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/modules/cloudabi32/Makefile Tue Aug 25 13:30:03 2020 (r364761) @@ -33,7 +33,7 @@ BINARY_ARCHITECTURE=i386 .endif cloudabi32_vdso.o: ${VDSO_SRCS} - ${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib \ + ${CC} ${CCLDFLAGS} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib \ -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \ ${VDSO_SRCS} -o ${.TARGET} Modified: head/sys/modules/cloudabi64/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/modules/cloudabi64/Makefile Tue Aug 25 13:30:03 2020 (r364761) @@ -25,7 +25,7 @@ BINARY_ARCHITECTURE=i386 .endif cloudabi64_vdso.o: ${VDSO_SRCS} - ${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib \ + ${CC} ${CCLDFLAGS} -x assembler-with-cpp -shared -nostdinc -nostdlib \ -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \ ${VDSO_SRCS} -o ${.TARGET} Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/modules/linux/Makefile Tue Aug 25 13:30:03 2020 (r364761) @@ -54,7 +54,7 @@ linux${SFX}_assym.h: linux${SFX}_genassym.o sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc - ${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s \ + ${CC} ${CCLDFLAGS} -x assembler-with-cpp -DLOCORE -m32 -shared -s \ -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -nostdinc -nostdlib \ -fno-omit-frame-pointer -fPIC \ -Wl,-T${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX}/${VDSO}.lds.s \ Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Tue Aug 25 13:29:57 2020 (r364760) +++ head/sys/modules/linux64/Makefile Tue Aug 25 13:30:03 2020 (r364761) @@ -30,7 +30,7 @@ linux_assym.h: linux_genassym.o sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET} linux_locore.o: linux_locore.asm linux_assym.h - ${CC} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \ + ${CC} ${CCLDFLAGS} -x assembler-with-cpp -DLOCORE -shared -mcmodel=small \ -pipe -I. -I${SYSDIR} ${WERROR} -Wall -fno-common -fPIC -nostdinc \ -Wl,-T${SRCTOP}/sys/${MACHINE}/linux/${VDSO}.lds.s \ -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5D0B3CB651; Tue, 25 Aug 2020 13:30:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVGp63mNz4Pxd; Tue, 25 Aug 2020 13:30:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9E52A5E6; Tue, 25 Aug 2020 13:30:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUA2x055632; Tue, 25 Aug 2020 13:30:10 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUANg055631; Tue, 25 Aug 2020 13:30:10 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUANg055631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364762 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:12 -0000 Author: arichardson Date: Tue Aug 25 13:30:09 2020 New Revision: 364762 URL: https://svnweb.freebsd.org/changeset/base/364762 Log: Fix running the builddtb target on a noexec file system Obtained from: CheriBSD Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 25 13:30:03 2020 (r364761) +++ head/Makefile.inc1 Tue Aug 25 13:30:09 2020 (r364762) @@ -3260,7 +3260,7 @@ DTBOUTPUTPATH= ${.CURDIR} # builddtb: .PHONY @PATH=${TMPPATH} MACHINE=${TARGET} \ - ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ + sh ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} ############### From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D46C93CB73D; Tue, 25 Aug 2020 13:30:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVGv4KqXz4Pxq; Tue, 25 Aug 2020 13:30:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEA092A1E1; Tue, 25 Aug 2020 13:30:14 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUEBf055687; Tue, 25 Aug 2020 13:30:14 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUE7j055686; Tue, 25 Aug 2020 13:30:14 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUE7j055686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364763 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:16 -0000 Author: arichardson Date: Tue Aug 25 13:30:14 2020 New Revision: 364763 URL: https://svnweb.freebsd.org/changeset/base/364763 Log: Use bootstrapped install(1) install of tools/install.sh in world stage This should be noticeably faster due to fewer processes being forked and also handles other flags such as -S or writing to METALOG. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D26039 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 25 13:30:09 2020 (r364762) +++ head/Makefile.inc1 Tue Aug 25 13:30:14 2020 (r364763) @@ -765,7 +765,7 @@ KTMAKE= \ # world stage WMAKEENV= ${CROSSENV} \ - INSTALL="sh ${.CURDIR}/tools/install.sh" \ + INSTALL="${INSTALL_CMD} -U" \ PATH=${TMPPATH} \ SYSROOT=${WORLDTMP} From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D90053CB6C4; Tue, 25 Aug 2020 13:30:23 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVH32g6kz4QD4; Tue, 25 Aug 2020 13:30:23 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C959B2A5E7; Tue, 25 Aug 2020 13:30:19 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUJEH055741; Tue, 25 Aug 2020 13:30:19 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUJL6055740; Tue, 25 Aug 2020 13:30:19 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUJL6055740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364764 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:24 -0000 Author: arichardson Date: Tue Aug 25 13:30:19 2020 New Revision: 364764 URL: https://svnweb.freebsd.org/changeset/base/364764 Log: Fix typo in r364325 that broke tinderbox with -DBUILD_WITH_STRICT_TMPPATH ${TARGET_ARCH} is empty here which results in empy MAKE_PARAMS being passed to the buildkernel phase. This breaks the build when using the strict TMPPATH since cc will not be included in $PATH. Reviewed By: jhb Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Aug 25 13:30:14 2020 (r364763) +++ head/Makefile Tue Aug 25 13:30:19 2020 (r364764) @@ -734,7 +734,7 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ TARGET_ARCH=${TARGET_ARCH_${kernel}} \ - ${MAKE_PARAMS_${TARGET_ARCH}} \ + ${MAKE_PARAMS_${TARGET_ARCH_${kernel}}} \ KERNCONF=${kernel} \ > _.${TARGET}.${kernel} 2>&1 || \ (echo "${TARGET} ${kernel} kernel failed," \ From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 719623CB74D; Tue, 25 Aug 2020 13:30:28 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVH73wLyz4Q9n; Tue, 25 Aug 2020 13:30:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE8BE2A45C; Tue, 25 Aug 2020 13:30:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUOVN055796; Tue, 25 Aug 2020 13:30:24 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUOZN055795; Tue, 25 Aug 2020 13:30:24 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUOZN055795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364765 - in head: sbin/newfs_msdos usr.sbin/makefs X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: sbin/newfs_msdos usr.sbin/makefs X-SVN-Commit-Revision: 364765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:28 -0000 Author: arichardson Date: Tue Aug 25 13:30:24 2020 New Revision: 364765 URL: https://svnweb.freebsd.org/changeset/base/364765 Log: Fix makefs bootstrap on macOS after D25563 The macOS assert.h header does not define static_assert when compiling in C99 mode. To fix this compile with -std=c11. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D25928 Modified: head/sbin/newfs_msdos/Makefile head/usr.sbin/makefs/Makefile Modified: head/sbin/newfs_msdos/Makefile ============================================================================== --- head/sbin/newfs_msdos/Makefile Tue Aug 25 13:30:19 2020 (r364764) +++ head/sbin/newfs_msdos/Makefile Tue Aug 25 13:30:24 2020 (r364765) @@ -9,5 +9,6 @@ SRCS= newfs_msdos.c mkfs_msdos.c .if ${MACHINE_CPUARCH} == "arm" WARNS?= 3 .endif +CSTD= c11 .include Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Tue Aug 25 13:30:19 2020 (r364764) +++ head/usr.sbin/makefs/Makefile Tue Aug 25 13:30:24 2020 (r364765) @@ -17,6 +17,7 @@ SRCS= cd9660.c \ MAN= makefs.8 WARNS?= 2 +CSTD= c11 .include "${SRCDIR}/cd9660/Makefile.inc" .include "${SRCDIR}/ffs/Makefile.inc" From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 791933CB813; Tue, 25 Aug 2020 13:30:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVHG0RgYz4QDl; Tue, 25 Aug 2020 13:30:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66E52A4DB; Tue, 25 Aug 2020 13:30:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUTPf055850; Tue, 25 Aug 2020 13:30:29 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUT3q055849; Tue, 25 Aug 2020 13:30:29 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUT3q055849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364766 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 364766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:34 -0000 Author: arichardson Date: Tue Aug 25 13:30:29 2020 New Revision: 364766 URL: https://svnweb.freebsd.org/changeset/base/364766 Log: style.Makefile: list CSTD between WARNS and CFLAGS This was suggested by emaste in https://reviews.freebsd.org/D25928 and matches most uses in the tree. Modified: head/share/man/man5/style.Makefile.5 Modified: head/share/man/man5/style.Makefile.5 ============================================================================== --- head/share/man/man5/style.Makefile.5 Tue Aug 25 13:30:24 2020 (r364765) +++ head/share/man/man5/style.Makefile.5 Tue Aug 25 13:30:29 2020 (r364766) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2015 +.Dd August 25, 2020 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -78,6 +78,7 @@ order is: .Va INCS .Va SRCS .Va WARNS +.Va CSTD .Va CFLAGS .Va DPADD .Va LDADD . @@ -87,6 +88,7 @@ order is: .Va PROG Ns / Ns Oo Va SH Oc Ns Va LIB Ns / Ns Va SCRIPTS .Va SRCS .Va WARNS +.Va CSTD .Va CFLAGS .Va DPADD .Va LDADD From owner-svn-src-head@freebsd.org Tue Aug 25 13:30:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D2D43CB3FD; Tue, 25 Aug 2020 13:30:40 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVHM1RfCz4QHF; Tue, 25 Aug 2020 13:30:38 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 790D82A75E; Tue, 25 Aug 2020 13:30:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDUZ15055905; Tue, 25 Aug 2020 13:30:35 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDUZam055903; Tue, 25 Aug 2020 13:30:35 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008251330.07PDUZam055903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 25 Aug 2020 13:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364767 - in head: contrib/lua/src lib/liblua X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: contrib/lua/src lib/liblua X-SVN-Commit-Revision: 364767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:30:40 -0000 Author: arichardson Date: Tue Aug 25 13:30:34 2020 New Revision: 364767 URL: https://svnweb.freebsd.org/changeset/base/364767 Log: Fix -Wundef warnings when building liblua We need to define the LUA_FLOAT_INT64 macro even if we don't use it (copied from stand/luaconf.h). While touching luaconf.h.dist also sync it with the the 5.3.5 release version (matches the one in lib/liblua). Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D25977 Modified: head/contrib/lua/src/luaconf.h.dist head/lib/liblua/luaconf.h Modified: head/contrib/lua/src/luaconf.h.dist ============================================================================== --- head/contrib/lua/src/luaconf.h.dist Tue Aug 25 13:30:29 2020 (r364766) +++ head/contrib/lua/src/luaconf.h.dist Tue Aug 25 13:30:34 2020 (r364767) @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $ +** $Id: luaconf.h,v 1.259.1.1 2017/04/19 17:29:57 roberto Exp $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -114,6 +114,7 @@ #define LUA_FLOAT_FLOAT 1 #define LUA_FLOAT_DOUBLE 2 #define LUA_FLOAT_LONGDOUBLE 3 +#define LUA_FLOAT_INT64 4 #if defined(LUA_32BITS) /* { */ /* @@ -618,6 +619,13 @@ #if !defined(LUA_USE_C89) #define lua_strx2number(s,p) lua_str2number(s,p) #endif + + +/* +@@ lua_pointer2str converts a pointer to a readable string in a +** non-specified way. +*/ +#define lua_pointer2str(buff,sz,p) l_sprintf(buff,sz,"%p",p) /* Modified: head/lib/liblua/luaconf.h ============================================================================== --- head/lib/liblua/luaconf.h Tue Aug 25 13:30:29 2020 (r364766) +++ head/lib/liblua/luaconf.h Tue Aug 25 13:30:34 2020 (r364767) @@ -122,6 +122,7 @@ #define LUA_FLOAT_FLOAT 1 #define LUA_FLOAT_DOUBLE 2 #define LUA_FLOAT_LONGDOUBLE 3 +#define LUA_FLOAT_INT64 4 #if defined(LUA_32BITS) /* { */ /* From owner-svn-src-head@freebsd.org Tue Aug 25 13:45:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 697523CC14B; Tue, 25 Aug 2020 13:45:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbVc325jhz4SBL; Tue, 25 Aug 2020 13:45:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2717B2AB20; Tue, 25 Aug 2020 13:45:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PDj7TB067489; Tue, 25 Aug 2020 13:45:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PDj609067488; Tue, 25 Aug 2020 13:45:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008251345.07PDj609067488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 25 Aug 2020 13:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364768 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 364768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 13:45:07 -0000 Author: markj Date: Tue Aug 25 13:45:06 2020 New Revision: 364768 URL: https://svnweb.freebsd.org/changeset/base/364768 Log: Permit vm_page_wire() to be called on pages not belonging to an object. For such pages ref_count is effectively a consumer-managed field, but there is no harm in calling vm_page_wire() on them. vm_page_unwire_noq() handles them as well. Relax the vm_page_wire() assertions to permit this case which is triggered by some out-of-tree code. [1] Also guard a conditional assertion with INVARIANTS. Otherwise the conditions are evaluated even though the result is unused. [2] Reported by: bz, cem [1], kib [2] Reviewed by: dougm, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26173 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Aug 25 13:30:34 2020 (r364767) +++ head/sys/vm/vm_page.c Tue Aug 25 13:45:06 2020 (r364768) @@ -3854,18 +3854,19 @@ vm_page_free_pages_toq(struct spglist *free, bool upda } /* - * Mark this page as wired down, preventing reclamation by the page daemon - * or when the containing object is destroyed. + * Mark this page as wired down. For managed pages, this prevents reclamation + * by the page daemon, or when the containing object, if any, is destroyed. */ void vm_page_wire(vm_page_t m) { u_int old; - KASSERT(m->object != NULL, - ("vm_page_wire: page %p does not belong to an object", m)); - if (!vm_page_busied(m) && !vm_object_busied(m->object)) +#ifdef INVARIANTS + if (m->object != NULL && !vm_page_busied(m) && + !vm_object_busied(m->object)) VM_OBJECT_ASSERT_LOCKED(m->object); +#endif KASSERT((m->flags & PG_FICTITIOUS) == 0 || VPRC_WIRE_COUNT(m->ref_count) >= 1, ("vm_page_wire: fictitious page %p has zero wirings", m)); From owner-svn-src-head@freebsd.org Tue Aug 25 14:18:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AD483CCE34; Tue, 25 Aug 2020 14:18:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbWLz2hdzz4TkK; Tue, 25 Aug 2020 14:18:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D472ADD2; Tue, 25 Aug 2020 14:18:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PEIpPn086227; Tue, 25 Aug 2020 14:18:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PEIoBB086223; Tue, 25 Aug 2020 14:18:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008251418.07PEIoBB086223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 25 Aug 2020 14:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364769 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 364769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 14:18:51 -0000 Author: mjg Date: Tue Aug 25 14:18:50 2020 New Revision: 364769 URL: https://svnweb.freebsd.org/changeset/base/364769 Log: vfs: respect PRIV_VFS_LOOKUP in vaccess_smr Reported by: novel Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_priv.c head/sys/kern/vfs_subr.c head/sys/sys/priv.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Aug 25 13:45:06 2020 (r364768) +++ head/sys/kern/kern_jail.c Tue Aug 25 14:18:50 2020 (r364769) @@ -3049,6 +3049,7 @@ prison_priv_check(struct ucred *cred, int priv) * called for them. See priv_check_cred(). */ switch (priv) { + case PRIV_VFS_LOOKUP: case PRIV_VFS_GENERATION: KASSERT(0, ("prison_priv_check instead of a custom handler " "called for %d\n", priv)); @@ -3277,7 +3278,6 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_VFS_WRITE: case PRIV_VFS_ADMIN: case PRIV_VFS_EXEC: - case PRIV_VFS_LOOKUP: case PRIV_VFS_BLOCKRESERVE: /* XXXRW: Slightly surprising. */ case PRIV_VFS_CHFLAGS_DEV: case PRIV_VFS_CHOWN: Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Tue Aug 25 13:45:06 2020 (r364768) +++ head/sys/kern/kern_priv.c Tue Aug 25 14:18:50 2020 (r364769) @@ -129,6 +129,8 @@ priv_check_cred(struct ucred *cred, int priv) priv)); switch (priv) { + case PRIV_VFS_LOOKUP: + return (priv_check_cred_vfs_lookup(cred)); case PRIV_VFS_GENERATION: return (priv_check_cred_vfs_generation(cred)); } @@ -245,6 +247,56 @@ priv_check(struct thread *td, int priv) KASSERT(td == curthread, ("priv_check: td != curthread")); return (priv_check_cred(td->td_ucred, priv)); +} + +static int __noinline +priv_check_cred_vfs_lookup_slow(struct ucred *cred) +{ + int error; + + error = priv_check_cred_pre(cred, PRIV_VFS_LOOKUP); + if (error) + goto out; + + if (cred->cr_uid == 0 && suser_enabled) { + error = 0; + goto out; + } + + return (priv_check_cred_post(cred, PRIV_VFS_LOOKUP, error, false)); +out: + return (priv_check_cred_post(cred, PRIV_VFS_LOOKUP, error, true)); + +} + +int +priv_check_cred_vfs_lookup(struct ucred *cred) +{ + int error; + + if (__predict_false(mac_priv_check_fp_flag || + mac_priv_grant_fp_flag || SDT_PROBES_ENABLED())) + return (priv_check_cred_vfs_lookup_slow(cred)); + + error = EPERM; + if (cred->cr_uid == 0 && suser_enabled) + error = 0; + return (error); +} + +int +priv_check_cred_vfs_lookup_nomac(struct ucred *cred) +{ + int error; + + if (__predict_false(mac_priv_check_fp_flag || + mac_priv_grant_fp_flag || SDT_PROBES_ENABLED())) + return (EAGAIN); + + error = EPERM; + if (cred->cr_uid == 0 && suser_enabled) + error = 0; + return (error); } static int __noinline Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 25 13:45:06 2020 (r364768) +++ head/sys/kern/vfs_subr.c Tue Aug 25 14:18:50 2020 (r364769) @@ -5045,6 +5045,7 @@ vn_isdisk(struct vnode *vp) int vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred) { + int error; VFS_SMR_ASSERT_ENTERED(); @@ -5067,7 +5068,9 @@ vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gi return (0); out_error: /* - * Permission check failed. + * Permission check failed, but it is possible denial will get overwritten + * (e.g., when root is traversing through a 700 directory owned by someone + * else). * * vaccess() calls priv_check_cred which in turn can descent into MAC * modules overriding this result. It's quite unclear what semantics @@ -5075,9 +5078,20 @@ out_error: * from within the SMR section. This also means if any such modules * are present, we have to let the regular lookup decide. */ - if (__predict_false(mac_priv_check_fp_flag || mac_priv_grant_fp_flag)) + error = priv_check_cred_vfs_lookup_nomac(cred); + switch (error) { + case 0: + return (0); + case EAGAIN: + /* + * MAC modules present. + */ return (EAGAIN); - return (EACCES); + case EPERM: + return (EACCES); + default: + return (error); + } } /* Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Tue Aug 25 13:45:06 2020 (r364768) +++ head/sys/sys/priv.h Tue Aug 25 14:18:50 2020 (r364769) @@ -536,6 +536,8 @@ struct thread; struct ucred; int priv_check(struct thread *td, int priv); int priv_check_cred(struct ucred *cred, int priv); +int priv_check_cred_vfs_lookup(struct ucred *cred); +int priv_check_cred_vfs_lookup_nomac(struct ucred *cred); int priv_check_cred_vfs_generation(struct ucred *cred); #endif From owner-svn-src-head@freebsd.org Tue Aug 25 14:39:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A7053CD152; Tue, 25 Aug 2020 14:39:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbWpl1jLJz4VrJ; Tue, 25 Aug 2020 14:39:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from localhost (unknown [IPv6:2400:4051:a743:3c00:16:ceff:fe34:2700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: hrs) by smtp.freebsd.org (Postfix) with ESMTPSA id 1FBB216731; Tue, 25 Aug 2020 14:39:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Date: Tue, 25 Aug 2020 23:21:47 +0900 (JST) Message-Id: <20200825.232147.141648624023404568.hrs@FreeBSD.org> To: gbe@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364449 - head/bin/ls From: Hiroki Sato In-Reply-To: <20200824085223.GA28970@lion.0xfce3.net> References: <202008210620.07L6KC6M091289@repo.freebsd.org> <20200822.194438.808130473746317382.hrs@FreeBSD.org> <20200824085223.GA28970@lion.0xfce3.net> X-Old-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-PGPkey-fingerprint: 6C0D 2353 27CF 80C7 901E FDD2 DBB0 7DC6 6F1F 737F X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha512; boundary="--Security_Multipart(Tue_Aug_25_23_21_47_2020_675)--" Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 14:39:27 -0000 ----Security_Multipart(Tue_Aug_25_23_21_47_2020_675)-- Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: base64 R29yZG9uIEJlcmdsaW5nIDxnYmVAZnJlZWJzZC5vcmc+IHdyb3RlDQogIGluIDwyMDIwMDgyNDA4 NTIyMy5HQTI4OTcwQGxpb24uMHhmY2UzLm5ldD46DQoNCmdiPiB0aGFua3MgZm9yIHlvdXIgZmVl ZGJhY2suIEkgY2FuIG9ubHkgZGVmaW5lIFBPU0lYLjEtMjAwezEsOH0gb3IgLXN1c3Y0LiBTbyB3 aGF0DQpnYj4gZG8geW91IHRoaW5rIGFib3V0IHRoZSBmb2xsb3dpbmcgU1RBTkRBUkRTIHNlY3Rp b24/DQpnYj4gDQpnYj4gRm9yIHRoZSBvcHRpb25zIHRoYXQgYXJlIG5vbi1leGlzdGluZyBJIGNv dWxkIGNvcnJlY3QgdGhlbSB0byAtMjAwMSBhbmQgbWVudGlvbg0KZ2I+IGFsc28gLXN1c3Y0Lg0K Z2I+IA0KZ2I+IFNUQU5EQVJEUw0KZ2I+ICAgICAgV2l0aCB0aGUgZXhjZXB0aW9uIG9mIG9wdGlv bnMgLWcsIC1uIGFuZCAtbywgdGhlIGxzIHV0aWxpdHkgY29uZm9ybXMgdG8NCmdiPiAgICAgIElF RUUgU3RkIDEwMDMuMS0yMDAxICjigJxQT1NJWC4x4oCdKSBhbmQgVmVyc2lvbsKgNCBvZiB0aGUg U2luZ2xlIFVOSVgNCmdiPiAgICAgIFNwZWNpZmljYXRpb24gKOKAnFNVU3Y04oCdKS4gIFRoZSBv cHRpb25zIC1CLCAtRCwgLUcsIC1JLCAtVCwgLVUsIC1XLCAtWiwgLWIsDQpnYj4gICAgICAtaCwg LXcsIC15IGFuZCAtLCBhcmUgY29tcGF0aWJsZSBleHRlbnNpb25zIG5vdCBkZWZpbmVkIGluIElF RUUgU3RkDQpnYj4gICAgICAxMDAzLjEtMjAwMSAo4oCcUE9TSVguMeKAnSkuDQoNCiBJdCBtaWdo dCBiZSBhIGJpdCB0ZWRpb3VzLCBidXQganVzdCBhZGRpbmcgLTIwMDggbG9va3MgZ29vZCB0byBt ZQ0KIGxpa2UgdGhlIGZvbGxvd2luZzoNCg0KIHwuU3QgLXAxMDAzLjEtMjAwMQ0KIHxhbmQNCiB8 LlN0IC1wMTAwMy4xLTIwMDggLg0KDQogcDEwMDMuMS0yMDA0IGlzIGEgc3Vic2V0IG9mIFNVU3Yz IChhbmQgLTIwMDggaXMgb25lIG9mIFNVU3Y0KSwgc28NCiB1c2luZyBwMTAwMy4xLVlZWVkgY29u c2lzdGVudGx5IHNvdW5kcyBsZXNzIGNvbmZ1c2luZyB3aGVuIGRlc2NyaWJpbmcNCiB0aGUgY29u Zm9ybWFuY2Ugd2l0aGluIHRoZSBzdWJzZXRzLg0KDQogUmVnYXJkaW5nIHRoZSBub24tc3RhbmRh cmQgZXh0ZW5zaW9ucywgSSBhbSBub3Qgc3VyZSB3aGF0DQogImNvbXBhdGlibGUiIG1lYW5zLiAg U29tZSBvZiB0aGVtIGFyZSBleHRlbnNpb25zIGNvbW1vbmx5IHNlZW4gb24NCiBvdGhlciBCU0Qt ZGVyaXZlZCBPU2VzLCBzb21lIGFyZSBhdmFpbGFibGUgb25seSBvbiBGcmVlQlNELCBhbmQgc29t ZQ0KIGhhdmUgdGhlIHNhbWUgbmFtZXMgd2l0aCBHTlUncyBjb3VudGVycGFydCBidXQgZGlmZmVy ZW50IG1lYW5pbmdzLg0KIElzIGp1c3QgbWVudGlvbmluZyAiLi4uYXJlIG5vbi1zdGFuZGFyZCBl eHRlbnNpb25zIiB3aXRoIG5vDQogc3BlY2lmaWNhdGlvbiBuYW1lIHN1ZmZpY2llbnQgYW5kIGVh c2llcj8gIEkgaGF2ZSBubyBzdHJvbmcgb3Bpbmlvbg0KIG9uIHRoYXQgcGFydCwgYnV0IHRoaXMg aXMganVzdCBteSB0d28gY2VudHMuDQoNCi0tIEhpcm9raQ0K ----Security_Multipart(Tue_Aug_25_23_21_47_2020_675)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iMkEABMKAC4WIQRsDSNTJ8+Ax5Ae/dLbsH3Gbx9zfwUCX0UeexAcaHJzQGZyZWVi c2Qub3JnAAoJENuwfcZvH3N/J4MCCJNE4t7/7mtqF3SE1THStB7TIGlkmxsX/vMJ Quvg7LeimkMm6T76raLpC0dXYvdkFOwTID84mRvpoIHYwtZhbM+JAgkBExIRrgdM nUEtp8WSuikc35kXrkkHbZwfg/mmhATv/TIZltbRRwhf9N7UVO+QobVsZvbFFWP0 0j34RSAR9dLusGQ= =PiaP -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Aug_25_23_21_47_2020_675)---- From owner-svn-src-head@freebsd.org Tue Aug 25 15:19:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC4BF3CE57A; Tue, 25 Aug 2020 15:19:45 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbXjF46jbz4YZ3; Tue, 25 Aug 2020 15:19:45 +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 7093A2BC8E; Tue, 25 Aug 2020 15:19:45 +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 07PFJj3X023538; Tue, 25 Aug 2020 15:19:45 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PFJjpW023537; Tue, 25 Aug 2020 15:19:45 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008251519.07PFJjpW023537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Tue, 25 Aug 2020 15:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364770 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 364770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 15:19:45 -0000 Author: vmaffione Date: Tue Aug 25 15:19:45 2020 New Revision: 364770 URL: https://svnweb.freebsd.org/changeset/base/364770 Log: iflib: netmap: publish all the receive buffer At initialization time, the netmap RX refill function used to prepare the NIC RX ring with N-1 buffers rather than N (with N equal to the number of descriptors in the NIC RX ring). This is not how netmap is supposed to work, as it would keep kring->nr_hwcur not in sync with the NIC "next index to refill" (i.e., fl->ifl_pidx). Instead we prepare N buffers, although we still publish (with isc_rxd_flush()) only the first N-1 buffers, to avoid the NIC producer pointer to overrun the NIC consumer pointer (for NICs where this is a real issue, e.g. Intel ones). MFC after: 2 weeks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Aug 25 14:18:50 2020 (r364769) +++ head/sys/net/iflib.c Tue Aug 25 15:19:45 2020 (r364770) @@ -832,7 +832,6 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring { struct netmap_adapter *na = kring->na; u_int const lim = kring->nkr_num_slots - 1; - u_int head = kring->rhead; u_int nm_i = kring->nr_hwcur; struct netmap_ring *ring = kring->ring; bus_dmamap_t *map; @@ -840,39 +839,46 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring if_ctx_t ctx = rxq->ifr_ctx; iflib_fl_t fl = &rxq->ifr_fl[0]; u_int nic_i_first, nic_i; - int i; + int i, n; #if IFLIB_DEBUG_COUNTERS int rf_count = 0; #endif /* - * Netmap requires that we leave (at least) one free slot - * in the ring, so that it can distinguish between an empty - * ring (nr_hwcur == nr_hwtail, i.e. all the buffers owned by the - * user) and a full ring (nr_hwtail == (nr_hwcur - 1) mod N, i.e. - * all the buffers owned by the kernel). - * We thus set head (the refill limit) to nr_hwcur - 1 - * at initialization. The rest of the code will then make sure - * than nr_hwtail never overcomes nr_hwcur. + * This function is used both at initialization and in rxsync. + * At initialization we need to prepare (with isc_rxd_refill()) + * all the (N) netmap buffers in the ring, in such a way to keep + * fl->ifl_pidx and kring->nr_hwcur in sync (except for + * kring->nkr_hwofs); at rxsync time, both indexes point to the + * next buffer to be refilled. + * In any case we publish (with isc_rxd_flush()) up to + * (fl->ifl_pidx - 1) % N (included), to avoid the NIC tail/prod + * pointer to overrun the head/cons pointer, although this is + * not necessary for some NICs (e.g. vmx). */ - if (__predict_false(init)) { - head = nm_prev(nm_i, lim); - } else if (nm_i == head) { - /* Nothing to do. We can leave early. */ - return (0); + if (__predict_false(init)) + n = kring->nkr_num_slots; + else { + n = kring->rhead - nm_i; + if (n == 0) + return (0); /* Nothing to do. */ + if (n < 0) + n += kring->nkr_num_slots; } + /* Start to refill from nr_hwcur, publishing n buffers. */ iru_init(&iru, rxq, 0 /* flid */); map = fl->ifl_sds.ifsd_map; - nic_i = netmap_idx_k2n(kring, nm_i); + nic_i = fl->ifl_pidx; + MPASS(nic_i == netmap_idx_k2n(kring, nm_i)); DBG_COUNTER_INC(fl_refills); - while (nm_i != head) { + while (n > 0) { #if IFLIB_DEBUG_COUNTERS if (++rf_count == 9) DBG_COUNTER_INC(fl_refills_large); #endif nic_i_first = nic_i; - for (i = 0; i < IFLIB_MAX_RX_REFRESH && nm_i != head; i++) { + for (i = 0; n > 0 && i < IFLIB_MAX_RX_REFRESH; n--, i++) { struct netmap_slot *slot = &ring->slot[nm_i]; void *addr = PNMB(na, slot, &fl->ifl_bus_addrs[i]); @@ -903,11 +909,11 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring iru.iru_count = i; ctx->isc_rxd_refill(ctx->ifc_softc, &iru); } - kring->nr_hwcur = head; + fl->ifl_pidx = nic_i; + MPASS(!init || nm_i == 0); + MPASS(nm_i == kring->rhead); + kring->nr_hwcur = nm_i; - /* The pidx argument of isc_rxd_flush() is the index of the last valid - * slot in the free list ring. We need therefore to decrement nic_i, - * similarly to what happens in iflib_fl_refill() for ifl_pidx. */ bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, rxq->ifr_id, fl->ifl_id, From owner-svn-src-head@freebsd.org Tue Aug 25 16:09:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AF153CFF93; Tue, 25 Aug 2020 16:09:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbYpX3cNpz4cgF; Tue, 25 Aug 2020 16:09:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F2592C556; Tue, 25 Aug 2020 16:09:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PG9Oip054168; Tue, 25 Aug 2020 16:09:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PG9NDP054163; Tue, 25 Aug 2020 16:09:23 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202008251609.07PG9NDP054163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 25 Aug 2020 16:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364771 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 364771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 16:09:24 -0000 Author: bz Date: Tue Aug 25 16:09:23 2020 New Revision: 364771 URL: https://svnweb.freebsd.org/changeset/base/364771 Log: rtsol(d): add script for "M bit" While we do support the "O bit" running a script (usually to start a dhcpv6 client) we have no options for setups which set the "M bit" for, e.g., static address assignment as in EC2. Duplicate most of the "O bit" logic to also start a script for the "M bit" with the one difference: if the "M bit" is set we will not start the script for the "O bit" as well (per RFC 4861, Section 4.2). Reviewed by: hrs, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26099 Modified: head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.8 head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/usr.sbin/rtsold/dump.c ============================================================================== --- head/usr.sbin/rtsold/dump.c Tue Aug 25 15:19:45 2020 (r364770) +++ head/usr.sbin/rtsold/dump.c Tue Aug 25 16:09:23 2020 (r364771) @@ -84,6 +84,8 @@ rtsold_dump(FILE *fp) } fprintf(fp, " interface status: %s\n", ifi->active > 0 ? "active" : "inactive"); + fprintf(fp, " managed config: %s\n", + ifi->managedconfig ? "on" : "off"); fprintf(fp, " other config: %s\n", ifi->otherconfig ? "on" : "off"); fprintf(fp, " rtsold status: %s\n", ifstatstr[ifi->state]); Modified: head/usr.sbin/rtsold/rtsol.c ============================================================================== --- head/usr.sbin/rtsold/rtsol.c Tue Aug 25 15:19:45 2020 (r364770) +++ head/usr.sbin/rtsold/rtsol.c Tue Aug 25 16:09:23 2020 (r364771) @@ -79,6 +79,7 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, stru struct script_msg_head_t *, struct script_msg_head_t *); static char *make_rsid(const char *, const char *, struct rainfo *); +#define _ARGS_MANAGED managedconf_script, ifi->ifname #define _ARGS_OTHER otherconf_script, ifi->ifname #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid @@ -291,18 +292,36 @@ rtsol_input(int sock) nd_ra = (struct nd_router_advert *)icp; /* + * Process the "M bit." + * If the value of ManagedConfigFlag changes from FALSE to TRUE, the + * host should invoke the stateful autoconfiguration protocol, + * requesting information. + * [RFC 4861 Section 4.2] + * XXX ??? [draft-ietf-v6ops-dhcpv6-slaac-problem-07] + */ + if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) && + !ifi->managedconfig) { + warnmsg(LOG_DEBUG, __func__, + "ManagedConfigFlag on %s is turned on", ifi->ifname); + ifi->managedconfig = 1; + CALL_SCRIPT(MANAGED, NULL); + } + + /* * Process the "O bit." * If the value of OtherConfigFlag changes from FALSE to TRUE, the * host should invoke the stateful autoconfiguration protocol, - * requesting information. - * [RFC 2462 Section 5.5.3] + * requesting information unless the "M bit" was set as well in + * which case the "O bit" is redundant. + * [RFC 4861 Section 4.2] */ if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) && !ifi->otherconfig) { warnmsg(LOG_DEBUG, __func__, "OtherConfigFlag on %s is turned on", ifi->ifname); ifi->otherconfig = 1; - CALL_SCRIPT(OTHER, NULL); + if (!ifi->managedconfig) + CALL_SCRIPT(OTHER, NULL); } clock_gettime(CLOCK_MONOTONIC_FAST, &now); newent_rai = 0; Modified: head/usr.sbin/rtsold/rtsold.8 ============================================================================== --- head/usr.sbin/rtsold/rtsold.8 Tue Aug 25 15:19:45 2020 (r364770) +++ head/usr.sbin/rtsold/rtsold.8 Tue Aug 25 16:09:23 2020 (r364771) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2011 +.Dd August 19, 2020 .Dt RTSOLD 8 .Os .\" @@ -40,23 +40,27 @@ .Sh SYNOPSIS .Nm .Op Fl dDfFmu1 +.Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl p Ar pidfile .Op Fl R Ar script-name .Ar interface ... .Nm .Op Fl dDfFmu1 +.Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl p Ar pidfile .Op Fl R Ar script-name .Fl a .Nm rtsol .Op Fl dDu +.Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl R Ar script-name .Ar interface ... .Nm rtsol .Op Fl dDu +.Op Fl M Ar script-name .Op Fl O Ar script-name .Op Fl R Ar script-name .Fl a @@ -208,6 +212,20 @@ Transmit Router Solicitation packets until at least on Advertisement packet has arrived on each .Ar interface , then exit. +.It Fl M Ar script-name +Specifies a supplement script file to handle the Managed Configuration +flag of the router advertisement. +When the flag changes from FALSE to TRUE, +.Nm +will invoke +.Ar script-name +with a single argument of the receiving interface name, +expecting the script will then start a protocol for the managed +configuration. +.Ar script-name +must be the absolute path from root to the script file, be a regular +file, and be created by the same owner who runs +.Nm . .It Fl O Ar script-name Specifies a supplement script file to handle the Other Configuration flag of the router advertisement. @@ -218,6 +236,8 @@ will invoke with a single argument of the receiving interface name, expecting the script will then start a protocol for the other configuration. +The script will not be run if the Managed Configuration flag in the +router advertisement is also TRUE. .Ar script-name must be the absolute path from root to the script file, be a regular file, and be created by the same owner who runs Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Tue Aug 25 15:19:45 2020 (r364770) +++ head/usr.sbin/rtsold/rtsold.c Tue Aug 25 16:09:23 2020 (r364771) @@ -80,6 +80,7 @@ int aflag = 0; int dflag = 0; int uflag = 0; +const char *managedconf_script; const char *otherconf_script; const char *resolvconf_script = "/sbin/resolvconf"; @@ -124,11 +125,11 @@ main(int argc, char **argv) progname = basename(argv[0]); if (strcmp(progname, "rtsold") == 0) { - opts = "adDfFm1O:p:R:u"; + opts = "adDfFm1M:O:p:R:u"; once = 0; pidfilepath = NULL; } else { - opts = "adDFO:R:u"; + opts = "adDFM:O:R:u"; fflag = 1; once = 1; } @@ -156,6 +157,9 @@ main(int argc, char **argv) case '1': once = 1; break; + case 'M': + managedconf_script = optarg; + break; case 'O': otherconf_script = optarg; break; @@ -190,6 +194,9 @@ main(int argc, char **argv) else log_upto = LOG_NOTICE; + if (managedconf_script != NULL && *managedconf_script != '/') + errx(1, "configuration script (%s) must be an absolute path", + managedconf_script); if (otherconf_script != NULL && *otherconf_script != '/') errx(1, "configuration script (%s) must be an absolute path", otherconf_script); @@ -324,9 +331,11 @@ static int init_capabilities(void) { #ifdef WITH_CASPER - const char *const scripts[2] = { resolvconf_script, otherconf_script }; + const char *const scripts[] = + { resolvconf_script, managedconf_script, otherconf_script }; cap_channel_t *capcasper; nvlist_t *limits; + int count; capcasper = cap_init(); if (capcasper == NULL) @@ -339,9 +348,12 @@ init_capabilities(void) capscript = cap_service_open(capcasper, "rtsold.script"); if (capscript == NULL) return (-1); + count = 0; + for (size_t i = 0; i < nitems(scripts); i++) + if (scripts[i] != NULL) + count++; limits = nvlist_create(0); - nvlist_add_string_array(limits, "scripts", scripts, - otherconf_script != NULL ? 2 : 1); + nvlist_add_string_array(limits, "scripts", scripts, count); if (cap_limit_set(capscript, limits) != 0) return (-1); @@ -597,10 +609,12 @@ rtsol_check_timer(void) /* * If we need a probe, clear the previous - * status wrt the "other" configuration. + * status wrt the "managed/other" configuration. */ - if (probe) + if (probe) { + ifi->managedconfig = 0; ifi->otherconfig = 0; + } if (probe && mobile_node) { error = cap_probe_defrouters(capsendmsg, ifi); Modified: head/usr.sbin/rtsold/rtsold.h ============================================================================== --- head/usr.sbin/rtsold/rtsold.h Tue Aug 25 15:19:45 2020 (r364770) +++ head/usr.sbin/rtsold/rtsold.h Tue Aug 25 16:09:23 2020 (r364771) @@ -71,6 +71,8 @@ struct ifinfo { int probeinterval; /* interval of probe timer (if necessary) */ int probetimer; /* rest of probe timer */ int mediareqok; /* whether the IF supports SIOCGIFMEDIA */ + int managedconfig; /* need a separate protocol for the "managed" + * configuration */ int otherconfig; /* need a separate protocol for the "other" * configuration */ int state; @@ -156,6 +158,7 @@ extern int dflag; extern int aflag; extern int Fflag; extern int uflag; +extern const char *managedconf_script; extern const char *otherconf_script; extern const char *resolvconf_script; extern struct cap_channel *capllflags, *capscript, *capsendmsg, *capsyslog; From owner-svn-src-head@freebsd.org Tue Aug 25 17:19:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 806C63B243E; Tue, 25 Aug 2020 17:19:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbbM82p3Pz3TtM; Tue, 25 Aug 2020 17:19:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 426E32D521; Tue, 25 Aug 2020 17:19:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PHJGjQ097748; Tue, 25 Aug 2020 17:19:16 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PHJG9t097747; Tue, 25 Aug 2020 17:19:16 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008251719.07PHJG9t097747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 17:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364772 - head X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 17:19:16 -0000 Author: mmacy Date: Tue Aug 25 17:19:15 2020 New Revision: 364772 URL: https://svnweb.freebsd.org/changeset/base/364772 Log: Give stronger guidance with regards to upgrading root pools Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Aug 25 16:09:23 2020 (r364771) +++ head/UPDATING Tue Aug 25 17:19:15 2020 (r364772) @@ -27,9 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20200824: - OpenZFS support has been integrated. We caution against 'zpool upgrade' - for the next few weeks. The change should be transparent unless you - want to use new features. + OpenZFS support has been integrated. Do not upgrade root pools until + the loader is updated to support zstd. Furthermore, we caution against + 'zpool upgrade' for the next few weeks. The change should be transparent + unless you want to use new features. The resume code now notifies devd with the 'kernel' system From owner-svn-src-head@freebsd.org Tue Aug 25 17:23:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68A613B2A01; Tue, 25 Aug 2020 17:23:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbbS61r9Rz3V8f; Tue, 25 Aug 2020 17:23:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224B22D887; Tue, 25 Aug 2020 17:23:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PHNXER004010; Tue, 25 Aug 2020 17:23:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PHNXU1004009; Tue, 25 Aug 2020 17:23:33 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008251723.07PHNXU1004009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 17:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364773 - head/stand/userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/stand/userboot/userboot X-SVN-Commit-Revision: 364773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 17:23:34 -0000 Author: mmacy Date: Tue Aug 25 17:23:33 2020 New Revision: 364773 URL: https://svnweb.freebsd.org/changeset/base/364773 Log: Fix userboot after r364355 r364355 replaced init_zfs_bootenv with init_zfs_boot_options and neglected to update userboot in the process. Modified: head/stand/userboot/userboot/main.c Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Tue Aug 25 17:19:15 2020 (r364772) +++ head/stand/userboot/userboot/main.c Tue Aug 25 17:23:33 2020 (r364773) @@ -232,7 +232,7 @@ extract_currdev(void) bzero(&zdev, sizeof(zdev)); zdev.dd.d_dev = &zfs_dev; - init_zfs_bootenv(zfs_fmtdev(&zdev)); + init_zfs_boot_options(zfs_fmtdev(&zdev)); dd = &zdev.dd; } else #endif From owner-svn-src-head@freebsd.org Tue Aug 25 18:16:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 103E63B552C; Tue, 25 Aug 2020 18:16:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbcdN6jx3z3ZtQ; Tue, 25 Aug 2020 18:16:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB1772DC6C; Tue, 25 Aug 2020 18:16:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PIGe8j035462; Tue, 25 Aug 2020 18:16:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PIGe7X035461; Tue, 25 Aug 2020 18:16:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008251816.07PIGe7X035461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 25 Aug 2020 18:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364775 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 364775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 18:16:41 -0000 Author: kevans Date: Tue Aug 25 18:16:40 2020 New Revision: 364775 URL: https://svnweb.freebsd.org/changeset/base/364775 Log: libbe: lift the WARNS post-OpenZFS merge sys/ccompile.h no longer uses #pragma ident, so we no longer need to worry about unknown pragmas. I fixed one WARNS issue in r363409 by annotating be_is_auto_snapshot_name's lbh parameter __unused, then upstreamed the following changes to OpenZFS that rode in with the merge: - zfs_path_to_zhandle now takes a const char *path rather than a char *path, since it won't be mutating the string it receives and I had no reason to believe it will need to in the future. [OpenZFS PR #10605] - Annotated some unused parameters on definitions inlined into headers as such. [OpenZFS PR #10606] Modified: head/lib/libbe/Makefile Modified: head/lib/libbe/Makefile ============================================================================== --- head/lib/libbe/Makefile Tue Aug 25 18:11:45 2020 (r364774) +++ head/lib/libbe/Makefile Tue Aug 25 18:16:40 2020 (r364775) @@ -12,9 +12,6 @@ SRCS= be.c be_access.c be_error.c be_info.c INCS= be.h MAN= libbe.3 -WARNS?= 2 -IGNORE_PRAGMA= yes - LIBADD+= zfs LIBADD+= nvpair spl From owner-svn-src-head@freebsd.org Tue Aug 25 18:22:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EB633B54C9; Tue, 25 Aug 2020 18:22:31 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbcm702Nxz3bNn; Tue, 25 Aug 2020 18:22:31 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8BE02DFB1; Tue, 25 Aug 2020 18:22:30 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PIMUZE041585; Tue, 25 Aug 2020 18:22:30 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PIMU7l041584; Tue, 25 Aug 2020 18:22:30 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008251822.07PIMU7l041584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 25 Aug 2020 18:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364777 - head/sys/modules/zfs X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/modules/zfs X-SVN-Commit-Revision: 364777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 18:22:31 -0000 Author: freqlabs Date: Tue Aug 25 18:22:30 2020 New Revision: 364777 URL: https://svnweb.freebsd.org/changeset/base/364777 Log: Fix zstd in OpenZFS module with CPUTYPE?= The build breaks when something adds -march= to the compiler flags, for example CPUTYPE?=native. When the arch supports BMI, __BMI__ is defined and zstd.c tries to include immintrin.h, which is not present when building the kernel. Disable experimental BMI intrinsics in zstd in the OpenZFS kernel module by explicitly undefining __BMI__ for zstd.c. A similar fix was needed for the original zstd import, done in r327738. Reported by: Jakob Alvermark Discussed with: mmacy Sponsored by: iXsystems, Inc. Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue Aug 25 18:21:13 2020 (r364776) +++ head/sys/modules/zfs/Makefile Tue Aug 25 18:22:30 2020 (r364777) @@ -338,7 +338,7 @@ CFLAGS.zil.c= -Wno-cast-qual CFLAGS.zio.c= -Wno-cast-qual CFLAGS.zrlock.c= -Wno-cast-qual CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith -CFLAGS.zstd.c= -fno-tree-vectorize +CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS.zstd.c+= -include ${SRCDIR}/zstd/include/aarch64_compat.h .endif From owner-svn-src-head@freebsd.org Tue Aug 25 18:32:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7CE3B6220; Tue, 25 Aug 2020 18:32:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbczw38yQz3c9K; Tue, 25 Aug 2020 18:32:44 +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 4FAFB2E145; Tue, 25 Aug 2020 18:32:44 +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 07PIWiMd048041; Tue, 25 Aug 2020 18:32:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PIWh5i048038; Tue, 25 Aug 2020 18:32:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008251832.07PIWh5i048038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 25 Aug 2020 18:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364779 - in head: share/man/man4 sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/sdhci X-SVN-Commit-Revision: 364779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 18:32:44 -0000 Author: markj Date: Tue Aug 25 18:32:43 2020 New Revision: 364779 URL: https://svnweb.freebsd.org/changeset/base/364779 Log: sdhci(4): Recognize the Texas Instruments PCIxx12 card reader. PR: 248650 Submitted by: Lars Herschke MFC after: 1 week Modified: head/share/man/man4/sdhci.4 head/sys/dev/sdhci/sdhci_pci.c Modified: head/share/man/man4/sdhci.4 ============================================================================== --- head/share/man/man4/sdhci.4 Tue Aug 25 18:30:12 2020 (r364778) +++ head/share/man/man4/sdhci.4 Tue Aug 25 18:32:43 2020 (r364779) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd August 25, 2020 .Dt SDHCI 4 .Os .Sh NAME @@ -71,7 +71,7 @@ RICOH R5C822 .It RICOH R5CE823 .It -TI PCIXX21/XX11 +TI PCIXX21/XX11/XX12 .El .Sh SEE ALSO .Xr mmc 4 , Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Tue Aug 25 18:30:12 2020 (r364778) +++ head/sys/dev/sdhci/sdhci_pci.c Tue Aug 25 18:32:43 2020 (r364779) @@ -90,6 +90,9 @@ static const struct sdhci_device { SDHCI_QUIRK_LOWER_FREQUENCY }, { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, + { 0x803c104c, 0xffff, "TI XX12 SD", + SDHCI_QUIRK_FORCE_DMA | + SDHCI_QUIRK_WAITFOR_RESET_ASSERTED }, { 0x05501524, 0xffff, "ENE CB712 SD", SDHCI_QUIRK_BROKEN_TIMINGS }, { 0x05511524, 0xffff, "ENE CB712 SD 2", From owner-svn-src-head@freebsd.org Tue Aug 25 18:54:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 906033B6F25; Tue, 25 Aug 2020 18:54:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbdSg3LtHz3g5N; Tue, 25 Aug 2020 18:54:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 561E82E6E0; Tue, 25 Aug 2020 18:54:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PIsB8m062343; Tue, 25 Aug 2020 18:54:11 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PIsBkR062342; Tue, 25 Aug 2020 18:54:11 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202008251854.07PIsBkR062342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 25 Aug 2020 18:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364780 - head/cddl/lib/libzpool X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/cddl/lib/libzpool X-SVN-Commit-Revision: 364780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 18:54:11 -0000 Author: bdragon Date: Tue Aug 25 18:54:10 2020 New Revision: 364780 URL: https://svnweb.freebsd.org/changeset/base/364780 Log: [PowerPC] Apply the ppc32 GOT overflow fix to powerpcspe powerpcspe is also a 32 bit ppc platform, and also needs to be -fPIC to avoid overflowing the GOT. Sponsored by: Tag1 Consulting, Inc. Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Tue Aug 25 18:32:43 2020 (r364779) +++ head/cddl/lib/libzpool/Makefile Tue Aug 25 18:54:10 2020 (r364780) @@ -21,7 +21,7 @@ ACFLAGS+= -Wa,--noexecstack ATOMIC_SRCS= opensolaris_atomic.c .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" # Don't waste GOT entries on small data. PICFLAG= -fPIC .endif From owner-svn-src-head@freebsd.org Tue Aug 25 19:04:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AC043B7343; Tue, 25 Aug 2020 19:04:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbdj32djmz3gq5; Tue, 25 Aug 2020 19:04:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E9552EB9A; Tue, 25 Aug 2020 19:04:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PJ4tw8068865; Tue, 25 Aug 2020 19:04:55 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PJ4srL068863; Tue, 25 Aug 2020 19:04:54 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202008251904.07PJ4srL068863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 25 Aug 2020 19:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364781 - in head/sys: conf modules/zfs X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys: conf modules/zfs X-SVN-Commit-Revision: 364781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 19:04:55 -0000 Author: bdragon Date: Tue Aug 25 19:04:54 2020 New Revision: 364781 URL: https://svnweb.freebsd.org/changeset/base/364781 Log: [PowerPC] More preemptive powerpcspe ZFS build fixes I went through the merge and found the rest of the instances where ${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and adjusted the rest of the instances to also check for powerpcspe. mips32* will probably want to do the same. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/conf/kern.pre.mk head/sys/modules/zfs/Makefile Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Aug 25 18:54:10 2020 (r364780) +++ head/sys/conf/kern.pre.mk Tue Aug 25 19:04:54 2020 (r364781) @@ -257,7 +257,7 @@ ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_ .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "arm" + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" ZFS_CFLAGS+= -DBITS_PER_LONG=32 .else ZFS_CFLAGS+= -DBITS_PER_LONG=64 Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue Aug 25 18:54:10 2020 (r364780) +++ head/sys/modules/zfs/Makefile Tue Aug 25 19:04:54 2020 (r364781) @@ -47,7 +47,7 @@ CFLAGS+= -fprofile-arcs -ftest-coverage DEBUG_FLAGS=-g .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "arm" + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" CFLAGS+= -DBITS_PER_LONG=32 .else CFLAGS+= -DBITS_PER_LONG=64 @@ -117,7 +117,7 @@ SRCS+= acl_common.c \ .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "arm" + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" SRCS+= spl_atomic.c .endif From owner-svn-src-head@freebsd.org Tue Aug 25 19:57:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03ACE3B8EC5; Tue, 25 Aug 2020 19:57:12 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbfsM6LL3z42Jy; Tue, 25 Aug 2020 19:57:11 +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 B9CC52F0CD; Tue, 25 Aug 2020 19:57:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PJvBKr099972; Tue, 25 Aug 2020 19:57:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PJvBcC099971; Tue, 25 Aug 2020 19:57:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008251957.07PJvBcC099971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 25 Aug 2020 19:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364782 - head/lib/libcompiler_rt X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libcompiler_rt X-SVN-Commit-Revision: 364782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 19:57:12 -0000 Author: dim Date: Tue Aug 25 19:57:11 2020 New Revision: 364782 URL: https://svnweb.freebsd.org/changeset/base/364782 Log: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC after: 2 weeks X-MFC-With: r364753 Modified: head/lib/libcompiler_rt/Makefile.inc Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Tue Aug 25 19:04:54 2020 (r364781) +++ head/lib/libcompiler_rt/Makefile.inc Tue Aug 25 19:57:11 2020 (r364782) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins @@ -124,10 +122,6 @@ SRCF+= udivti3 SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 - -.if "${COMPILER_TYPE}" == "clang" -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) From owner-svn-src-head@freebsd.org Tue Aug 25 20:04:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFFBD3B95EE; Tue, 25 Aug 2020 20:04:35 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbg1v5krBz438H; Tue, 25 Aug 2020 20:04:35 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1ECB2F682; Tue, 25 Aug 2020 20:04:35 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PK4Zjn006078; Tue, 25 Aug 2020 20:04:35 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PK4ZBM006077; Tue, 25 Aug 2020 20:04:35 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008252004.07PK4ZBM006077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 25 Aug 2020 20:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364783 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear X-SVN-Commit-Revision: 364783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 20:04:35 -0000 Author: freqlabs Date: Tue Aug 25 20:04:35 2020 New Revision: 364783 URL: https://svnweb.freebsd.org/changeset/base/364783 Log: Skip zpool_clear_005_pos test until bug fixed Messing with gnop devices under a zpool fails in this test, causing the pool to be suspended and eventually the system to deadlock. Skip the test for now until the issue is resolved. PR: tests/248910 Discussed with: lwhsu Sponsored by: iXsystems, Inc. Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh ============================================================================== --- head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh Tue Aug 25 19:57:11 2020 (r364782) +++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_test.sh Tue Aug 25 20:04:35 2020 (r364783) @@ -124,6 +124,7 @@ zpool_clear_005_pos_head() } zpool_clear_005_pos_body() { + atf_skip "Fails on OpenZFS, causing eventual deadlock. PR tests/248910" . $(atf_get_srcdir)/../../../include/default.cfg . $(atf_get_srcdir)/zpool_clear.cfg From owner-svn-src-head@freebsd.org Tue Aug 25 20:07:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60CCB3B9874; Tue, 25 Aug 2020 20:07:12 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbg4w1wJ3z43PN; Tue, 25 Aug 2020 20:07:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 250512F0E6; Tue, 25 Aug 2020 20:07:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PK7CGJ006485; Tue, 25 Aug 2020 20:07:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PK7BLS006484; Tue, 25 Aug 2020 20:07:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008252007.07PK7BLS006484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 25 Aug 2020 20:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364784 - head/lib/libgcc_eh X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libgcc_eh X-SVN-Commit-Revision: 364784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 20:07:12 -0000 Author: dim Date: Tue Aug 25 20:07:11 2020 New Revision: 364784 URL: https://svnweb.freebsd.org/changeset/base/364784 Log: After r364423, which ensures the callbacks that dl_iterate_phdr(3) performs are protected by an exclusive lock, even for statically linked programs, it is safe to re-enable libunwind's FrameHeaderCache, which I temporarily disabled in r364263. Meanwhile upstream has also used the _LIBUNWIND_USE_FRAME_HEADER_CACHE for this purpose, so the only thing needed is to add this as a compile-time command line flag. While here, reformat the CFLAGS lines a little bit. MFC after: 6 weeks X-MFC-With: r364284, r364423 Modified: head/lib/libgcc_eh/Makefile.inc Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Tue Aug 25 20:04:35 2020 (r364783) +++ head/lib/libgcc_eh/Makefile.inc Tue Aug 25 20:07:11 2020 (r364784) @@ -25,7 +25,10 @@ CFLAGS.${file}+= -fno-exceptions -funwind-tables CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor -CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +CFLAGS+= -I${UNWINDINCDIR} +CFLAGS+= -I${.CURDIR} +CFLAGS+= -D_LIBUNWIND_IS_NATIVE_ONLY +CFLAGS+= -D_LIBUNWIND_USE_FRAME_HEADER_CACHE CXXFLAGS+= -fno-rtti CXXSTD?= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC From owner-svn-src-head@freebsd.org Tue Aug 25 20:08:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADCB33B9B0A; Tue, 25 Aug 2020 20:08:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbg6c48pjz43jf; Tue, 25 Aug 2020 20:08:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 596C7184C8; Tue, 25 Aug 2020 20:08:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::841c:2a51:60d8:8a4] (unknown [IPv6:2001:470:7a58:0:841c:2a51:60d8:8a4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5A64763A31; Tue, 25 Aug 2020 22:08:38 +0200 (CEST) From: Dimitry Andric Content-Type: multipart/signed; boundary="Apple-Mail=_7B84E4BC-056D-4402-91A4-26055332415B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: svn commit: r364782 - head/lib/libcompiler_rt Date: Tue, 25 Aug 2020 22:08:30 +0200 References: <202008251957.07PJvBcC099971@repo.freebsd.org> To: src-committers , svn-src-all , svn-src-head@freebsd.org In-Reply-To: <202008251957.07PJvBcC099971@repo.freebsd.org> Message-Id: <043F4141-45F1-436F-9B23-185FC0598AEF@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 20:08:40 -0000 --Apple-Mail=_7B84E4BC-056D-4402-91A4-26055332415B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 Aug 2020, at 21:57, Dimitry Andric wrote: > > Author: dim > Date: Tue Aug 25 19:57:11 2020 > New Revision: 364782 > URL: https://svnweb.freebsd.org/changeset/base/364782 > > Log: > After r364753, there should be no need to suppress -Watomic-alignment > warnings anymore for compiler-rt's atomic.c. This occurred because the > IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this > caused the compiler to emit a runtime call to __atomic_is_lock_free(), > and that triggers the warning. > > MFC after: 2 weeks > X-MFC-With: r364753 Forgot to mention, Noticed by: arichardson. :) -Dimitry --Apple-Mail=_7B84E4BC-056D-4402-91A4-26055332415B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCX0VvvwAKCRCwXqMKLiCW o6u3AKCWMPlV1W1Y2ghizjk7FrJHY56eIgCfbC1sa+w/F/juZi8fuCFMYoULxbI= =BKCI -----END PGP SIGNATURE----- --Apple-Mail=_7B84E4BC-056D-4402-91A4-26055332415B-- From owner-svn-src-head@freebsd.org Tue Aug 25 20:17:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7293A3BA1A1; Tue, 25 Aug 2020 20:17:43 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbgK26XnWz44SB; Tue, 25 Aug 2020 20:17:42 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 86A433C0199; Tue, 25 Aug 2020 20:17:36 +0000 (UTC) Date: Tue, 25 Aug 2020 20:17:36 +0000 From: Brooks Davis To: Brandon Bergren Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364781 - in head/sys: conf modules/zfs Message-ID: <20200825201736.GC43898@spindle.one-eyed-alien.net> References: <202008251904.07PJ4srL068863@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R3G7APHDIzY6R/pk" Content-Disposition: inline In-Reply-To: <202008251904.07PJ4srL068863@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4BbgK26XnWz44SB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 20:17:43 -0000 --R3G7APHDIzY6R/pk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 25, 2020 at 07:04:54PM +0000, Brandon Bergren wrote: > Author: bdragon > Date: Tue Aug 25 19:04:54 2020 > New Revision: 364781 > URL: https://svnweb.freebsd.org/changeset/base/364781 >=20 > Log: > [PowerPC] More preemptive powerpcspe ZFS build fixes > =20 > I went through the merge and found the rest of the instances where > ${MACHINE_ARCH} =3D=3D "powerpc" was being used to detect 32-bit and ad= justed > the rest of the instances to also check for powerpcspe. > =20 > mips32* will probably want to do the same. > =20 > Sponsored by: Tag1 Consulting, Inc. >=20 > Modified: > head/sys/conf/kern.pre.mk > head/sys/modules/zfs/Makefile >=20 > Modified: head/sys/conf/kern.pre.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/kern.pre.mk Tue Aug 25 18:54:10 2020 (r364780) > +++ head/sys/conf/kern.pre.mk Tue Aug 25 19:04:54 2020 (r364781) > @@ -257,7 +257,7 @@ ZFS_CFLAGS+=3D -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHA= VE_ > .endif > =20 > .if ${MACHINE_ARCH} =3D=3D "i386" || ${MACHINE_ARCH} =3D=3D "powerpc" ||= \ > - ${MACHINE_ARCH} =3D=3D "arm" > + ${MACHINE_ARCH} =3D=3D "powerpcspe" || ${MACHINE_ARCH} =3D=3D "arm" > ZFS_CFLAGS+=3D -DBITS_PER_LONG=3D32 > .else > ZFS_CFLAGS+=3D -DBITS_PER_LONG=3D64 In CheriBSD we've added a MACHINE_ABI variable that could be used to simplify this mess of checks. https://github.com/CTSRD-CHERI/cheribsd/blob/5ee735e5f8ef7268731359a2d8a9a8= 218df2d23f/share/mk/bsd.cpu.mk#L478 As currently implemented you'd use: =2Eif ${MACHINE_ABI:Mptr64} There's be a argument for adding long32 and long64 for to avoid conflating long and pointer size. -- Brooks --R3G7APHDIzY6R/pk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfRXHfAAoJEKzQXbSebgfAgJIH/Ay1jbdHWG0MtmUz2J/PdO38 x3Jl77+J857l3zv26JUHer+CgzDeFH0Z7iQPml9v5KgHyh6Ec2+Qra+wvoQGPywq /1QKGHPPiTLDSOIk34IMK3ukr19SH73sdFbFJIuA+3wwmIJCsBRk6NuBlkdxQhV/ ZBCoq23kXPxWBBkPbZmakBRX1ELzlfgrJGKkpnAGwbkyEPLkqU6fSWrt4a+CRhrx ehejZgPR4bb7YUGabmgT4OH00+KFWap4e0bITzGRFqVA3ehdAsxkJUSLG1BrSWX7 SqQxG2xzbrbsItkfHbrvPMlgzCFNkzK5mMv1ISCLuPg6XPGTdh1GBNkt2DrbRr0= =ABXN -----END PGP SIGNATURE----- --R3G7APHDIzY6R/pk-- From owner-svn-src-head@freebsd.org Tue Aug 25 21:07:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCFBA3BC19F; Tue, 25 Aug 2020 21:07:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbhQR5Vjfz47tb; Tue, 25 Aug 2020 21:07:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0485824B; Tue, 25 Aug 2020 21:07:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PL7Rb1043010; Tue, 25 Aug 2020 21:07:27 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PL7RZx043009; Tue, 25 Aug 2020 21:07:27 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008252107.07PL7RZx043009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 25 Aug 2020 21:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364785 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 364785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 21:07:27 -0000 Author: freqlabs Date: Tue Aug 25 21:07:27 2020 New Revision: 364785 URL: https://svnweb.freebsd.org/changeset/base/364785 Log: bsdinstall: Update loader.conf for new OpenZFS deps zfs.ko now includes the SPL but relies on cryptodev instead. Reported by: D Scott Phillips Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Tue Aug 25 20:07:11 2020 (r364784) +++ head/usr.sbin/bsdinstall/scripts/config Tue Aug 25 21:07:27 2020 (r364785) @@ -44,9 +44,9 @@ cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf rm $BSDINSTALL_TMPBOOT/loader.conf.* -# The 'opensolaris_load' line is a workaround for arm64, which does not -# automatically load opensolaris.ko with zfs.ko. -df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "opensolaris_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf +# The 'cryptodev_load' line is a workaround for arm64, which does not +# automatically load cryptodev.ko with zfs.ko. +df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "cryptodev_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot From owner-svn-src-head@freebsd.org Tue Aug 25 21:36:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2565F3BCFC5; Tue, 25 Aug 2020 21:36:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbj4T0D97z4CMb; Tue, 25 Aug 2020 21:36:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFFA78827; Tue, 25 Aug 2020 21:36:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PLauZ1061712; Tue, 25 Aug 2020 21:36:56 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PLaudm061711; Tue, 25 Aug 2020 21:36:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202008252136.07PLaudm061711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 25 Aug 2020 21:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364786 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 364786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 21:36:57 -0000 Author: cem Date: Tue Aug 25 21:36:56 2020 New Revision: 364786 URL: https://svnweb.freebsd.org/changeset/base/364786 Log: vm_pageout: Scale worker threads with CPUs Autoscale vm_pageout worker threads from r364129 with CPU count. The default is arbitrarily chosen to be 16 CPUs per worker thread, but can be adjusted with the vm.pageout_cpus_per_thread tunable. There will never be less than 1 thread per populated NUMA domain, and the previous arbitrary upper limit (at most ncpus/2 threads per NUMA domain) is preserved. Care is taken to gracefully handle asymmetric NUMA nodes, such as empty node systems (e.g., AMD 2990WX) and systems with nodes of varying size (e.g., some larger >20 core Intel Haswell/Broadwell Xeon). Reviewed by: kib, markj Sponsored by: Isilon Differential Revision: https://reviews.freebsd.org/D26152 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Aug 25 21:07:27 2020 (r364785) +++ head/sys/vm/vm_pageout.c Tue Aug 25 21:36:56 2020 (r364786) @@ -165,11 +165,10 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, CTLFLAG_RWTUN, &vm_pageout_update_period, 0, "Maximum active LRU update period"); -/* Access with get_pageout_threads_per_domain(). */ -static int pageout_threads_per_domain = 1; -SYSCTL_INT(_vm, OID_AUTO, pageout_threads_per_domain, CTLFLAG_RDTUN, - &pageout_threads_per_domain, 0, - "Number of worker threads comprising each per-domain pagedaemon"); +static int pageout_cpus_per_thread = 16; +SYSCTL_INT(_vm, OID_AUTO, pageout_cpus_per_thread, CTLFLAG_RDTUN, + &pageout_cpus_per_thread, 0, + "Number of CPUs per pagedaemon worker thread"); SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RWTUN, &lowmem_period, 0, "Low memory callback period"); @@ -2200,38 +2199,38 @@ vm_pageout_helper(void *arg) } static int -get_pageout_threads_per_domain(void) +get_pageout_threads_per_domain(const struct vm_domain *vmd) { - static bool resolved = false; - int half_cpus_per_dom; + unsigned total_pageout_threads, eligible_cpus, domain_cpus; - /* - * This is serialized externally by the sorted autoconfig portion of - * boot. - */ - if (__predict_true(resolved)) - return (pageout_threads_per_domain); + if (VM_DOMAIN_EMPTY(vmd->vmd_domain)) + return (0); /* * Semi-arbitrarily constrain pagedaemon threads to less than half the - * total number of threads in the system as an insane upper limit. + * total number of CPUs in the system as an upper limit. */ - half_cpus_per_dom = howmany(mp_ncpus / vm_ndomains, 2); + if (pageout_cpus_per_thread < 2) + pageout_cpus_per_thread = 2; + else if (pageout_cpus_per_thread > mp_ncpus) + pageout_cpus_per_thread = mp_ncpus; - if (pageout_threads_per_domain < 1) { - printf("Invalid tuneable vm.pageout_threads_per_domain value: " - "%d out of valid range: [1-%d]; clamping to 1\n", - pageout_threads_per_domain, half_cpus_per_dom); - pageout_threads_per_domain = 1; - } else if (pageout_threads_per_domain > half_cpus_per_dom) { - printf("Invalid tuneable vm.pageout_threads_per_domain value: " - "%d out of valid range: [1-%d]; clamping to %d\n", - pageout_threads_per_domain, half_cpus_per_dom, - half_cpus_per_dom); - pageout_threads_per_domain = half_cpus_per_dom; - } - resolved = true; - return (pageout_threads_per_domain); + total_pageout_threads = howmany(mp_ncpus, pageout_cpus_per_thread); + domain_cpus = CPU_COUNT(&cpuset_domain[vmd->vmd_domain]); + + /* Pagedaemons are not run in empty domains. */ + eligible_cpus = mp_ncpus; + for (unsigned i = 0; i < vm_ndomains; i++) + if (VM_DOMAIN_EMPTY(i)) + eligible_cpus -= CPU_COUNT(&cpuset_domain[i]); + + /* + * Assign a portion of the total pageout threads to this domain + * corresponding to the fraction of pagedaemon-eligible CPUs in the + * domain. In asymmetric NUMA systems, domains with more CPUs may be + * allocated more threads than domains with fewer CPUs. + */ + return (howmany(total_pageout_threads * domain_cpus, eligible_cpus)); } /* @@ -2288,7 +2287,7 @@ vm_pageout_init_domain(int domain) "pidctrl", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid)); - vmd->vmd_inactive_threads = get_pageout_threads_per_domain(); + vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd); } static void @@ -2343,7 +2342,6 @@ vm_pageout(void) p = curproc; td = curthread; - pageout_threads = get_pageout_threads_per_domain(); mtx_init(&vm_oom_ratelim_mtx, "vmoomr", NULL, MTX_DEF); swap_pager_swap_init(); @@ -2363,6 +2361,7 @@ vm_pageout(void) panic("starting pageout for domain %d: %d\n", i, error); } + pageout_threads = VM_DOMAIN(i)->vmd_inactive_threads; for (j = 0; j < pageout_threads - 1; j++) { error = kthread_add(vm_pageout_helper, (void *)(uintptr_t)i, p, NULL, 0, 0, From owner-svn-src-head@freebsd.org Tue Aug 25 23:26:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41A8E3C07B1; Tue, 25 Aug 2020 23:26:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BblWK1407z4KT5; Tue, 25 Aug 2020 23:26:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 075DC9D44; Tue, 25 Aug 2020 23:26:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PNQqBM029325; Tue, 25 Aug 2020 23:26:52 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PNQqWH029324; Tue, 25 Aug 2020 23:26:52 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008252326.07PNQqWH029324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 23:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364787 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 364787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 23:26:53 -0000 Author: mmacy Date: Tue Aug 25 23:26:52 2020 New Revision: 364787 URL: https://svnweb.freebsd.org/changeset/base/364787 Log: ZFS: whitelist zstd and encryption in the loader Please note that neither zstd nor encryption is supported by the loader at this instant. This change makes it safe to use those features in one's root pool, but not in one's root dataset. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Tue Aug 25 21:36:56 2020 (r364786) +++ head/stand/libsa/zfs/zfsimpl.c Tue Aug 25 23:26:52 2020 (r364787) @@ -127,6 +127,8 @@ static const char *features_for_read[] = { "com.delphix:device_removal", "com.delphix:obsolete_counts", "com.intel:allocation_classes", + "org.freebsd:zstd_compress", + "com.datto:encryption", NULL }; From owner-svn-src-head@freebsd.org Tue Aug 25 23:35:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7BD23C0C8F; Tue, 25 Aug 2020 23:35:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbljl4xV4z4LRZ; Tue, 25 Aug 2020 23:35:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B99A9A66; Tue, 25 Aug 2020 23:35:55 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07PNZtuG035515; Tue, 25 Aug 2020 23:35:55 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07PNZtNK035514; Tue, 25 Aug 2020 23:35:55 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008252335.07PNZtNK035514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 25 Aug 2020 23:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364788 - head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Commit-Revision: 364788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 23:35:55 -0000 Author: mmacy Date: Tue Aug 25 23:35:55 2020 New Revision: 364788 URL: https://svnweb.freebsd.org/changeset/base/364788 Log: ZFS: band-aid for -DNO_CLEAN Submitted by: Neal Chauhan Approved by: imp@ Differential Revision: https://reviews.freebsd.org/D26183 Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue Aug 25 23:26:52 2020 (r364787) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue Aug 25 23:35:55 2020 (r364788) @@ -44,6 +44,7 @@ #include #include +#undef ASSERT #define ASSERT assert #else #include @@ -52,9 +53,10 @@ #include #include +#undef ASSERT #define ASSERT assert #endif -#include +#include "lz4.h" static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); From owner-svn-src-head@freebsd.org Wed Aug 26 00:32:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AD493C25C9; Wed, 26 Aug 2020 00:32:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbmyR6Zlnz4PMg; Wed, 26 Aug 2020 00:31:59 +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 C677CA85A; Wed, 26 Aug 2020 00:31:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q0VxE6069448; Wed, 26 Aug 2020 00:31:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q0VxOQ069447; Wed, 26 Aug 2020 00:31:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202008260031.07Q0VxOQ069447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 26 Aug 2020 00:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364790 - head/bin/date X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/date X-SVN-Commit-Revision: 364790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 00:32:00 -0000 Author: emaste Date: Wed Aug 26 00:31:59 2020 New Revision: 364790 URL: https://svnweb.freebsd.org/changeset/base/364790 Log: date.1: note possibly surprising behaviour of -j -f PR: 248918 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/bin/date/date.1 Modified: head/bin/date/date.1 ============================================================================== --- head/bin/date/date.1 Wed Aug 26 00:28:28 2020 (r364789) +++ head/bin/date/date.1 Wed Aug 26 00:31:59 2020 (r364790) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 23, 2019 +.Dd August 25, 2020 .Dt DATE 1 .Os .Sh NAME @@ -142,6 +142,9 @@ This allows you to use the flag in addition to the .Cm + option to convert one date format to another. +Note that any date or time components unspecified by the +.Fl f +format string take their values from the current time. .It Fl n Obsolete flag, accepted and ignored for compatibility. .It Fl R From owner-svn-src-head@freebsd.org Wed Aug 26 00:43:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B69F93C38AC; Wed, 26 Aug 2020 00:43:00 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbnC84VRbz4QV4; Wed, 26 Aug 2020 00:43:00 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DC0FAB7A; Wed, 26 Aug 2020 00:43:00 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q0h0aN077835; Wed, 26 Aug 2020 00:43:00 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q0h0kH077834; Wed, 26 Aug 2020 00:43:00 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <202008260043.07Q0h0kH077834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 26 Aug 2020 00:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364791 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 364791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 00:43:00 -0000 Author: jamie Date: Wed Aug 26 00:42:59 2020 New Revision: 364791 URL: https://svnweb.freebsd.org/changeset/base/364791 Log: Handle jail.conf variables that have the same names as parameters. PR: 248444 Submitted by: Akos Somfai Reported by: Markus Stoff Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Wed Aug 26 00:31:59 2020 (r364790) +++ head/usr.sbin/jail/config.c Wed Aug 26 00:42:59 2020 (r364791) @@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e else for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) if (!(intparams[ipnum].flags & PF_CONV) && - equalopts(name, intparams[ipnum].name)) { + equalopts(name, intparams[ipnum].name) && + !(p->flags & PF_VAR)) { j->intparams[ipnum] = np; np->flags |= intparams[ipnum].flags; break; From owner-svn-src-head@freebsd.org Wed Aug 26 02:04:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C9603C51C5; Wed, 26 Aug 2020 02:04:05 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbq0h6X4Hz4VLX; Wed, 26 Aug 2020 02:04:04 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3440BB25; Wed, 26 Aug 2020 02:04:04 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q24460027526; Wed, 26 Aug 2020 02:04:04 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q244dt027525; Wed, 26 Aug 2020 02:04:04 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202008260204.07Q244dt027525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 26 Aug 2020 02:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364794 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 364794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:04:05 -0000 Author: scottph Date: Wed Aug 26 02:04:04 2020 New Revision: 364794 URL: https://svnweb.freebsd.org/changeset/base/364794 Log: arm64: Make local stores observable before sending IPIs Add a synchronizing instruction to flush and wait until the local CPU's writes are observable to other CPUs before sending IPIs. This fixes an issue where recipient CPUs doing a rendezvous could enter the rendezvous handling code before the initiator's writes to the smp_rv_* variables were visible. This manifested as a system hang, where a single CPU's increment of smp_rv_waiters[0] actually happened "before" the initiator's zeroing of that field, so all CPUs were stuck with the field appearing to be at ncpus - 1. Reviewed by: andrew, markj Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D25798 Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Wed Aug 26 01:55:37 2020 (r364793) +++ head/sys/arm64/arm64/mp_machdep.c Wed Aug 26 02:04:04 2020 (r364794) @@ -304,6 +304,13 @@ pic_ipi_send(void *arg, cpuset_t cpus, u_int ipi) { KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + + /* + * Ensure that this CPU's stores will be visible to IPI + * recipients before starting to send the interrupts. + */ + dsb(ishst); + PIC_IPI_SEND(intr_irq_root_dev, arg, cpus, ipi); } From owner-svn-src-head@freebsd.org Wed Aug 26 02:05:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39D653C5539; Wed, 26 Aug 2020 02:05:59 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbq2v0pq7z4VNB; Wed, 26 Aug 2020 02:05:59 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 003B4BD95; Wed, 26 Aug 2020 02:05:59 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q25wTQ027680; Wed, 26 Aug 2020 02:05:58 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q25wFp027678; Wed, 26 Aug 2020 02:05:58 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202008260205.07Q25wFp027678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 26 Aug 2020 02:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364795 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 364795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:05:59 -0000 Author: scottph Date: Wed Aug 26 02:05:58 2020 New Revision: 364795 URL: https://svnweb.freebsd.org/changeset/base/364795 Log: efibootmgr: Add option to request booting to the firmware user interface The OsIndications UEFI variable can request the firware to stop at its UI instead of continuing with boot. Add flags for setting and clearing this request. Reviewed by: manu, bcr (manpages) Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D25839 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Wed Aug 26 02:04:04 2020 (r364794) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Wed Aug 26 02:05:58 2020 (r364795) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2020 +.Dd August 25, 2020 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -55,6 +55,10 @@ .Op Fl d .Op Fl p .Nm +.Fl F +.Nm +.Fl f +.Nm .Fl n .Fl b Ar bootnum .Nm @@ -137,6 +141,9 @@ is specified, the UEFI device path to the ESP is repor If .Fl p -unix-path is specified, the mount point of the ESP is reported instead. +.It Fl f -fw-ui , Fl F -no-fw-ui +Set or clear the request to the system firmware to stop in its user +interface on the next boot. .It Fl k -kernel Ar kernel The path to and name of the kernel. .It Fl l -loader Ar loader Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Wed Aug 26 02:04:04 2020 (r364794) +++ head/usr.sbin/efibootmgr/efibootmgr.c Wed Aug 26 02:05:58 2020 (r364795) @@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$"); #define BAD_LENGTH ((size_t)-1) +#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001 + typedef struct _bmgr_opts { char *env; char *loader; @@ -83,6 +85,8 @@ typedef struct _bmgr_opts { bool dry_run; bool device_path; bool esp_device; + bool fw_ui; + bool no_fw_ui; bool has_bootnum; bool once; int cp_src; @@ -110,6 +114,8 @@ static struct option lopts[] = { {"dry-run", no_argument, NULL, 'D'}, {"env", required_argument, NULL, 'e'}, {"esp", no_argument, NULL, 'E'}, + {"fw-ui", no_argument, NULL, 'f'}, + {"no-fw-ui", no_argument, NULL, 'F'}, {"help", no_argument, NULL, 'h'}, {"kernel", required_argument, NULL, 'k'}, {"label", required_argument, NULL, 'L'}, @@ -197,7 +203,7 @@ parse_args(int argc, char *argv[]) { int ch; - while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:Ehk:L:l:NnOo:pTt:v", + while ((ch = getopt_long(argc, argv, "AaBb:C:cdDe:EFfhk:L:l:NnOo:pTt:v", lopts, NULL)) != -1) { switch (ch) { case 'A': @@ -232,6 +238,12 @@ parse_args(int argc, char *argv[]) case 'E': opts.esp_device = true; break; + case 'F': + opts.no_fw_ui = true; + break; + case 'f': + opts.fw_ui = true; + break; case 'h': default: errx(1, "%s", USAGE); @@ -825,6 +837,45 @@ print_boot_var(const char *name, bool verbose, bool cu } +static bool +os_indication_supported(uint64_t indication) +{ + uint8_t *data; + size_t size; + uint32_t attrs; + int ret; + + ret = efi_get_variable(EFI_GLOBAL_GUID, "OsIndicationsSupported", &data, + &size, &attrs); + if (ret < 0) + return false; + return (le64dec(data) & indication) == indication; +} + +static uint64_t +os_indications(void) +{ + uint8_t *data; + size_t size; + uint32_t attrs; + int ret; + + ret = efi_get_variable(EFI_GLOBAL_GUID, "OsIndications", &data, &size, + &attrs); + if (ret < 0) + return 0; + return le64dec(data); +} + +static int +os_indications_set(uint64_t mask, uint64_t val) +{ + uint8_t new[sizeof(uint64_t)]; + + le64enc(&new, (os_indications() & ~mask) | (val & mask)); + return set_bootvar("OsIndications", new, sizeof(new)); +} + /* Cmd epilogue, or just the default with no args. * The order is [bootnext] bootcurrent, timeout, order, and the bootvars [-v] */ @@ -841,7 +892,15 @@ print_boot_vars(bool verbose) uint32_t attrs; int ret, bolen; uint16_t *boot_order = NULL, current; + bool boot_to_fw_ui; + if (os_indication_supported(EFI_OS_INDICATIONS_BOOT_TO_FW_UI)) { + boot_to_fw_ui = + (os_indications() & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) != 0; + printf("Boot to FW : %s\n", boot_to_fw_ui != 0 ? + "true" : "false"); + } + ret = efi_get_variable(EFI_GLOBAL_GUID, "BootNext", &data, &size, &attrs); if (ret > 0) { printf("BootNext : %04x\n", le16dec(data)); @@ -987,6 +1046,23 @@ report_esp_device(bool do_dp, bool do_unix) exit(0); } +static void +set_boot_to_fw_ui(bool to_fw) +{ + int ret; + + if (!os_indication_supported(EFI_OS_INDICATIONS_BOOT_TO_FW_UI)) { + if (to_fw) + errx(1, "boot to fw ui not supported"); + else + return; + } + ret = os_indications_set(EFI_OS_INDICATIONS_BOOT_TO_FW_UI, + to_fw ? ~0 : 0); + if (ret < 0) + errx(1, "failed to set boot to fw ui"); +} + int main(int argc, char *argv[]) { @@ -1021,6 +1097,10 @@ main(int argc, char *argv[]) handle_timeout(opts.timeout); else if (opts.esp_device) report_esp_device(opts.device_path, opts.unix_path); + else if (opts.fw_ui) + set_boot_to_fw_ui(true); + else if (opts.no_fw_ui) + set_boot_to_fw_ui(false); print_boot_vars(opts.verbose); } From owner-svn-src-head@freebsd.org Wed Aug 26 02:07:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EE4A3C5C94; Wed, 26 Aug 2020 02:07:48 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbq4z546Sz4W2v; Wed, 26 Aug 2020 02:07:47 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91A95BD9A; Wed, 26 Aug 2020 02:07:47 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q27lvX027823; Wed, 26 Aug 2020 02:07:47 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q27lDH027822; Wed, 26 Aug 2020 02:07:47 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202008260207.07Q27lDH027822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 26 Aug 2020 02:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364796 - in head: share/man/man9 sys/sys X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: in head: share/man/man9 sys/sys X-SVN-Commit-Revision: 364796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:07:48 -0000 Author: scottph Date: Wed Aug 26 02:07:46 2020 New Revision: 364796 URL: https://svnweb.freebsd.org/changeset/base/364796 Log: bitset: add BIT_FFS_AT() for finding the first bit set greater than a start bit Reviewed by: kib Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26128 Modified: head/share/man/man9/bitset.9 head/sys/sys/bitset.h Modified: head/share/man/man9/bitset.9 ============================================================================== --- head/share/man/man9/bitset.9 Wed Aug 26 02:05:58 2020 (r364795) +++ head/share/man/man9/bitset.9 Wed Aug 26 02:07:46 2020 (r364796) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2019 +.Dd August 25, 2020 .Dt BITSET 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm BIT_EMPTY , .Nm BIT_ISFULLSET , .Nm BIT_FFS , +.Nm BIT_FFS_AT , .Nm BIT_FLS , .Nm BIT_COUNT , .Nm BIT_SUBSET , @@ -86,6 +87,8 @@ .Ft int .Fn BIT_FFS "const SETSIZE" "struct STRUCTNAME *bitset" .Ft int +.Fn BIT_FFS_AT "const SETSIZE" "struct STRUCTNAME *bitset" "int start" +.Ft int .Fn BIT_FLS "const SETSIZE" "struct STRUCTNAME *bitset" .Ft int .Fn BIT_COUNT "const SETSIZE" "struct STRUCTNAME *bitset" @@ -285,6 +288,18 @@ index parameter to any other macro, you must subtract one from the result. .Pp The +.Fn BIT_FFS_AT +macro returns the 1-index of the first (lowest) set bit in +.Fa bitset , +which is greater than the given 1-indexed +.Fa start , +or zero if no bits in +.Fa bitset +greater than +.Fa start +are set. +.Pp +The .Fn BIT_FLS macro returns the 1-index of the last (highest) set bit in .Fa bitset , @@ -518,7 +533,8 @@ argument to all of these macros must match the value g .Fn BITSET_DEFINE . .Pp Unlike every other reference to individual set members, which are zero-indexed, -.Fn BIT_FFS +.Fn BIT_FFS , +.Fn BIT_FFS_AT and .Fn BIT_FLS return a one-indexed result (or zero if the set is empty). Modified: head/sys/sys/bitset.h ============================================================================== --- head/sys/sys/bitset.h Wed Aug 26 02:05:58 2020 (r364795) +++ head/sys/sys/bitset.h Wed Aug 26 02:07:46 2020 (r364796) @@ -207,20 +207,31 @@ (f)->__bits[__i]); \ } while (0) -#define BIT_FFS(_s, p) __extension__ ({ \ +/* + * Note that `start` and the returned value from BIT_FFS_AT are + * 1-based bit indices. + */ +#define BIT_FFS_AT(_s, p, start) __extension__ ({ \ __size_t __i; \ + long __mask; \ int __bit; \ \ + __mask = ~0UL << ((start) % _BITSET_BITS); \ __bit = 0; \ - for (__i = 0; __i < __bitset_words((_s)); __i++) { \ - if ((p)->__bits[__i] != 0) { \ - __bit = ffsl((p)->__bits[__i]); \ + for (__i = __bitset_word((_s), (start)); \ + __i < __bitset_words((_s)); \ + __i++) { \ + if (((p)->__bits[__i] & __mask) != 0) { \ + __bit = ffsl((p)->__bits[__i] & __mask); \ __bit += __i * _BITSET_BITS; \ break; \ } \ + __mask = ~0UL; \ } \ __bit; \ }) + +#define BIT_FFS(_s, p) BIT_FFS_AT((_s), (p), 0) #define BIT_FLS(_s, p) __extension__ ({ \ __size_t __i; \ From owner-svn-src-head@freebsd.org Wed Aug 26 02:12:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A10653C5DF3; Wed, 26 Aug 2020 02:12:16 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbqB83p3qz4WHG; Wed, 26 Aug 2020 02:12:16 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65AFABF06; Wed, 26 Aug 2020 02:12:16 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q2CGBY032696; Wed, 26 Aug 2020 02:12:16 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q2CFTo032694; Wed, 26 Aug 2020 02:12:15 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202008260212.07Q2CFTo032694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 26 Aug 2020 02:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364797 - in head/sys/arm64: acpica arm64 X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: in head/sys/arm64: acpica arm64 X-SVN-Commit-Revision: 364797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:12:16 -0000 Author: scottph Date: Wed Aug 26 02:12:15 2020 New Revision: 364797 URL: https://svnweb.freebsd.org/changeset/base/364797 Log: arm64/acpi: Give the real PA limit to ACPI Read PA bits from ID_AA64MMFR0_EL1.PARange. Reviewed by: andrew, markj Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26133 Modified: head/sys/arm64/acpica/acpi_machdep.c head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/acpica/acpi_machdep.c ============================================================================== --- head/sys/arm64/acpica/acpi_machdep.c Wed Aug 26 02:07:46 2020 (r364796) +++ head/sys/arm64/acpica/acpi_machdep.c Wed Aug 26 02:12:15 2020 (r364797) @@ -232,12 +232,47 @@ acpi_map_addr(struct acpi_generic_address *addr, bus_s static void parse_pxm_tables(void *dummy) { + uint64_t mmfr0, parange; /* Only parse ACPI tables when booting via ACPI */ if (arm64_bus_method != ARM64_BUS_ACPI) return; - acpi_pxm_init(MAXCPU, (vm_paddr_t)1 << 40); + if (!get_kernel_reg(ID_AA64MMFR0_EL1, &mmfr0)) { + /* chosen arbitrarily */ + mmfr0 = ID_AA64MMFR0_PARange_1T; + } + + switch (ID_AA64MMFR0_PARange_VAL(mmfr0)) { + case ID_AA64MMFR0_PARange_4G: + parange = (vm_paddr_t)4 << 30 /* GiB */; + break; + case ID_AA64MMFR0_PARange_64G: + parange = (vm_paddr_t)64 << 30 /* GiB */; + break; + case ID_AA64MMFR0_PARange_1T: + parange = (vm_paddr_t)1 << 40 /* TiB */; + break; + case ID_AA64MMFR0_PARange_4T: + parange = (vm_paddr_t)4 << 40 /* TiB */; + break; + case ID_AA64MMFR0_PARange_16T: + parange = (vm_paddr_t)16 << 40 /* TiB */; + break; + case ID_AA64MMFR0_PARange_256T: + parange = (vm_paddr_t)256 << 40 /* TiB */; + break; + case ID_AA64MMFR0_PARange_4P: + parange = (vm_paddr_t)4 << 50 /* PiB */; + break; + default: + /* chosen arbitrarily */ + parange = (vm_paddr_t)1 << 40 /* TiB */; + printf("Unknown value for PARange in mmfr0 (%#lx)\n", mmfr0); + break; + } + + acpi_pxm_init(MAXCPU, parange); acpi_pxm_parse_tables(); acpi_pxm_set_mem_locality(); } Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed Aug 26 02:07:46 2020 (r364796) +++ head/sys/arm64/arm64/identcpu.c Wed Aug 26 02:12:15 2020 (r364797) @@ -916,6 +916,13 @@ static struct mrs_user_reg user_regs[] = { .offset = __offsetof(struct cpu_desc, id_aa64dfr0), .fields = id_aa64dfr0_fields, }, + { /* id_aa64mmfr0_el1 */ + .reg = ID_AA64MMFR0_EL1, + .CRm = 7, + .Op2 = 0, + .offset = __offsetof(struct cpu_desc, id_aa64mmfr0), + .fields = id_aa64mmfr0_fields, + }, }; #define CPU_DESC_FIELD(desc, idx) \ From owner-svn-src-head@freebsd.org Wed Aug 26 02:13:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFFB63C6205; Wed, 26 Aug 2020 02:13:27 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbqCW585pz4Wch; Wed, 26 Aug 2020 02:13:27 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93DFEB958; Wed, 26 Aug 2020 02:13:27 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q2DR5U033521; Wed, 26 Aug 2020 02:13:27 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q2DRZH033520; Wed, 26 Aug 2020 02:13:27 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202008260213.07Q2DRZH033520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 26 Aug 2020 02:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364798 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 364798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:13:27 -0000 Author: scottph Date: Wed Aug 26 02:13:27 2020 New Revision: 364798 URL: https://svnweb.freebsd.org/changeset/base/364798 Log: arm64: Increase dmap size to 95 TiB The Ampere Altra has physical memory populated sparsely within the physical address space. Increase the size of the dmap to cover all physical memory. Reviewed by: andrew Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26134 Modified: head/sys/arm64/include/vmparam.h Modified: head/sys/arm64/include/vmparam.h ============================================================================== --- head/sys/arm64/include/vmparam.h Wed Aug 26 02:12:15 2020 (r364797) +++ head/sys/arm64/include/vmparam.h Wed Aug 26 02:13:27 2020 (r364798) @@ -156,8 +156,8 @@ #define VM_MIN_KERNEL_ADDRESS (0xffff000000000000UL) #define VM_MAX_KERNEL_ADDRESS (0xffff008000000000UL) -/* 2 TiB maximum for the direct map region */ -#define DMAP_MIN_ADDRESS (0xfffffd0000000000UL) +/* 95 TiB maximum for the direct map region */ +#define DMAP_MIN_ADDRESS (0xffffa00000000000UL) #define DMAP_MAX_ADDRESS (0xffffff0000000000UL) #define DMAP_MIN_PHYSADDR (dmap_phys_base) From owner-svn-src-head@freebsd.org Wed Aug 26 02:37:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 543113C64CA; Wed, 26 Aug 2020 02:37:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbqlY1tZ9z4X8X; Wed, 26 Aug 2020 02:37:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C43C22A; Wed, 26 Aug 2020 02:37:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q2bjqj045998; Wed, 26 Aug 2020 02:37:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q2bhwF045988; Wed, 26 Aug 2020 02:37:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202008260237.07Q2bhwF045988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 26 Aug 2020 02:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto X-SVN-Commit-Revision: 364799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:37:45 -0000 Author: asomers Date: Wed Aug 26 02:37:42 2020 New Revision: 364799 URL: https://svnweb.freebsd.org/changeset/base/364799 Log: crypto(9): add CRYPTO_BUF_VMPAGE crypto(9) functions can now be used on buffers composed of an array of vm_page_t structures, such as those stored in an unmapped struct bio. It requires the running to kernel to support the direct memory map, so not all architectures can use it. Reviewed by: markj, kib, jhb, mjg, mat, bcr (manpages) MFC after: 1 week Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25671 Modified: head/share/man/man9/crypto_buffer.9 head/share/man/man9/crypto_request.9 head/sys/crypto/ccp/ccp.c head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/dev/sec/sec.c head/sys/kern/subr_bus_dma.c head/sys/opencrypto/criov.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c Modified: head/share/man/man9/crypto_buffer.9 ============================================================================== --- head/share/man/man9/crypto_buffer.9 Wed Aug 26 02:13:27 2020 (r364798) +++ head/share/man/man9/crypto_buffer.9 Wed Aug 26 02:37:42 2020 (r364799) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2020 +.Dd August 12, 2020 .Dt CRYPTO_BUFFER 9 .Os .Sh NAME @@ -197,10 +197,17 @@ A scatter/gather list of kernel buffers as described i .It Dv CRYPTO_BUF_MBUF A network memory buffer as described in .Xr mbuf 9 . +.It Dv CRYPTO_BUF_VMPAGE +A scatter/gather list of +.Vt vm_page_t +structures describing pages in the kernel's address space. +This buffer type is only available if +.Dv CRYPTO_HAS_VMPAGE +is true. .El .Pp The structure also contains the following type-specific fields: -.Bl -tag -width " cb_buf_len" +.Bl -tag -width " cb_vm_page_offset" .It Fa cb_buf A pointer to the start of a .Dv CRYPTO_BUF_CONTIG @@ -219,6 +226,19 @@ A pointer to a .Vt struct uio for .Dv CRYPTO_BUF_UIO . +.It Fa cb_vm_page +A pointer to an array of +.Vt struct vm_page +for +.Dv CRYPTO_BUF_VMPAGE . +.It Fa cb_vm_page_len +The total amount of data included in the +.Fa cb_vm_page +array, in bytes. +.It Fa cb_vm_page_offset +Offset in bytes in the first page of +.Fa cb_vm_page +where valid data begins. .El .Ss Cursors Cursors provide a mechanism for iterating over a data buffer. Modified: head/share/man/man9/crypto_request.9 ============================================================================== --- head/share/man/man9/crypto_request.9 Wed Aug 26 02:13:27 2020 (r364798) +++ head/share/man/man9/crypto_request.9 Wed Aug 26 02:37:42 2020 (r364799) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2020 +.Dd August 12, 2020 .Dt CRYPTO_REQUEST 9 .Os .Sh NAME @@ -55,11 +55,15 @@ .Ft void .Fn crypto_use_uio "struct cryptop *crp" "struct uio *uio" .Ft void +.Fn crypto_use_vmpage "struct cryptop *crp" "vm_page_t *pages" "int len" "int offset" +.Ft void .Fn crypto_use_output_buf "struct cryptop *crp" "void *buf" "int len" .Ft void .Fn crypto_use_output_mbuf "struct cryptop *crp" "struct mbuf *m" .Ft void .Fn crypto_use_output_uio "struct cryptop *crp" "struct uio *uio" +.Ft void +.Fn crypto_use_output_vmpage "struct cryptop *crp" "vm_page_t *pages" "int len" "int offset" .Sh DESCRIPTION Each symmetric cryptographic operation in the kernel is described by an instance of @@ -141,7 +145,7 @@ mode requests. All requests must have a valid .Fa crp_buf initialized by one of the following functions: -.Bl -tag -width "Fn crypto_use_mbuf" +.Bl -tag -width "Fn crypto_use_vmpage" .It Fn crypto_use_buf Uses an array of .Fa len @@ -156,12 +160,16 @@ as the data buffer. Uses the scatter/gather list .Fa uio as the data buffer. +.It Fn crypto_use_vmpage +Uses the array of +.Vt vm_page_t +structures as the data buffer. .El .Pp One of the following functions should be used to initialize .Fa crp_obuf for requests that use separate input and output buffers: -.Bl -tag -width "Fn crypto_use_output_mbuf" +.Bl -tag -width "Fn crypto_use_output_vmpage" .It Fn crypto_use_output_buf Uses an array of .Fa len @@ -176,6 +184,10 @@ as the output buffer. Uses the scatter/gather list .Fa uio as the output buffer. +.It Fn crypto_use_output_vmpage +Uses the array of +.Vt vm_page_t +structures as the output buffer. .El .Ss Request Regions Each request describes one or more regions in the data buffers. Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/crypto/ccp/ccp.c Wed Aug 26 02:37:42 2020 (r364799) @@ -107,6 +107,10 @@ ccp_populate_sglist(struct sglist *sg, struct crypto_b case CRYPTO_BUF_CONTIG: error = sglist_append(sg, cb->cb_buf, cb->cb_buf_len); break; + case CRYPTO_BUF_VMPAGE: + error = sglist_append_vmpages(sg, cb->cb_vm_page, + cb->cb_vm_page_len, cb->cb_vm_page_offset); + break; default: error = EINVAL; } Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed Aug 26 02:37:42 2020 (r364799) @@ -272,6 +272,10 @@ ccr_populate_sglist(struct sglist *sg, struct crypto_b case CRYPTO_BUF_CONTIG: error = sglist_append(sg, cb->cb_buf, cb->cb_buf_len); break; + case CRYPTO_BUF_VMPAGE: + error = sglist_append_vmpages(sg, cb->cb_vm_page, + cb->cb_vm_page_len, cb->cb_vm_page_offset); + break; default: error = EINVAL; } Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/dev/sec/sec.c Wed Aug 26 02:37:42 2020 (r364799) @@ -851,6 +851,9 @@ sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_ case CRYPTO_BUF_MBUF: size = m_length(crp->crp_buf.cb_mbuf, NULL); break; + case CRYPTO_BUF_VMPAGE: + size = PAGE_SIZE - cb->cb_vm_page_offset; + break; default: return (EINVAL); } Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/kern/subr_bus_dma.c Wed Aug 26 02:37:42 2020 (r364799) @@ -661,6 +661,11 @@ bus_dmamap_load_crp_buffer(bus_dma_tag_t dmat, bus_dma error = _bus_dmamap_load_uio(dmat, map, cb->cb_uio, &nsegs, flags); break; + case CRYPTO_BUF_VMPAGE: + error = _bus_dmamap_load_ma(dmat, map, cb->cb_vm_page, + cb->cb_vm_page_len, cb->cb_vm_page_offset, flags, NULL, + &nsegs); + break; default: error = EINVAL; } Modified: head/sys/opencrypto/criov.c ============================================================================== --- head/sys/opencrypto/criov.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/opencrypto/criov.c Wed Aug 26 02:37:42 2020 (r364799) @@ -40,12 +40,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include + +#include +#include +#include + #include +SDT_PROVIDER_DECLARE(opencrypto); + /* - * This macro is only for avoiding code duplication, as we need to skip - * given number of bytes in the same way in three functions below. + * These macros are only for avoiding code duplication, as we need to skip + * given number of bytes in the same way in several functions below. */ #define CUIO_SKIP() do { \ KASSERT(off >= 0, ("%s: off %d < 0", __func__, off)); \ @@ -60,6 +69,18 @@ __FBSDID("$FreeBSD$"); } \ } while (0) +#define CVM_PAGE_SKIP() do { \ + KASSERT(off >= 0, ("%s: off %d < 0", __func__, off)); \ + KASSERT(len >= 0, ("%s: len %d < 0", __func__, len)); \ + while (off > 0) { \ + if (off < PAGE_SIZE) \ + break; \ + processed += PAGE_SIZE - off; \ + off -= PAGE_SIZE - off; \ + pages++; \ + } \ +} while (0) + static void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp) { @@ -128,6 +149,96 @@ cuio_getptr(struct uio *uio, int loc, int *off) return (-1); } +#if CRYPTO_MAY_HAVE_VMPAGE +/* + * Apply function f to the data in a vm_page_t list starting "off" bytes from + * the beginning, continuing for "len" bytes. + */ +static int +cvm_page_apply(vm_page_t *pages, int off, int len, + int (*f)(void *, const void *, u_int), void *arg) +{ + int processed = 0; + unsigned count; + int rval; + + CVM_PAGE_SKIP(); + while (len > 0) { + char *kaddr = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages)); + count = min(PAGE_SIZE - off, len); + rval = (*f)(arg, kaddr + off, count); + if (rval) + return (rval); + len -= count; + processed += count; + off = 0; + pages++; + } + return (0); +} + +static inline void * +cvm_page_contiguous_segment(vm_page_t *pages, size_t skip, int len) +{ + if ((skip + len - 1) / PAGE_SIZE > skip / PAGE_SIZE) + return (NULL); + + pages += (skip / PAGE_SIZE); + skip -= rounddown(skip, PAGE_SIZE); + return (((char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages))) + skip); +} + +/* + * Copy len bytes of data from the vm_page_t array, skipping the first off + * bytes, into the pointer cp. Return the number of bytes skipped and copied. + * Does not verify the length of the array. + */ +static int +cvm_page_copyback(vm_page_t *pages, int off, int len, c_caddr_t cp) +{ + int processed = 0; + unsigned count; + + CVM_PAGE_SKIP(); + while (len > 0) { + count = min(PAGE_SIZE - off, len); + bcopy(cp, (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages)) + off, + count); + len -= count; + cp += count; + processed += count; + off = 0; + pages++; + } + return (processed); +} + +/* + * Copy len bytes of data from the pointer cp into the vm_page_t array, + * skipping the first off bytes, Return the number of bytes skipped and copied. + * Does not verify the length of the array. + */ +static int +cvm_page_copydata(vm_page_t *pages, int off, int len, caddr_t cp) +{ + int processed = 0; + unsigned count; + + CVM_PAGE_SKIP(); + while (len > 0) { + count = min(PAGE_SIZE - off, len); + bcopy(((char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*pages)) + off), cp, + count); + len -= count; + cp += count; + processed += count; + off = 0; + pages++; + } + return processed; +} +#endif /* CRYPTO_MAY_HAVE_VMPAGE */ + void crypto_cursor_init(struct crypto_buffer_cursor *cc, const struct crypto_buffer *cb) @@ -142,6 +253,11 @@ crypto_cursor_init(struct crypto_buffer_cursor *cc, case CRYPTO_BUF_MBUF: cc->cc_mbuf = cb->cb_mbuf; break; + case CRYPTO_BUF_VMPAGE: + cc->cc_vmpage = cb->cb_vm_page; + cc->cc_buf_len = cb->cb_vm_page_len; + cc->cc_offset = cb->cb_vm_page_offset; + break; case CRYPTO_BUF_UIO: cc->cc_iov = cb->cb_uio->uio_iov; break; @@ -153,6 +269,8 @@ crypto_cursor_init(struct crypto_buffer_cursor *cc, } } +SDT_PROBE_DEFINE2(opencrypto, criov, cursor_advance, vmpage, "struct crypto_buffer_cursor*", "size_t"); + void crypto_cursor_advance(struct crypto_buffer_cursor *cc, size_t amount) { @@ -178,6 +296,24 @@ crypto_cursor_advance(struct crypto_buffer_cursor *cc, break; } break; + case CRYPTO_BUF_VMPAGE: + for (;;) { + SDT_PROBE2(opencrypto, criov, cursor_advance, vmpage, + cc, amount); + remain = MIN(PAGE_SIZE - cc->cc_offset, cc->cc_buf_len); + if (amount < remain) { + cc->cc_buf_len -= amount; + cc->cc_offset += amount; + break; + } + cc->cc_buf_len -= remain; + amount -= remain; + cc->cc_vmpage++; + cc->cc_offset = 0; + if (amount == 0 || cc->cc_buf_len == 0) + break; + } + break; case CRYPTO_BUF_UIO: for (;;) { remain = cc->cc_iov->iov_len - cc->cc_offset; @@ -212,6 +348,9 @@ crypto_cursor_segbase(struct crypto_buffer_cursor *cc) KASSERT((cc->cc_mbuf->m_flags & M_EXTPG) == 0, ("%s: not supported for unmapped mbufs", __func__)); return (mtod(cc->cc_mbuf, char *) + cc->cc_offset); + case CRYPTO_BUF_VMPAGE: + return ((char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS( + *cc->cc_vmpage)) + cc->cc_offset); case CRYPTO_BUF_UIO: return ((char *)cc->cc_iov->iov_base + cc->cc_offset); default: @@ -228,6 +367,8 @@ crypto_cursor_seglen(struct crypto_buffer_cursor *cc) switch (cc->cc_type) { case CRYPTO_BUF_CONTIG: return (cc->cc_buf_len); + case CRYPTO_BUF_VMPAGE: + return (PAGE_SIZE - cc->cc_offset); case CRYPTO_BUF_MBUF: if (cc->cc_mbuf == NULL) return (0); @@ -278,6 +419,26 @@ crypto_cursor_copyback(struct crypto_buffer_cursor *cc break; } break; + case CRYPTO_BUF_VMPAGE: + for (;;) { + dst = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS( + *cc->cc_vmpage)) + cc->cc_offset; + remain = MIN(PAGE_SIZE - cc->cc_offset, cc->cc_buf_len); + todo = MIN(remain, size); + memcpy(dst, src, todo); + src += todo; + cc->cc_buf_len -= todo; + if (todo < remain) { + cc->cc_offset += todo; + break; + } + size -= todo; + cc->cc_vmpage++; + cc->cc_offset = 0; + if (size == 0) + break; + } + break; case CRYPTO_BUF_UIO: for (;;) { dst = (char *)cc->cc_iov->iov_base + cc->cc_offset; @@ -339,6 +500,26 @@ crypto_cursor_copydata(struct crypto_buffer_cursor *cc break; } break; + case CRYPTO_BUF_VMPAGE: + for (;;) { + src = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS( + *cc->cc_vmpage)) + cc->cc_offset; + remain = MIN(PAGE_SIZE - cc->cc_offset, cc->cc_buf_len); + todo = MIN(remain, size); + memcpy(dst, src, todo); + src += todo; + cc->cc_buf_len -= todo; + if (todo < remain) { + cc->cc_offset += todo; + break; + } + size -= todo; + cc->cc_vmpage++; + cc->cc_offset = 0; + if (size == 0) + break; + } + break; case CRYPTO_BUF_UIO: for (;;) { src = (const char *)cc->cc_iov->iov_base + @@ -421,6 +602,15 @@ crypto_copyback(struct cryptop *crp, int off, int size case CRYPTO_BUF_MBUF: m_copyback(cb->cb_mbuf, off, size, src); break; +#if CRYPTO_MAY_HAVE_VMPAGE + case CRYPTO_BUF_VMPAGE: + MPASS(size <= cb->cb_vm_page_len); + MPASS(size + off <= + cb->cb_vm_page_len + cb->cb_vm_page_offset); + cvm_page_copyback(cb->cb_vm_page, + off + cb->cb_vm_page_offset, size, src); + break; +#endif /* CRYPTO_MAY_HAVE_VMPAGE */ case CRYPTO_BUF_UIO: cuio_copyback(cb->cb_uio, off, size, src); break; @@ -444,6 +634,15 @@ crypto_copydata(struct cryptop *crp, int off, int size case CRYPTO_BUF_MBUF: m_copydata(crp->crp_buf.cb_mbuf, off, size, dst); break; +#if CRYPTO_MAY_HAVE_VMPAGE + case CRYPTO_BUF_VMPAGE: + MPASS(size <= crp->crp_buf.cb_vm_page_len); + MPASS(size + off <= crp->crp_buf.cb_vm_page_len + + crp->crp_buf.cb_vm_page_offset); + cvm_page_copydata(crp->crp_buf.cb_vm_page, + off + crp->crp_buf.cb_vm_page_offset, size, dst); + break; +#endif /* CRYPTO_MAY_HAVE_VMPAGE */ case CRYPTO_BUF_UIO: cuio_copydata(crp->crp_buf.cb_uio, off, size, dst); break; @@ -473,6 +672,12 @@ crypto_apply_buf(struct crypto_buffer *cb, int off, in case CRYPTO_BUF_UIO: error = cuio_apply(cb->cb_uio, off, len, f, arg); break; +#if CRYPTO_MAY_HAVE_VMPAGE + case CRYPTO_BUF_VMPAGE: + error = cvm_page_apply(cb->cb_vm_page, + off + cb->cb_vm_page_offset, len, f, arg); + break; +#endif /* CRYPTO_MAY_HAVE_VMPAGE */ case CRYPTO_BUF_CONTIG: MPASS(off + len <= cb->cb_buf_len); error = (*f)(arg, cb->cb_buf + off, len); @@ -540,6 +745,12 @@ crypto_buffer_contiguous_subsegment(struct crypto_buff return (m_contiguous_subsegment(cb->cb_mbuf, skip, len)); case CRYPTO_BUF_UIO: return (cuio_contiguous_segment(cb->cb_uio, skip, len)); +#if CRYPTO_MAY_HAVE_VMPAGE + case CRYPTO_BUF_VMPAGE: + MPASS(skip + len <= cb->cb_vm_page_len); + return (cvm_page_contiguous_segment(cb->cb_vm_page, + skip + cb->cb_vm_page_offset, len)); +#endif /* CRYPTO_MAY_HAVE_VMPAGE */ case CRYPTO_BUF_CONTIG: MPASS(skip + len <= cb->cb_buf_len); return (cb->cb_buf + skip); Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/opencrypto/crypto.c Wed Aug 26 02:37:42 2020 (r364799) @@ -78,7 +78,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include + #include #include #include @@ -1218,6 +1220,8 @@ crypto_buffer_len(struct crypto_buffer *cb) if (cb->cb_mbuf->m_flags & M_PKTHDR) return (cb->cb_mbuf->m_pkthdr.len); return (m_length(cb->cb_mbuf, NULL)); + case CRYPTO_BUF_VMPAGE: + return (cb->cb_vm_page_len); case CRYPTO_BUF_UIO: return (cb->cb_uio->uio_resid); default: @@ -1232,9 +1236,25 @@ cb_sanity(struct crypto_buffer *cb, const char *name) { KASSERT(cb->cb_type > CRYPTO_BUF_NONE && cb->cb_type <= CRYPTO_BUF_LAST, ("incoming crp with invalid %s buffer type", name)); - if (cb->cb_type == CRYPTO_BUF_CONTIG) + switch (cb->cb_type) { + case CRYPTO_BUF_CONTIG: KASSERT(cb->cb_buf_len >= 0, ("incoming crp with -ve %s buffer length", name)); + break; + case CRYPTO_BUF_VMPAGE: + KASSERT(CRYPTO_HAS_VMPAGE, + ("incoming crp uses dmap on supported arch")); + KASSERT(cb->cb_vm_page_len >= 0, + ("incoming crp with -ve %s buffer length", name)); + KASSERT(cb->cb_vm_page_offset >= 0, + ("incoming crp with -ve %s buffer offset", name)); + KASSERT(cb->cb_vm_page_offset < PAGE_SIZE, + ("incoming crp with %s buffer offset greater than page size" + , name)); + break; + default: + break; + } } static void Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/opencrypto/cryptodev.h Wed Aug 26 02:37:42 2020 (r364799) @@ -205,6 +205,15 @@ #define CRYPTO_FLAG_HARDWARE 0x01000000 /* hardware accelerated */ #define CRYPTO_FLAG_SOFTWARE 0x02000000 /* software implementation */ +/* Does the kernel support vmpage buffers on this platform? */ +#ifdef __powerpc__ +#define CRYPTO_MAY_HAVE_VMPAGE 1 +#else +#define CRYPTO_MAY_HAVE_VMPAGE ( PMAP_HAS_DMAP ) +#endif +/* Does the currently running system support vmpage buffers on this platform? */ +#define CRYPTO_HAS_VMPAGE ( PMAP_HAS_DMAP ) + /* NB: deprecated */ struct session_op { u_int32_t cipher; /* ie. CRYPTO_AES_CBC */ @@ -387,7 +396,8 @@ enum crypto_buffer_type { CRYPTO_BUF_CONTIG, CRYPTO_BUF_UIO, CRYPTO_BUF_MBUF, - CRYPTO_BUF_LAST = CRYPTO_BUF_MBUF + CRYPTO_BUF_VMPAGE, + CRYPTO_BUF_LAST = CRYPTO_BUF_VMPAGE }; /* @@ -402,6 +412,11 @@ struct crypto_buffer { int cb_buf_len; }; struct mbuf *cb_mbuf; + struct { + vm_page_t *cb_vm_page; + int cb_vm_page_len; + int cb_vm_page_offset; + }; struct uio *cb_uio; }; enum crypto_buffer_type cb_type; @@ -415,11 +430,15 @@ struct crypto_buffer_cursor { char *cc_buf; struct mbuf *cc_mbuf; struct iovec *cc_iov; + vm_page_t *cc_vmpage; }; - union { - int cc_buf_len; - size_t cc_offset; - }; + /* Optional bytes of valid data remaining */ + int cc_buf_len; + /* + * Optional offset within the current buffer segment where + * valid data begins + */ + size_t cc_offset; enum crypto_buffer_type cc_type; }; @@ -509,6 +528,16 @@ _crypto_use_mbuf(struct crypto_buffer *cb, struct mbuf } static __inline void +_crypto_use_vmpage(struct crypto_buffer *cb, vm_page_t *pages, int len, + int offset) +{ + cb->cb_vm_page = pages; + cb->cb_vm_page_len = len; + cb->cb_vm_page_offset = offset; + cb->cb_type = CRYPTO_BUF_VMPAGE; +} + +static __inline void _crypto_use_uio(struct crypto_buffer *cb, struct uio *uio) { cb->cb_uio = uio; @@ -528,6 +557,12 @@ crypto_use_mbuf(struct cryptop *crp, struct mbuf *m) } static __inline void +crypto_use_vmpage(struct cryptop *crp, vm_page_t *pages, int len, int offset) +{ + _crypto_use_vmpage(&crp->crp_buf, pages, len, offset); +} + +static __inline void crypto_use_uio(struct cryptop *crp, struct uio *uio) { _crypto_use_uio(&crp->crp_buf, uio); @@ -543,6 +578,13 @@ static __inline void crypto_use_output_mbuf(struct cryptop *crp, struct mbuf *m) { _crypto_use_mbuf(&crp->crp_obuf, m); +} + +static __inline void +crypto_use_output_vmpage(struct cryptop *crp, vm_page_t *pages, int len, + int offset) +{ + _crypto_use_vmpage(&crp->crp_obuf, pages, len, offset); } static __inline void Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Wed Aug 26 02:13:27 2020 (r364798) +++ head/sys/opencrypto/cryptosoft.c Wed Aug 26 02:37:42 2020 (r364799) @@ -980,6 +980,10 @@ swcr_compdec(struct swcr_session *ses, struct cryptop } } break; + case CRYPTO_BUF_VMPAGE: + adj = crp->crp_payload_length - result; + crp->crp_buf.cb_vm_page_len -= adj; + break; default: break; } From owner-svn-src-head@freebsd.org Wed Aug 26 02:44:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0F503C6925; Wed, 26 Aug 2020 02:44:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbqvS4H5Vz4XdM; Wed, 26 Aug 2020 02:44:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71FA6C39A; Wed, 26 Aug 2020 02:44:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q2iaCg051940; Wed, 26 Aug 2020 02:44:36 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q2iaI6051938; Wed, 26 Aug 2020 02:44:36 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202008260244.07Q2iaI6051938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 26 Aug 2020 02:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364800 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 364800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 02:44:36 -0000 Author: asomers Date: Wed Aug 26 02:44:35 2020 New Revision: 364800 URL: https://svnweb.freebsd.org/changeset/base/364800 Log: geli: use unmapped I/O Use unmapped I/O for geli. Unlike most geom providers, geli needs to manipulate data on every read or write. Previously it would always map bios. On my 16-core, dual socket server using geli atop md(4) devices, with 512B sectors, this change increases geli IOPs by about 3x. Note that geli still can't use unmapped I/O when data integrity verification is enabled (but it could, with a little more work). And it can't use unmapped I/O in combination with ZFS, because ZFS uses mapped bios. Reviewed by: markj, kib, jhb, mjg, mat, bcr (manpages) MFC after: 1 week Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25671 Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Aug 26 02:37:42 2020 (r364799) +++ head/sys/geom/eli/g_eli.c Wed Aug 26 02:44:35 2020 (r364800) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -972,6 +974,15 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, */ pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; + if (CRYPTO_HAS_VMPAGE) { + /* + * On DMAP architectures we can use unmapped I/O. But don't + * use it with data integrity verification. That code hasn't + * been written yet. + */ + if ((sc->sc_flags & G_ELI_FLAG_AUTH) == 0) + pp->flags |= G_PF_ACCEPT_UNMAPPED; + } pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; LIST_FOREACH(gap, &bpp->aliases, ga_next) Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Wed Aug 26 02:37:42 2020 (r364799) +++ head/sys/geom/eli/g_eli_privacy.c Wed Aug 26 02:44:35 2020 (r364800) @@ -63,6 +63,28 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_ELI); /* + * Copy data from a (potentially unmapped) bio to a kernelspace buffer. + * + * The buffer must have at least as much room as bp->bio_length. + */ +static void +g_eli_bio_copyin(struct bio *bp, void *kaddr) +{ + struct uio uio; + struct iovec iov[1]; + + iov[0].iov_base = kaddr; + iov[0].iov_len = bp->bio_length; + uio.uio_iov = iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = bp->bio_length; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uiomove_fromphys(bp->bio_ma, bp->bio_ma_offset, bp->bio_length, &uio); +} + +/* * The function is called after we read and decrypt data. * * g_eli_start -> g_eli_crypto_read -> g_io_request -> g_eli_read_done -> g_eli_crypto_run -> G_ELI_CRYPTO_READ_DONE -> g_io_deliver @@ -98,8 +120,7 @@ g_eli_crypto_read_done(struct cryptop *crp) */ if (bp->bio_inbed < bp->bio_children) return (0); - free(bp->bio_driver2, M_ELI); - bp->bio_driver2 = NULL; + if (bp->bio_error != 0) { G_ELI_LOGREQ(0, bp, "Crypto READ request failed (error=%d).", bp->bio_error); @@ -167,6 +188,11 @@ g_eli_crypto_write_done(struct cryptop *crp) return (0); } cbp->bio_data = bp->bio_driver2; + /* + * Clear BIO_UNMAPPED, which was inherited from where we cloned the bio + * in g_eli_start, because we manually set bio_data + */ + cbp->bio_flags &= ~BIO_UNMAPPED; cbp->bio_done = g_eli_write_done; cp = LIST_FIRST(&gp->consumer); cbp->bio_to = cp->provider; @@ -236,10 +262,12 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio * { struct g_eli_softc *sc; struct cryptop *crp; + vm_page_t *pages; u_int i, nsec, secsize; off_t dstoff; - u_char *data; + u_char *data = NULL; int error; + int pages_offset; G_ELI_LOGREQ(3, bp, "%s", __func__); @@ -258,16 +286,37 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio * if (bp->bio_cmd == BIO_WRITE) { data = malloc(bp->bio_length, M_ELI, M_WAITOK); bp->bio_driver2 = data; - bcopy(bp->bio_data, data, bp->bio_length); - } else - data = bp->bio_data; + /* + * This copy could be eliminated by using crypto's output + * buffer, instead of using a single overwriting buffer. + */ + if ((bp->bio_flags & BIO_UNMAPPED) != 0) + g_eli_bio_copyin(bp, data); + else + bcopy(bp->bio_data, data, bp->bio_length); + } else { + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + pages = bp->bio_ma; + pages_offset = bp->bio_ma_offset; + } else { + data = bp->bio_data; + } + } for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = crypto_getreq(wr->w_sid, M_WAITOK); - crypto_use_buf(crp, data, secsize); + if (data) { + crypto_use_buf(crp, data, secsize); + data += secsize; + } else { + MPASS(pages != NULL); + crypto_use_vmpage(crp, pages, secsize, pages_offset); + pages_offset += secsize; + pages += pages_offset >> PAGE_SHIFT; + pages_offset &= PAGE_MASK; + } crp->crp_opaque = (void *)bp; - data += secsize; if (bp->bio_cmd == BIO_WRITE) { crp->crp_op = CRYPTO_OP_ENCRYPT; crp->crp_callback = g_eli_crypto_write_done; From owner-svn-src-head@freebsd.org Wed Aug 26 03:41:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7152E3C77C8; Wed, 26 Aug 2020 03:41:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbs962T9Pz4btC; Wed, 26 Aug 2020 03:41:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39484CAE1; Wed, 26 Aug 2020 03:41:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q3fUxj085681; Wed, 26 Aug 2020 03:41:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q3fUgr085666; Wed, 26 Aug 2020 03:41:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202008260341.07Q3fUgr085666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 26 Aug 2020 03:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364801 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 364801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 03:41:30 -0000 Author: emaste Date: Wed Aug 26 03:41:29 2020 New Revision: 364801 URL: https://svnweb.freebsd.org/changeset/base/364801 Log: depend-cleanup.sh: add a note about removing old entries Modified: head/tools/build/depend-cleanup.sh Modified: head/tools/build/depend-cleanup.sh ============================================================================== --- head/tools/build/depend-cleanup.sh Wed Aug 26 02:44:35 2020 (r364800) +++ head/tools/build/depend-cleanup.sh Wed Aug 26 03:41:29 2020 (r364801) @@ -11,6 +11,11 @@ # We handle those cases here in an ad-hoc fashion by looking for the known- # bad case in the main .depend file, and if found deleting all of the related # .depend files (including for example the lib32 version). +# +# These tests increase the build time (albeit by a small amount), so they +# should be removed once enough time has passed and it is extremely unlikely +# anyone would try a NO_CLEAN build against an object tree from before the +# related change. One year should be sufficient. OBJTOP=$1 if [ ! -d "$OBJTOP" ]; then From owner-svn-src-head@freebsd.org Wed Aug 26 04:01:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71AA53C8087; Wed, 26 Aug 2020 04:01:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbsbl2Q8wz4chS; Wed, 26 Aug 2020 04:01:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375B2CF76; Wed, 26 Aug 2020 04:01:07 +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 07Q4174J096820; Wed, 26 Aug 2020 04:01:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q417T2096819; Wed, 26 Aug 2020 04:01:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202008260401.07Q417T2096819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 26 Aug 2020 04:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364802 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 364802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 04:01:07 -0000 Author: emaste Date: Wed Aug 26 04:01:06 2020 New Revision: 364802 URL: https://svnweb.freebsd.org/changeset/base/364802 Log: Apply a big hammer for stale pre-OpenZFS files -DNO_CLEAN builds have had trouble across the OpenZFS import. It's not worth the effort to try to address this with any granularity; instead, just trigger on a .depend file indicating a tree from before the import, and remove the whole cddl object tree. Reviewed by: mmacy, kevans Differential Revision: https://reviews.freebsd.org/D26189 Modified: head/tools/build/depend-cleanup.sh Modified: head/tools/build/depend-cleanup.sh ============================================================================== --- head/tools/build/depend-cleanup.sh Wed Aug 26 03:41:29 2020 (r364801) +++ head/tools/build/depend-cleanup.sh Wed Aug 26 04:01:06 2020 (r364802) @@ -43,3 +43,11 @@ clean_dep lib/libc shm_open S clean_dep lib/libomp ittnotify_static c # 20200414 r359930 closefrom clean_dep lib/libc closefrom S + +# 20200826 r364746 OpenZFS merge, apply a big hammer (remove whole tree) +if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \ + egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \ + "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then + echo "Removing old ZFS tree" + rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl +fi From owner-svn-src-head@freebsd.org Wed Aug 26 04:24:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF7C03C8785; Wed, 26 Aug 2020 04:24:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbt6C190gz4dRt; Wed, 26 Aug 2020 04:24:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id AmydkltvvYYpxAmyekSlJ3; Tue, 25 Aug 2020 22:24:01 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=dLfdeUgLZtNwh5DCnN0A:9 a=CjuIK1q_8ugA:10 a=OJAZQCPpPQ8A:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=QOGEsqRv6VhmHaoFNykA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 528C2400; Tue, 25 Aug 2020 21:23:58 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07Q4NwVi055225; Tue, 25 Aug 2020 21:23:58 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008260423.07Q4NwVi055225@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matt Macy cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364746 - in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd... In-reply-to: <202008250221.07P2LRST044836@repo.freebsd.org> References: <202008250221.07P2LRST044836@repo.freebsd.org> Comments: In-reply-to Matt Macy message dated "Tue, 25 Aug 2020 02:21:27 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 25 Aug 2020 21:23:58 -0700 X-CMAE-Envelope: MS4wfO1+NIsBJOdrATMhGYin0ZwSnxgy0fHOCzHVrWowFU6Y3Sxhssif74GvG6QIesFuzn2NX6OefPeG1bzoTZ74pJrz2JQYzpKP3bupNeWdW79HF9I0tKcg zzEZxWlhlJAauJnwF4b1mCORR3J/jKRt6WdV9NHVPpZgoPhdIILUSM7phj0ru3GCld+iiQk0eEpjy3Bz5nsTg6xNyVxgea6vnDPpspYVAM3aKiQ9kk24xP3V CptaDf2S+dV46t6Ys1ENNaFbFOazyqjLng5aPWJGCVPYCv/nM6irHWahSe4y5cxw X-Rspamd-Queue-Id: 4Bbt6C190gz4dRt X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [0.99 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.18)[0.177]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.04)[0.045]; NEURAL_HAM_LONG(-0.54)[-0.535]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.137:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 04:24:04 -0000 In message <202008250221.07P2LRST044836@repo.freebsd.org>, Matt Macy writes: > Author: mmacy > Date: Tue Aug 25 02:21:27 2020 > New Revision: 364746 > URL: https://svnweb.freebsd.org/changeset/base/364746 > > Log: > Merge OpenZFS support in to HEAD. > > The primary benefit is maintaining a completely shared > code base with the community allowing FreeBSD to receive > new features sooner and with less effort. > > I would advise against doing 'zpool upgrade' > or creating indispensable pools using new > features until this change has had a month+ > to soak. > > Work on merging FreeBSD support in to what was > at the time "ZFS on Linux" began in August 2018. > I first publicly proposed transitioning FreeBSD > to (new) OpenZFS on December 18th, 2018. FreeBSD > support in OpenZFS was finally completed in December > 2019. A CFT for downstreaming OpenZFS support in > to FreeBSD was first issued on July 8th. All issues > that were reported have been addressed or, for > a couple of less critical matters there are > pull requests in progress with OpenZFS. iXsystems > has tested and dogfooded extensively internally. > The TrueNAS 12 release is based on OpenZFS with > some additional features that have not yet made > it upstream. > > Improvements include: > project quotas, encrypted datasets, > allocation classes, vectorized raidz, > vectorized checksums, various command line > improvements, zstd compression. > > Thanks to those who have helped along the way: > Ryan Moeller, Allan Jude, Zack Welch, and many > others. > > Sponsored by: iXsystems, Inc. > Differential Revision: https://reviews.freebsd.org/D25872 > Relnotes? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Aug 26 04:29:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0613D3C87D7 for ; Wed, 26 Aug 2020 04:29:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbtDD4vWgz4dr0 for ; Wed, 26 Aug 2020 04:29:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x742.google.com with SMTP id p25so844147qkp.2 for ; Tue, 25 Aug 2020 21:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gj157nNKMmeLBMhI3AEB/Kw2EnCdzo8k6+So0EVQ7rE=; b=wyNl/n5yYCERGkaU2Mim71564Ec0e+bPmYDY6fStUNVc2ACjR7asmGJHpcr9sOIdTa QkE1pX6iz0pNMN4hdc3o5ffE3jnOnSYs2rs2sBSdLaaqib4XNNZJxPU0KTvtTAmB5vOj LeMR57QYb45tdbwLn3Z1otd0BgJiZx7ijRs0xOeLk4whIfAhmpuyoU8uy3Mzs7Ou1vKo Upae8dcmAspgIt3dQJanyhQaw24EDH95D4AgWLcvBg74DWxNlXEkz0cAd9rQuwqAfSMf c3zOlcwRh79DkvXyDmOzRhhmS9ndIWf7qJ4n76/KocMZpBXL+5nLbHbHsPP5hpY9cYw4 H4EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gj157nNKMmeLBMhI3AEB/Kw2EnCdzo8k6+So0EVQ7rE=; b=ZcGKPN0xOZ3r0NzpUi78B/YMjlFKQo3K2r8pvlvqv++dNCqYDqac5k8cJUiVyv3rsE sQU+ZvGBG6yCDEUuYkF+u4k1eYCRO8ymn79C6Dt3b3sqcop+jpRvgSNn5jqXEPswk1AS LaIEJHX8vH55+sBCBSed+ia/+0bpmcSKGfUsiKDJ36u1AmWWrsEMuxHqO+M4/ozAd4ep FVgwEi46MuOReladRbXK5Pg2jFyyY3jAGSCH3UP6RRo87HWU5eB5RAKdk45T2YK3N1pa kZvkYW8HxMWkXu6y6QlizLHmtAOxo4l8be5/QSt2vQ64+tCdIG5TsNwl7QT9Ok22l9WQ AHhg== X-Gm-Message-State: AOAM533DD02gLb6V9kDlTU4O2Z3avy+r4AiTWR8hcG/yzUspgtJhHBHS c3mTTXwfUbKqRoyV8XEuzjvEueXZaTDJb9wIbK+NaEgU9mk= X-Google-Smtp-Source: ABdhPJw3WpYM1P9MOZDzOvIa/m01rovvbwGIx+Ff/NWt07vkxOqJtoEVbyI37Nlbl/HnHzKOP+czgx9SLeRC/amt2CU= X-Received: by 2002:a37:b801:: with SMTP id i1mr11624345qkf.240.1598416155953; Tue, 25 Aug 2020 21:29:15 -0700 (PDT) MIME-Version: 1.0 References: <202008251904.07PJ4srL068863@repo.freebsd.org> <20200825201736.GC43898@spindle.one-eyed-alien.net> In-Reply-To: <20200825201736.GC43898@spindle.one-eyed-alien.net> From: Warner Losh Date: Tue, 25 Aug 2020 22:29:03 -0600 Message-ID: Subject: Re: svn commit: r364781 - in head/sys: conf modules/zfs To: Brooks Davis Cc: Brandon Bergren , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4BbtDD4vWgz4dr0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=wyNl/n5y; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::742) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.62 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.23)[-0.226]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.102]; NEURAL_HAM_LONG(-0.50)[-0.495]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::742:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 04:29:18 -0000 Got diffs? Warner On Tue, Aug 25, 2020, 2:17 PM Brooks Davis wrote: > On Tue, Aug 25, 2020 at 07:04:54PM +0000, Brandon Bergren wrote: > > Author: bdragon > > Date: Tue Aug 25 19:04:54 2020 > > New Revision: 364781 > > URL: https://svnweb.freebsd.org/changeset/base/364781 > > > > Log: > > [PowerPC] More preemptive powerpcspe ZFS build fixes > > > > I went through the merge and found the rest of the instances where > > ${MACHINE_ARCH} == "powerpc" was being used to detect 32-bit and > adjusted > > the rest of the instances to also check for powerpcspe. > > > > mips32* will probably want to do the same. > > > > Sponsored by: Tag1 Consulting, Inc. > > > > Modified: > > head/sys/conf/kern.pre.mk > > head/sys/modules/zfs/Makefile > > > > Modified: head/sys/conf/kern.pre.mk > > > ============================================================================== > > --- head/sys/conf/kern.pre.mk Tue Aug 25 18:54:10 2020 (r364780) > > +++ head/sys/conf/kern.pre.mk Tue Aug 25 19:04:54 2020 (r364781) > > @@ -257,7 +257,7 @@ ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 > -DHAVE_ > > .endif > > > > .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ > > - ${MACHINE_ARCH} == "arm" > > + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" > > ZFS_CFLAGS+= -DBITS_PER_LONG=32 > > .else > > ZFS_CFLAGS+= -DBITS_PER_LONG=64 > > In CheriBSD we've added a MACHINE_ABI variable that could be used to > simplify this mess of checks. > > > https://github.com/CTSRD-CHERI/cheribsd/blob/5ee735e5f8ef7268731359a2d8a9a8218df2d23f/share/mk/bsd.cpu.mk#L478 > > As currently implemented you'd use: > > .if ${MACHINE_ABI:Mptr64} > > There's be a argument for adding long32 and long64 for to avoid > conflating long and pointer size. > > -- Brooks > From owner-svn-src-head@freebsd.org Wed Aug 26 05:31:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC2833C9F8D; Wed, 26 Aug 2020 05:31:28 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bbvc05Tv9z4hRH; Wed, 26 Aug 2020 05:31:28 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1598419888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GhFUoPji7VY/Fc+KeWkFp+zLTH7w8GX5r8x9Gg/xN2U=; b=Ts5Sz+l0MZZbfIdoGzvvrqV5PXxxFuitUDjcgCh10NnpE0VJG0TVay+EBqHTpxQMcTGlIs Wp0W/H6o3i2zZ2QeqrYXmpQU2Bx62syfS86GlATCkvC2H6H0KOzKnkMeAnqs2kUiIFiC0O typMiW1A2nOnBpWWwivuJKHnMMVLtn8gOgW7jMj2qPyNX5KWV/db6k5+L2rNOp0EJGzeZz wDH5auRvBrtU4/a7vPLQ8qwecu6GcTFNN1Pwxo4FCNLl6wrgSw8ttbRti6gtMnMLOmmdjj g6Ab0JN3MHrNOXdPLpgBGHSdT3BiyQnJxR/DMkOBYyntg1MB5fA1QpOyn8mgoQ== Received: by freefall.freebsd.org (Postfix, from userid 1033) id AD1FA9241; Wed, 26 Aug 2020 05:31:28 +0000 (UTC) Date: Wed, 26 Aug 2020 05:31:28 +0000 From: Alexey Dokuchaev To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364746 - in head: . cddl/compat/opensolaris/include cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd... Message-ID: <20200826053128.GA85697@FreeBSD.org> References: <202008250221.07P2LRST044836@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008250221.07P2LRST044836@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1598419888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GhFUoPji7VY/Fc+KeWkFp+zLTH7w8GX5r8x9Gg/xN2U=; b=mZJ2iLGnZDCrc68f89N4X6QA8BQJ1fvmOKyHd+DH032Jq3U4NG0ilH26qo+EKafooIvDbc ydmtgsYVrZlPykffFEATifc1E2Inld0pJhhVl1YKzbFaX8+b7euzu7Ro91rwnJreertCdw VHkXzuibGWWMXpmxrXL7zV2QcBUTmW2kQyF+An5dRRD+pi6EFLdxNLazGnjlSxIhwNz3Vr Lno6icbuxbalNYLA2zxOmflzMeNwYkc35+0xRibGAP0ibdYVqyCS6NGBiuBeTwxTWTJD+R Ll+F1TTNYIJMCpbIwzSHFFlfo6KGXF1JFwcm5M0gAjy+ps4SuPPv9EYZ9mwfXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1598419888; a=rsa-sha256; cv=none; b=BOYJYwemMv/PG6M4TXpN8yrxo+te3S5Ov64y/Aqk5HO1eiKrXBiRME3qy3955UlpDGJkTB y2qW4ayLmlmn42P1NxVke8aG894CUHQZrFqjE3Eq2cc7LOGwjU7l0pW0lIZ5K7hBZqECga 9JCKS9tamxN6EjsAaVPX8esyePkVWFhYVtS/dDp3pa6jasutK4bqaNMAsQqxB3/H3PWIgp UoTTN2Y059bDfNgoH/6IPZbHdIbesU+/om5UHVTkdQ6LDJIKEJMf/wiGWEaswVfviO4NxV pobWpLbW1NO3DQsF6oWZwkIRvSYECoyZYSTy52EXGPauLoTykdbpswRi+S8Hog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 05:31:28 -0000 On Tue, Aug 25, 2020 at 02:21:27AM +0000, Matt Macy wrote: > New Revision: 364746 > URL: https://svnweb.freebsd.org/changeset/base/364746 > > Log: > Merge OpenZFS support in to HEAD. > > The primary benefit is maintaining a completely shared > code base with the community allowing FreeBSD to receive > new features sooner and with less effort. This commit raises several questions. To start, I see a lot of things checked in under `sys/contrib/openzfs' which do not belong to the kernel (e.g. userland programs, libraries, manpages, bash completions, test suite, etc/sudoers.d) or FreeBSD at all (init.d, initramfs, systemd). Why those bits were not cleaned up, or at least kept on the vendor branch only? > Improvements include: > project quotas, encrypted datasets, > allocation classes, vectorized raidz, > vectorized checksums, various command line > improvements, zstd compression. And what about regressions? Would illumos (opensolaris) ZFS be also offered, maybe from ports, for those of us who prefer stable and highly reliable implementation? > Added: head/cddl/lib/libicp/Makefile > ... > + core/kcf_prov_lib.c \ > + core/kcf_callprov.c \ > + core/kcf_mech_tabs.c \ > + core/kcf_prov_tabs.c \ > + $(ASM_SOURCES_C) > + > + > + > + > + > + > +SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) There are many excessive whitespace bugs, this is the most prominent. How did they pass the review? ./danfe From owner-svn-src-head@freebsd.org Wed Aug 26 07:00:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91E933CBA3D; Wed, 26 Aug 2020 07:00:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbxZJ3Qzwz4mQj; Wed, 26 Aug 2020 07:00:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 416FFF227; Wed, 26 Aug 2020 07:00:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q708C0005969; Wed, 26 Aug 2020 07:00:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q708KR005968; Wed, 26 Aug 2020 07:00:08 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008260700.07Q708KR005968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 26 Aug 2020 07:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364805 - head/sys/cddl/contrib/opensolaris/uts/common/fs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs X-SVN-Commit-Revision: 364805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 07:00:08 -0000 Author: tsoome Date: Wed Aug 26 07:00:07 2020 New Revision: 364805 URL: https://svnweb.freebsd.org/changeset/base/364805 Log: remove left over empty directory 364746 did leave empty directory around. Deleted: head/sys/cddl/contrib/opensolaris/uts/common/fs/ From owner-svn-src-head@freebsd.org Wed Aug 26 07:29:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D2063CC33C; Wed, 26 Aug 2020 07:29:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BbyCz0wC1z4nfV; Wed, 26 Aug 2020 07:29:19 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2142F9B1; Wed, 26 Aug 2020 07:29:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q7TI5Q023751; Wed, 26 Aug 2020 07:29:18 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q7THlo023745; Wed, 26 Aug 2020 07:29:17 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008260729.07Q7THlo023745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 26 Aug 2020 07:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364806 - in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl X-SVN-Commit-Revision: 364806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 07:29:19 -0000 Author: tsoome Date: Wed Aug 26 07:29:17 2020 New Revision: 364806 URL: https://svnweb.freebsd.org/changeset/base/364806 Log: remove pragma ident lines The #pragma ident is historical relict and not needed any more, this pragma is actually unknown for common compilers and is only causing trouble. Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed Aug 26 07:29:17 2020 (r364806) @@ -26,8 +26,6 @@ #ifndef _SYS_ACL_IMPL_H #define _SYS_ACL_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed Aug 26 07:29:17 2020 (r364806) @@ -31,8 +31,6 @@ #ifndef _SYS_CMN_ERR_H #define _SYS_CMN_ERR_H -#pragma ident "%Z%%M% %I% %E% SMI" - #if !defined(_ASM) #include #endif Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed Aug 26 07:29:17 2020 (r364806) @@ -26,8 +26,6 @@ #ifndef _SYS_EXTDIRENT_H #define _SYS_EXTDIRENT_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 07:29:17 2020 (r364806) @@ -26,8 +26,6 @@ #ifndef _SYS_LIST_H #define _SYS_LIST_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed Aug 26 07:29:17 2020 (r364806) @@ -27,8 +27,6 @@ #ifndef _SYS_LIST_IMPL_H #define _SYS_LIST_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 07:29:17 2020 (r364806) @@ -27,8 +27,6 @@ #ifndef _ZMOD_H #define _ZMOD_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/list.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 07:00:07 2020 (r364805) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 07:29:17 2020 (r364806) @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Generic doubly-linked list implementation */ From owner-svn-src-head@freebsd.org Wed Aug 26 09:19:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 718FC3CF33C; Wed, 26 Aug 2020 09:19:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc0gP2V8rz4vW3; Wed, 26 Aug 2020 09:19:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3906510A56; Wed, 26 Aug 2020 09:19:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q9JjxW091143; Wed, 26 Aug 2020 09:19:45 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q9JieJ091141; Wed, 26 Aug 2020 09:19:44 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008260919.07Q9JieJ091141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 26 Aug 2020 09:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364807 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 364807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 09:19:45 -0000 Author: arichardson Date: Wed Aug 26 09:19:44 2020 New Revision: 364807 URL: https://svnweb.freebsd.org/changeset/base/364807 Log: Fix builds that set LD=ld.lld after r364761 When using relative paths for the linker we have to transform the name since clang does not like -fuse-ld=ld.lld and instead requires -fuse-ld=lld (the same also applies for ld.bfd). Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Wed Aug 26 07:29:17 2020 (r364806) +++ head/share/mk/bsd.sys.mk Wed Aug 26 09:19:44 2020 (r364807) @@ -289,7 +289,8 @@ CFLAGS+= ERROR-tried-to-rebuild-during-make-install # Add -fuse-ld=${LD} if $LD is in a different directory or not called "ld". # Note: Clang 12+ will prefer --ld-path= over -fuse-ld=. .if ${COMPILER_TYPE} == "clang" -LDFLAGS+= -fuse-ld=${LD:[1]} +# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. +LDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks. Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Wed Aug 26 07:29:17 2020 (r364806) +++ head/sys/conf/kern.mk Wed Aug 26 09:19:44 2020 (r364807) @@ -278,7 +278,8 @@ CFLAGS+= -std=${CSTD} # Note: unlike bsd.sys.mk we can't use LDFLAGS here since that is used for the # flags required when linking the kernel. We don't need those flags when # building the vdsos. However, we do need -fuse-ld, so use ${CCLDFLAGS} instead. -CCLDFLAGS+= -fuse-ld=${LD:[1]} +# Note: Clang does not like relative paths in -fuse-ld so we map ld.lld -> lld. +CCLDFLAGS+= -fuse-ld=${LD:[1]:S/^ld.//1W} .else # GCC does not support an absolute path for -fuse-ld so we just print this # warning instead and let the user add the required symlinks. From owner-svn-src-head@freebsd.org Wed Aug 26 09:19:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6E713CF2A6; Wed, 26 Aug 2020 09:19:50 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc0gV2W2Xz4v8s; Wed, 26 Aug 2020 09:19:50 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A1DA10D84; Wed, 26 Aug 2020 09:19:50 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07Q9JnG9091197; Wed, 26 Aug 2020 09:19:49 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07Q9Jnhr091196; Wed, 26 Aug 2020 09:19:49 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008260919.07Q9Jnhr091196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 26 Aug 2020 09:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364808 - head/lib X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib X-SVN-Commit-Revision: 364808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 09:19:51 -0000 Author: arichardson Date: Wed Aug 26 09:19:49 2020 New Revision: 364808 URL: https://svnweb.freebsd.org/changeset/base/364808 Log: Move libsqlite3 to the top of the SUBDIR list In parallel builds, this should allow sqlite to start building earlier and increase parallelism when building lib/. Looking at htop output during buildworld/tinderbox, there are long phases where only one CPU is active optimizing the massive sqlite3.c file since the build of libsqlite3 is started quite late. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D26169 Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Aug 26 09:19:44 2020 (r364807) +++ head/lib/Makefile Wed Aug 26 09:19:49 2020 (r364808) @@ -23,9 +23,12 @@ SUBDIR_BOOTSTRAP= \ msun # The main list; please keep these sorted alphabetically. +# The only exception is sqlite3: we place it at the start of the list since it +# takes a long time to build and starting it first improves parallelism. SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ + libsqlite3 \ geom \ libalias \ libarchive \ @@ -84,7 +87,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ librtld_db \ libsbuf \ libsmb \ - libsqlite3 \ libstdbuf \ libstdthreads \ libsysdecode \ From owner-svn-src-head@freebsd.org Wed Aug 26 10:21:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 877DD3D06E8; Wed, 26 Aug 2020 10:21:39 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc22q35XXz3VX7; Wed, 26 Aug 2020 10:21:39 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E7391135E; Wed, 26 Aug 2020 10:21:39 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QALdaw030264; Wed, 26 Aug 2020 10:21:39 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QALcXZ030262; Wed, 26 Aug 2020 10:21:38 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008261021.07QALcXZ030262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 26 Aug 2020 10:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364809 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 364809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 10:21:39 -0000 Author: arichardson Date: Wed Aug 26 10:21:38 2020 New Revision: 364809 URL: https://svnweb.freebsd.org/changeset/base/364809 Log: Avoid recomputing COMPILER_/LINKER_ variables when set explicitly I noticed that when we build libraries for a different ABI (in CheriBSD) we were calling ${XCC}/${LD} --version for every directory. It turns out that this was caused by bsd.compat.mk explicitly setting (X_)COMPILER variables for that build stage and this stops the _can_export logic from working. To fix this, we change the check to only set _can_export=no if the variable is set and it is set to a different value than the cached value. This noticeably speeds up the tree walk while building compat libraries. During an upstream amd64 buildworld this also removes 8 --version calls. Obtained from: CheriBSD Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25986 Modified: head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Aug 26 09:19:49 2020 (r364808) +++ head/share/mk/bsd.compiler.mk Wed Aug 26 10:21:38 2020 (r364809) @@ -146,10 +146,13 @@ _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSI ${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR ${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} ${X_}_cc_hash:= ${${X_}_cc_hash:hash} -# Only import if none of the vars are set somehow else. +# Only import if none of the vars are set differently somehow else. _can_export= yes .for var in ${_exported_vars} -.if defined(${var}) +.if defined(${var}) && (!defined(${var}__${${X_}_cc_hash}) || ${${var}__${${X_}_cc_hash}} != ${${var}}) +.if defined(${var}__${${X_}_ld_hash}) +.info "Cannot import ${X_}COMPILER variables since cached ${var} is different: ${${var}__${${X_}_cc_hash}} != ${${var}}" +.endif _can_export= no .endif .endfor Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Wed Aug 26 09:19:49 2020 (r364808) +++ head/share/mk/bsd.linker.mk Wed Aug 26 10:21:38 2020 (r364809) @@ -41,10 +41,13 @@ _exported_vars= ${X_}LINKER_TYPE ${X_}LINKER_VERSION $ ${X_}LINKER_FREEBSD_VERSION ${X_}_ld_hash= ${${ld}}${MACHINE}${PATH} ${X_}_ld_hash:= ${${X_}_ld_hash:hash} -# Only import if none of the vars are set somehow else. +# Only import if none of the vars are set differently somehow else. _can_export= yes .for var in ${_exported_vars} -.if defined(${var}) +.if defined(${var}) && (!defined(${var}__${${X_}_ld_hash}) || ${${var}__${${X_}_ld_hash}} != ${${var}}) +.if defined(${var}__${${X_}_ld_hash}) +.info "Cannot import ${X_}LINKER variables since cached ${var} is different: ${${var}__${${X_}_ld_hash}} != ${${var}}" +.endif _can_export= no .endif .endfor From owner-svn-src-head@freebsd.org Wed Aug 26 11:57:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28ECA3D275F; Wed, 26 Aug 2020 11:57:56 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc49v5lMWz3d8p; Wed, 26 Aug 2020 11:57:55 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: by mail-lf1-x12b.google.com with SMTP id y26so839116lfe.2; Wed, 26 Aug 2020 04:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+PcVHigEh4qz/E0WIDCc9p3WCpmSb8WrugiuupgQQCQ=; b=VcOKcMCtq9tEODKjg7Rq1ezkFCDWrUSwcHw/K4pkuqtiqkwAcqIA2AWYTznqAKSi4b 0kNYhkbKk/B2ezKU2l0AXrgaC4eBvoyQ6Ek5kUVTNwj0Hn7cgS8k/JTLMiKHEiRI99jU F15U7Ct6PDr7dcRH7Ihz3z3SeHPwx9UY1mi7+scEpkQopi5MO/sN8YWgLSOdj7YacJdM gHyNwfxZ7cG4zFNHNYBfFbbkKUa6X36ACaoTu0ADq7HcxNpmqeeqepzmU3QMvNufLnq4 diPN41fgYT7fHQ9x6lSZP9KWO7jdAj/mscJljyRJkKF+cXLVApvrIJZgDkiM4ktBfj/d 8dDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=+PcVHigEh4qz/E0WIDCc9p3WCpmSb8WrugiuupgQQCQ=; b=rdMJ0QBuN5HMPUnMlDsTUUgI/xLAlgwWdckfy6xwmjNbHj2ysojNA9nS940uCt6ABi Hi6BhzJYzua+Ti9anbNo+oFG/Y5VbGWAnTHJ8fPcz4sd1MWE/gZWyOOVBLiecCci2ffx yXqHCduVxz/ctXQAg22pQ3n5cBqjrpLPTC/6LaK2mt7wG6QcN4n/CjbHdvXl8rbDaoIB xibN76qwujc8r21CfpEEPXVgq/2+6XgfPPBZC803DXoD6E9WAVw4vjssR7P4nFmJPzbF atI8obCT9mEUodb5ieS/xemwX06xALtXJ3eyaQqskecJZeutlZsyNLZcbEuPCBjbRF9/ BKPw== X-Gm-Message-State: AOAM5307D49psYuWb5xTsyQGCwS5Vqs+uyLWRaQ8WhUZyYyBaP+04aZL Wohd5W17bo0b7JH1b5D7YXnuRzHz0La7vQ== X-Google-Smtp-Source: ABdhPJzlfJzHZF8rB+5GcZeiVJBDXqz+6gpJMesZtmRY/LU0yw4voi4d5XV2Jm0W3RVk8t96a3FT0w== X-Received: by 2002:a19:4acd:: with SMTP id x196mr185860lfa.118.1598443073604; Wed, 26 Aug 2020 04:57:53 -0700 (PDT) Received: from kloomba ([95.104.140.4]) by smtp.gmail.com with ESMTPSA id r1sm512490lff.55.2020.08.26.04.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 04:57:52 -0700 (PDT) Sender: Roman Bogorodskiy Date: Wed, 26 Aug 2020 15:57:43 +0400 From: Roman Bogorodskiy To: Jamie Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364791 - head/usr.sbin/jail Message-ID: <20200826115743.GA1791@kloomba> References: <202008260043.07Q0h0kH077834@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <202008260043.07Q0h0kH077834@repo.freebsd.org> X-Rspamd-Queue-Id: 4Bc49v5lMWz3d8p X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 11:57:56 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jamie Gritton wrote: > Author: jamie > Date: Wed Aug 26 00:42:59 2020 > New Revision: 364791 > URL: https://svnweb.freebsd.org/changeset/base/364791 >=20 > Log: > Handle jail.conf variables that have the same names as parameters. > =20 > PR: 248444 > Submitted by: Akos Somfai > Reported by: Markus Stoff >=20 > Modified: > head/usr.sbin/jail/config.c >=20 > Modified: head/usr.sbin/jail/config.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/jail/config.c Wed Aug 26 00:31:59 2020 (r364790) > +++ head/usr.sbin/jail/config.c Wed Aug 26 00:42:59 2020 (r364791) > @@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e > else > for (ipnum =3D IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) > if (!(intparams[ipnum].flags & PF_CONV) && > - equalopts(name, intparams[ipnum].name)) { > + equalopts(name, intparams[ipnum].name) && > + !(p->flags & PF_VAR)) { > j->intparams[ipnum] =3D np; > np->flags |=3D intparams[ipnum].flags; > break; Looks like it's causing jail(8) to segfault, at least when using with poudriere: $ [00:00:00] Creating the reference jail... done [00:00:07] Mounting system devices for current-local [00:00:07] Mounting ports/packages/distfiles [00:00:07] Using packages from previously failed build: /usr/local/poudrier= e/data/packages/current-local/.building [00:00:07] Mounting ccache from: /var/cache/ccache [00:00:07] Mounting packages from: /usr/local/poudriere/data/packages/curre= nt-local [00:00:07] Copying /var/db/ports from: /usr/local/etc/poudriere.d/current-l= ocal-options [00:00:07] Appending to make.conf: /usr/local/etc/poudriere.d/current-make.= conf /etc/resolv.conf -> /usr/local/poudriere/data/.m/current-local/ref/etc/reso= lv.conf [00:00:07] Starting jail current-local Segmentation fault (core dumped) [00:00:08] Cleaning up [00:00:08] Unmounting file systems $ $ lldb /usr/sbin/jail --core /tmp/jail.core (lldb) target create "/usr/sbin/jail" --core "/tmp/jail.core" Core file '/tmp/jail.core' (x86_64) was loaded. (lldb) bt all * thread #1, name =3D 'jail', stop reason =3D signal SIGSEGV * frame #0: 0x000000000020c3fb jail`add_param(j=3D0x0000000800a09000, p= =3D, ipnum=3D, value=3D) at config.c= :399:16 frame #1: 0x0000000000207e08 jail`main(argc=3D8, argv=3D0x00007fffffffe= 8f0) at jail.c:0 frame #2: 0x0000000000206e10 jail`_start(ap=3D, cleanup=3D= ) at crt1_c.c:75:7 (lldb)=20 This works fine when I back out this change. Roman Bogorodskiy --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEi6TfKtFPmbY34ABwyW1f/gjCImoFAl9GTjUACgkQyW1f/gjC ImoeOgf9F6jI1XL7GLVdbu+Us3qRhVnxcIdRd/L1aL/eWMCwv3TfFOuf9HnOkqiv 64kjuuAFu4VCL5afNYFYjuk7vaFTrC5/W1Kq8TS6bKyuEbck3e95V4HfKCjcahVS WZQJp4AIJqz2N1Bmv7jfk7f3zXj+K6hRwTI3AawxCyxFGEmr21+5KLwFRqi+htRl rYxk94vy43zAwU56pP3Jpl+Jxgu324r5cFIOJz6wCK/UN79kcCzq7NgiWiYTTrIv +BqdqhYmDgDdr4X14Fmq951RrpJgGTHiMCjilto5u5wDUMR7q/Z/ltxG8lzFmFOA dG7aMPbZebUO7wb+s0Jq9Uco/AONGg== =JUYG -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- From owner-svn-src-head@freebsd.org Wed Aug 26 12:49:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 770843D42B1; Wed, 26 Aug 2020 12:49:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5Kc2csKz3gQ1; Wed, 26 Aug 2020 12:49:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D484131BD; Wed, 26 Aug 2020 12:49:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCneb7021779; Wed, 26 Aug 2020 12:49:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCneZQ021778; Wed, 26 Aug 2020 12:49:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261249.07QCneZQ021778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364810 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:49:40 -0000 Author: mjg Date: Wed Aug 26 12:49:39 2020 New Revision: 364810 URL: https://svnweb.freebsd.org/changeset/base/364810 Log: cache: factor dotdot lookup out of cache_lookup Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 10:21:38 2020 (r364809) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:49:39 2020 (r364810) @@ -1273,14 +1273,10 @@ cache_zap_wlocked_bucket_kl(struct namecache *ncp, str } static void -cache_lookup_unlock(struct rwlock *blp, struct mtx *vlp) +cache_lookup_unlock(struct rwlock *blp) { - if (blp != NULL) { - rw_runlock(blp); - } else { - mtx_unlock(vlp); - } + rw_runlock(blp); } static int __noinline @@ -1320,6 +1316,111 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp } static __noinline int +cache_remove_cnp(struct vnode *dvp, struct componentname *cnp); + + +static int __noinline +cache_lookup_dotdot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, + struct timespec *tsp, int *ticksp) +{ + struct namecache_ts *ncp_ts; + struct namecache *ncp; + struct mtx *dvlp; + enum vgetstate vs; + int error, ltype; + bool whiteout; + + MPASS((cnp->cn_flags & ISDOTDOT) != 0); + + if ((cnp->cn_flags & MAKEENTRY) == 0) { + cache_remove_cnp(dvp, cnp); + return (0); + } + + counter_u64_add(dotdothits, 1); +retry: + dvlp = VP2VNODELOCK(dvp); + mtx_lock(dvlp); + ncp = dvp->v_cache_dd; + if (ncp == NULL) { + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, + "..", NULL); + mtx_unlock(dvlp); + return (0); + } + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (ncp->nc_flag & NCF_NEGATIVE) + *vpp = NULL; + else + *vpp = ncp->nc_vp; + } else + *vpp = ncp->nc_dvp; + /* Return failure if negative entry was found. */ + if (*vpp == NULL) + goto negative_success; + CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", + dvp, cnp->cn_nameptr, *vpp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", + *vpp); + cache_out_ts(ncp, tsp, ticksp); + if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == + NCF_DTS && tsp != NULL) { + ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); + *tsp = ncp_ts->nc_dotdottime; + } + + /* + * On success we return a locked and ref'd vnode as per the lookup + * protocol. + */ + MPASS(dvp != *vpp); + ltype = 0; /* silence gcc warning */ + ltype = VOP_ISLOCKED(dvp); + VOP_UNLOCK(dvp); + vs = vget_prep(*vpp); + mtx_unlock(dvlp); + error = vget_finish(*vpp, cnp->cn_lkflags, vs); + vn_lock(dvp, ltype | LK_RETRY); + if (VN_IS_DOOMED(dvp)) { + if (error == 0) + vput(*vpp); + *vpp = NULL; + return (ENOENT); + } + if (error) { + *vpp = NULL; + goto retry; + } + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { + ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); + } + return (-1); +negative_success: + if (__predict_false(cnp->cn_nameiop == CREATE)) { + counter_u64_add(numnegzaps, 1); + error = cache_zap_locked_vnode(ncp, dvp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); + } + + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + cache_out_ts(ncp, tsp, ticksp); + counter_u64_add(numneghits, 1); + whiteout = (ncp->nc_flag & NCF_WHITE); + cache_negative_hit(ncp); + mtx_unlock(dvlp); + if (whiteout) + cnp->cn_flags |= ISWHITEOUT; + return (ENOENT); +} + +static __noinline int cache_remove_cnp(struct vnode *dvp, struct componentname *cnp) { struct namecache *ncp; @@ -1441,14 +1542,12 @@ int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) { - struct namecache_ts *ncp_ts; struct namecache *ncp; struct negstate *negstate; struct rwlock *blp; - struct mtx *dvlp; uint32_t hash; enum vgetstate vs; - int error, ltype; + int error; bool try_smr, doing_smr, whiteout; #ifdef DEBUG_CACHE @@ -1458,9 +1557,15 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st } #endif - if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')) - return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp)); + if (__predict_false(cnp->cn_nameptr[0] == '.')) { + if (cnp->cn_namelen == 1) + return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp)); + if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') + return (cache_lookup_dotdot(dvp, vpp, cnp, tsp, ticksp)); + } + MPASS((cnp->cn_flags & ISDOTDOT) == 0); + if ((cnp->cn_flags & MAKEENTRY) == 0) { cache_remove_cnp(dvp, cnp); return (0); @@ -1472,42 +1577,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st retry: doing_smr = false; blp = NULL; - dvlp = NULL; error = 0; - if (cnp->cn_namelen == 2 && - cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') { - counter_u64_add(dotdothits, 1); - dvlp = VP2VNODELOCK(dvp); - mtx_lock(dvlp); - ncp = dvp->v_cache_dd; - if (ncp == NULL) { - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, - "..", NULL); - mtx_unlock(dvlp); - return (0); - } - if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { - if (ncp->nc_flag & NCF_NEGATIVE) - *vpp = NULL; - else - *vpp = ncp->nc_vp; - } else - *vpp = ncp->nc_dvp; - /* Return failure if negative entry was found. */ - if (*vpp == NULL) - goto negative_success; - CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", - dvp, cnp->cn_nameptr, *vpp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", - *vpp); - cache_out_ts(ncp, tsp, ticksp); - if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == - NCF_DTS && tsp != NULL) { - ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); - *tsp = ncp_ts->nc_dotdottime; - } - goto success; - } hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); retry_hashed: @@ -1549,17 +1619,11 @@ retry_hashed: SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp); cache_out_ts(ncp, tsp, ticksp); -success: /* * On success we return a locked and ref'd vnode as per the lookup * protocol. */ MPASS(dvp != *vpp); - ltype = 0; /* silence gcc warning */ - if (cnp->cn_flags & ISDOTDOT) { - ltype = VOP_ISLOCKED(dvp); - VOP_UNLOCK(dvp); - } if (doing_smr) { if (!cache_ncp_canuse(ncp)) { vfs_smr_exit(); @@ -1574,18 +1638,9 @@ success: } } else { vs = vget_prep(*vpp); - cache_lookup_unlock(blp, dvlp); + cache_lookup_unlock(blp); } error = vget_finish(*vpp, cnp->cn_lkflags, vs); - if (cnp->cn_flags & ISDOTDOT) { - vn_lock(dvp, ltype | LK_RETRY); - if (VN_IS_DOOMED(dvp)) { - if (error == 0) - vput(*vpp); - *vpp = NULL; - return (ENOENT); - } - } if (error) { *vpp = NULL; goto retry; @@ -1598,10 +1653,17 @@ success: negative_success: /* We found a negative match, and want to create it, so purge */ - if (cnp->cn_nameiop == CREATE) { + if (__predict_false(cnp->cn_nameiop == CREATE)) { MPASS(!doing_smr); counter_u64_add(numnegzaps, 1); - goto zap_and_exit; + error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); } SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); @@ -1623,25 +1685,11 @@ negative_success: vfs_smr_exit(); } else { cache_negative_hit(ncp); - cache_lookup_unlock(blp, dvlp); + cache_lookup_unlock(blp); } if (whiteout) cnp->cn_flags |= ISWHITEOUT; return (ENOENT); - -zap_and_exit: - MPASS(!doing_smr); - if (blp != NULL) - error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); - else - error = cache_zap_locked_vnode(ncp, dvp); - if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail2++; - cache_maybe_yield(); - goto retry; - } - cache_free(ncp); - return (0); } struct celockstate { From owner-svn-src-head@freebsd.org Wed Aug 26 12:50:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B47273D4360; Wed, 26 Aug 2020 12:50:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5LB4LZKz3gbc; Wed, 26 Aug 2020 12:50:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7994012EFC; Wed, 26 Aug 2020 12:50:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCoApt021883; Wed, 26 Aug 2020 12:50:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCoAVr021882; Wed, 26 Aug 2020 12:50:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261250.07QCoAVr021882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364811 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:50:10 -0000 Author: mjg Date: Wed Aug 26 12:50:10 2020 New Revision: 364811 URL: https://svnweb.freebsd.org/changeset/base/364811 Log: cache: decouple smr and locked lookup in the slowpath Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:49:39 2020 (r364810) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:50:10 2020 (r364811) @@ -1538,17 +1538,104 @@ out_no_entry: * .., dvp is unlocked. If we're looking up . an extra ref is taken, but the * lock is not recursively acquired. */ +static int __noinline +cache_lookup_fallback(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, + struct timespec *tsp, int *ticksp) +{ + struct namecache *ncp; + struct rwlock *blp; + uint32_t hash; + enum vgetstate vs; + int error; + bool whiteout; + + MPASS((cnp->cn_flags & (MAKEENTRY | ISDOTDOT)) == MAKEENTRY); + +retry: + hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + blp = HASH2BUCKETLOCK(hash); + rw_rlock(blp); + + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + break; + } + + /* We failed to find an entry */ + if (__predict_false(ncp == NULL)) { + rw_runlock(blp); + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, + NULL); + counter_u64_add(nummiss, 1); + return (0); + } + + if (ncp->nc_flag & NCF_NEGATIVE) + goto negative_success; + + /* We found a "positive" match, return the vnode */ + counter_u64_add(numposhits, 1); + *vpp = ncp->nc_vp; + CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", + dvp, cnp->cn_nameptr, *vpp, ncp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + *vpp); + cache_out_ts(ncp, tsp, ticksp); + /* + * On success we return a locked and ref'd vnode as per the lookup + * protocol. + */ + MPASS(dvp != *vpp); + vs = vget_prep(*vpp); + cache_lookup_unlock(blp); + error = vget_finish(*vpp, cnp->cn_lkflags, vs); + if (error) { + *vpp = NULL; + goto retry; + } + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { + ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); + } + return (-1); + +negative_success: + /* We found a negative match, and want to create it, so purge */ + if (__predict_false(cnp->cn_nameiop == CREATE)) { + counter_u64_add(numnegzaps, 1); + error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); + } + + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + cache_out_ts(ncp, tsp, ticksp); + counter_u64_add(numneghits, 1); + whiteout = (ncp->nc_flag & NCF_WHITE); + cache_negative_hit(ncp); + cache_lookup_unlock(blp); + if (whiteout) + cnp->cn_flags |= ISWHITEOUT; + return (ENOENT); +} + int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) { struct namecache *ncp; struct negstate *negstate; - struct rwlock *blp; uint32_t hash; enum vgetstate vs; int error; - bool try_smr, doing_smr, whiteout; + bool whiteout; + u_short nc_flag; #ifdef DEBUG_CACHE if (__predict_false(!doingcache)) { @@ -1571,24 +1658,15 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st return (0); } - try_smr = true; + /* + * TODO: we only fallback becasue if a negative entry is found it will + * need to be purged. + */ if (cnp->cn_nameiop == CREATE) - try_smr = false; -retry: - doing_smr = false; - blp = NULL; - error = 0; + goto out_fallback; hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); -retry_hashed: - if (try_smr) { - vfs_smr_enter(); - doing_smr = true; - try_smr = false; - } else { - blp = HASH2BUCKETLOCK(hash); - rw_rlock(blp); - } + vfs_smr_enter(); CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && @@ -1598,17 +1676,15 @@ retry_hashed: /* We failed to find an entry */ if (__predict_false(ncp == NULL)) { - if (doing_smr) - vfs_smr_exit(); - else - rw_runlock(blp); + vfs_smr_exit(); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); counter_u64_add(nummiss, 1); return (0); } - if (ncp->nc_flag & NCF_NEGATIVE) + nc_flag = atomic_load_char(&ncp->nc_flag); + if (nc_flag & NCF_NEGATIVE) goto negative_success; /* We found a "positive" match, return the vnode */ @@ -1624,26 +1700,21 @@ retry_hashed: * protocol. */ MPASS(dvp != *vpp); - if (doing_smr) { - if (!cache_ncp_canuse(ncp)) { - vfs_smr_exit(); - *vpp = NULL; - goto retry; - } - vs = vget_prep_smr(*vpp); + if (!cache_ncp_canuse(ncp)) { vfs_smr_exit(); - if (__predict_false(vs == VGET_NONE)) { - *vpp = NULL; - goto retry; - } - } else { - vs = vget_prep(*vpp); - cache_lookup_unlock(blp); + *vpp = NULL; + goto out_fallback; } + vs = vget_prep_smr(*vpp); + vfs_smr_exit(); + if (__predict_false(vs == VGET_NONE)) { + *vpp = NULL; + goto out_fallback; + } error = vget_finish(*vpp, cnp->cn_lkflags, vs); if (error) { *vpp = NULL; - goto retry; + goto out_fallback; } if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { @@ -1652,44 +1723,25 @@ retry_hashed: return (-1); negative_success: - /* We found a negative match, and want to create it, so purge */ - if (__predict_false(cnp->cn_nameiop == CREATE)) { - MPASS(!doing_smr); - counter_u64_add(numnegzaps, 1); - error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); - if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail2++; - cache_maybe_yield(); - goto retry; - } - cache_free(ncp); - return (0); - } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); cache_out_ts(ncp, tsp, ticksp); counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - - if (doing_smr) { - /* - * We need to take locks to promote an entry. - */ - negstate = NCP2NEGSTATE(ncp); - if ((negstate->neg_flag & NEG_HOT) == 0 || - !cache_ncp_canuse(ncp)) { - vfs_smr_exit(); - doing_smr = false; - goto retry_hashed; - } + /* + * We need to take locks to promote an entry. + */ + negstate = NCP2NEGSTATE(ncp); + if ((negstate->neg_flag & NEG_HOT) == 0 || + !cache_ncp_canuse(ncp)) { vfs_smr_exit(); - } else { - cache_negative_hit(ncp); - cache_lookup_unlock(blp); + goto out_fallback; } + vfs_smr_exit(); if (whiteout) cnp->cn_flags |= ISWHITEOUT; return (ENOENT); +out_fallback: + return (cache_lookup_fallback(dvp, vpp, cnp, tsp, ticksp)); } struct celockstate { From owner-svn-src-head@freebsd.org Wed Aug 26 12:50:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76F2D3D4373; Wed, 26 Aug 2020 12:50:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5M62dSBz3yKP; Wed, 26 Aug 2020 12:50:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 264E813078; Wed, 26 Aug 2020 12:50:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCowgm024941; Wed, 26 Aug 2020 12:50:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCow1S024940; Wed, 26 Aug 2020 12:50:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261250.07QCow1S024940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364812 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:50:58 -0000 Author: mjg Date: Wed Aug 26 12:50:57 2020 New Revision: 364812 URL: https://svnweb.freebsd.org/changeset/base/364812 Log: cache: only evict negative entries on CREATE when ISLASTCN is set Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:50:10 2020 (r364811) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:50:57 2020 (r364812) @@ -1398,15 +1398,17 @@ retry: return (-1); negative_success: if (__predict_false(cnp->cn_nameiop == CREATE)) { - counter_u64_add(numnegzaps, 1); - error = cache_zap_locked_vnode(ncp, dvp); - if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail2++; - cache_maybe_yield(); - goto retry; + if (cnp->cn_flags & ISLASTCN) { + counter_u64_add(numnegzaps, 1); + error = cache_zap_locked_vnode(ncp, dvp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); } - cache_free(ncp); - return (0); } SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); @@ -1603,15 +1605,17 @@ retry: negative_success: /* We found a negative match, and want to create it, so purge */ if (__predict_false(cnp->cn_nameiop == CREATE)) { - counter_u64_add(numnegzaps, 1); - error = cache_zap_rlocked_bucket(ncp, cnp, hash, blp); - if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail2++; - cache_maybe_yield(); - goto retry; + if (cnp->cn_flags & ISLASTCN) { + counter_u64_add(numnegzaps, 1); + error = cache_zap_locked_vnode(ncp, dvp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail2++; + cache_maybe_yield(); + goto retry; + } + cache_free(ncp); + return (0); } - cache_free(ncp); - return (0); } SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); @@ -1658,13 +1662,6 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st return (0); } - /* - * TODO: we only fallback becasue if a negative entry is found it will - * need to be purged. - */ - if (cnp->cn_nameiop == CREATE) - goto out_fallback; - hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); vfs_smr_enter(); @@ -1723,6 +1720,13 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st return (-1); negative_success: + if (__predict_false(cnp->cn_nameiop == CREATE)) { + if (cnp->cn_flags & ISLASTCN) { + vfs_smr_exit(); + goto out_fallback; + } + } + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); cache_out_ts(ncp, tsp, ticksp); counter_u64_add(numneghits, 1); From owner-svn-src-head@freebsd.org Wed Aug 26 12:52:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E89B3D44D7; Wed, 26 Aug 2020 12:52:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5Nf0MK4z3xw7; Wed, 26 Aug 2020 12:52:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3B9E13621; Wed, 26 Aug 2020 12:52:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCqHWO027724; Wed, 26 Aug 2020 12:52:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCqHsP027722; Wed, 26 Aug 2020 12:52:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261252.07QCqHsP027722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364813 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:52:18 -0000 Author: mjg Date: Wed Aug 26 12:52:17 2020 New Revision: 364813 URL: https://svnweb.freebsd.org/changeset/base/364813 Log: cache: convert bucketlocks to a mutex By now bucket locks are almost never taken for anything but writing and converting to mutex simplifies the code. Modified: head/sys/kern/subr_witness.c head/sys/kern/vfs_cache.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Aug 26 12:50:57 2020 (r364812) +++ head/sys/kern/subr_witness.c Wed Aug 26 12:52:17 2020 (r364813) @@ -638,7 +638,7 @@ static struct witness_order_list_entry order_lists[] = * VFS namecache */ { "ncvn", &lock_class_mtx_sleep }, - { "ncbuc", &lock_class_rw }, + { "ncbuc", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { "ncneg", &lock_class_mtx_sleep }, { NULL, NULL }, Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:50:57 2020 (r364812) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:52:17 2020 (r364813) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -247,7 +246,7 @@ cache_ncp_canuse(struct namecache *ncp) * These locks are used (in the order in which they can be taken): * NAME TYPE ROLE * vnodelock mtx vnode lists and v_cache_dd field protection - * bucketlock rwlock for access to given set of hash buckets + * bucketlock mtx for access to given set of hash buckets * neglist mtx negative entry LRU management * * Additionally, ncneg_shrink_lock mtx is used to have at most one thread @@ -263,7 +262,8 @@ cache_ncp_canuse(struct namecache *ncp) * name -> vnode lookup requires the relevant bucketlock to be held for reading. * * Insertions and removals of entries require involved vnodes and bucketlocks - * to be write-locked to prevent other threads from seeing the entry. + * to be locked to provide safe operation against other threads modifying the + * cache. * * Some lookups result in removal of the found entry (e.g. getting rid of a * negative entry with the intent to create a positive one), which poses a @@ -336,9 +336,9 @@ NCP2NEGSTATE(struct namecache *ncp) #define numbucketlocks (ncbuckethash + 1) static u_int __read_mostly ncbuckethash; -static struct rwlock_padalign __read_mostly *bucketlocks; +static struct mtx_padalign __read_mostly *bucketlocks; #define HASH2BUCKETLOCK(hash) \ - ((struct rwlock *)(&bucketlocks[((hash) & ncbuckethash)])) + ((struct mtx *)(&bucketlocks[((hash) & ncbuckethash)])) #define numvnodelocks (ncvnodehash + 1) static u_int __read_mostly ncvnodehash; @@ -552,7 +552,7 @@ NCP2BUCKET(struct namecache *ncp) return (NCHHASH(hash)); } -static inline struct rwlock * +static inline struct mtx * NCP2BUCKETLOCK(struct namecache *ncp) { uint32_t hash; @@ -563,15 +563,25 @@ NCP2BUCKETLOCK(struct namecache *ncp) #ifdef INVARIANTS static void -cache_assert_bucket_locked(struct namecache *ncp, int mode) +cache_assert_bucket_locked(struct namecache *ncp) { - struct rwlock *blp; + struct mtx *blp; blp = NCP2BUCKETLOCK(ncp); - rw_assert(blp, mode); + mtx_assert(blp, MA_OWNED); } + +static void +cache_assert_bucket_unlocked(struct namecache *ncp) +{ + struct mtx *blp; + + blp = NCP2BUCKETLOCK(ncp); + mtx_assert(blp, MA_NOTOWNED); +} #else -#define cache_assert_bucket_locked(x, y) do { } while (0) +#define cache_assert_bucket_locked(x) do { } while (0) +#define cache_assert_bucket_unlocked(x) do { } while (0) #endif #define cache_sort_vnodes(x, y) _cache_sort_vnodes((void **)(x), (void **)(y)) @@ -595,7 +605,7 @@ cache_lock_all_buckets(void) u_int i; for (i = 0; i < numbucketlocks; i++) - rw_wlock(&bucketlocks[i]); + mtx_lock(&bucketlocks[i]); } static void @@ -604,7 +614,7 @@ cache_unlock_all_buckets(void) u_int i; for (i = 0; i < numbucketlocks; i++) - rw_wunlock(&bucketlocks[i]); + mtx_unlock(&bucketlocks[i]); } static void @@ -829,7 +839,7 @@ cache_negative_insert(struct namecache *ncp) struct neglist *neglist; MPASS(ncp->nc_flag & NCF_NEGATIVE); - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); neglist = NCP2NEGLIST(ncp); mtx_lock(&neglist->nl_lock); TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); @@ -845,7 +855,7 @@ cache_negative_remove(struct namecache *ncp) bool hot_locked = false; bool list_locked = false; - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); neglist = NCP2NEGLIST(ncp); negstate = NCP2NEGSTATE(ncp); if ((negstate->neg_flag & NEG_HOT) != 0) { @@ -917,7 +927,7 @@ cache_negative_zap_one(void) struct neglist *neglist; struct negstate *negstate; struct mtx *dvlp; - struct rwlock *blp; + struct mtx *blp; if (mtx_owner(&ncneg_shrink_lock) != NULL || !mtx_trylock(&ncneg_shrink_lock)) { @@ -951,7 +961,7 @@ cache_negative_zap_one(void) blp = NCP2BUCKETLOCK(ncp); mtx_unlock(&neglist->nl_lock); mtx_lock(dvlp); - rw_wlock(blp); + mtx_lock(blp); /* * Enter SMR to safely check the negative list. * Even if the found pointer matches, the entry may now be reallocated @@ -970,7 +980,7 @@ cache_negative_zap_one(void) cache_zap_locked(ncp); counter_u64_add(numneg_evicted, 1); } - rw_wunlock(blp); + mtx_unlock(blp); mtx_unlock(dvlp); cache_free(ncp); } @@ -989,7 +999,7 @@ cache_zap_locked(struct namecache *ncp) if (!(ncp->nc_flag & NCF_NEGATIVE)) cache_assert_vnode_locked(ncp->nc_vp); cache_assert_vnode_locked(ncp->nc_dvp); - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); @@ -1031,16 +1041,16 @@ cache_zap_locked(struct namecache *ncp) static void cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp) { - struct rwlock *blp; + struct mtx *blp; MPASS(ncp->nc_dvp == vp); MPASS(ncp->nc_flag & NCF_NEGATIVE); cache_assert_vnode_locked(vp); blp = NCP2BUCKETLOCK(ncp); - rw_wlock(blp); + mtx_lock(blp); cache_zap_locked(ncp); - rw_wunlock(blp); + mtx_unlock(blp); } static bool @@ -1048,7 +1058,7 @@ cache_zap_locked_vnode_kl2(struct namecache *ncp, stru struct mtx **vlpp) { struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; - struct rwlock *blp; + struct mtx *blp; MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); cache_assert_vnode_locked(vp); @@ -1085,9 +1095,9 @@ cache_zap_locked_vnode_kl2(struct namecache *ncp, stru to_unlock = vlp1; } } - rw_wlock(blp); + mtx_lock(blp); cache_zap_locked(ncp); - rw_wunlock(blp); + mtx_unlock(blp); if (to_unlock != NULL) mtx_unlock(to_unlock); return (true); @@ -1105,7 +1115,7 @@ static int __noinline cache_zap_locked_vnode(struct namecache *ncp, struct vnode *vp) { struct mtx *pvlp, *vlp1, *vlp2, *to_unlock; - struct rwlock *blp; + struct mtx *blp; int error = 0; MPASS(vp == ncp->nc_dvp || vp == ncp->nc_vp); @@ -1131,9 +1141,9 @@ cache_zap_locked_vnode(struct namecache *ncp, struct v } to_unlock = vlp1; } - rw_wlock(blp); + mtx_lock(blp); cache_zap_locked(ncp); - rw_wunlock(blp); + mtx_unlock(blp); mtx_unlock(to_unlock); out: mtx_unlock(pvlp); @@ -1147,15 +1157,15 @@ out: static int cache_zap_unlocked_bucket(struct namecache *ncp, struct componentname *cnp, struct vnode *dvp, struct mtx *dvlp, struct mtx *vlp, uint32_t hash, - struct rwlock *blp) + struct mtx *blp) { struct namecache *rncp; - cache_assert_bucket_locked(ncp, RA_UNLOCKED); + cache_assert_bucket_unlocked(ncp); cache_sort_vnodes(&dvlp, &vlp); cache_lock_vnodes(dvlp, vlp); - rw_wlock(blp); + mtx_lock(blp); CK_SLIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { if (rncp == ncp && rncp->nc_dvp == dvp && rncp->nc_nlen == cnp->cn_namelen && @@ -1164,25 +1174,25 @@ cache_zap_unlocked_bucket(struct namecache *ncp, struc } if (rncp != NULL) { cache_zap_locked(rncp); - rw_wunlock(blp); + mtx_unlock(blp); cache_unlock_vnodes(dvlp, vlp); counter_u64_add(zap_and_exit_bucket_relock_success, 1); return (0); } - rw_wunlock(blp); + mtx_unlock(blp); cache_unlock_vnodes(dvlp, vlp); return (EAGAIN); } static int __noinline -cache_zap_wlocked_bucket(struct namecache *ncp, struct componentname *cnp, - uint32_t hash, struct rwlock *blp) +cache_zap_locked_bucket(struct namecache *ncp, struct componentname *cnp, + uint32_t hash, struct mtx *blp) { struct mtx *dvlp, *vlp; struct vnode *dvp; - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); dvlp = VP2VNODELOCK(ncp->nc_dvp); vlp = NULL; @@ -1190,50 +1200,23 @@ cache_zap_wlocked_bucket(struct namecache *ncp, struct vlp = VP2VNODELOCK(ncp->nc_vp); if (cache_trylock_vnodes(dvlp, vlp) == 0) { cache_zap_locked(ncp); - rw_wunlock(blp); + mtx_unlock(blp); cache_unlock_vnodes(dvlp, vlp); return (0); } dvp = ncp->nc_dvp; - rw_wunlock(blp); + mtx_unlock(blp); return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); } -static int __noinline -cache_zap_rlocked_bucket(struct namecache *ncp, struct componentname *cnp, - uint32_t hash, struct rwlock *blp) -{ - struct mtx *dvlp, *vlp; - struct vnode *dvp; - - cache_assert_bucket_locked(ncp, RA_RLOCKED); - - dvlp = VP2VNODELOCK(ncp->nc_dvp); - vlp = NULL; - if (!(ncp->nc_flag & NCF_NEGATIVE)) - vlp = VP2VNODELOCK(ncp->nc_vp); - if (cache_trylock_vnodes(dvlp, vlp) == 0) { - rw_runlock(blp); - rw_wlock(blp); - cache_zap_locked(ncp); - rw_wunlock(blp); - cache_unlock_vnodes(dvlp, vlp); - return (0); - } - - dvp = ncp->nc_dvp; - rw_runlock(blp); - return (cache_zap_unlocked_bucket(ncp, cnp, dvp, dvlp, vlp, hash, blp)); -} - static int -cache_zap_wlocked_bucket_kl(struct namecache *ncp, struct rwlock *blp, +cache_zap_locked_bucket_kl(struct namecache *ncp, struct mtx *blp, struct mtx **vlpp1, struct mtx **vlpp2) { struct mtx *dvlp, *vlp; - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); dvlp = VP2VNODELOCK(ncp->nc_dvp); vlp = NULL; @@ -1262,23 +1245,16 @@ cache_zap_wlocked_bucket_kl(struct namecache *ncp, str return (0); } - rw_wunlock(blp); + mtx_unlock(blp); *vlpp1 = dvlp; *vlpp2 = vlp; if (*vlpp1 != NULL) mtx_lock(*vlpp1); mtx_lock(*vlpp2); - rw_wlock(blp); + mtx_lock(blp); return (EAGAIN); } -static void -cache_lookup_unlock(struct rwlock *blp) -{ - - rw_runlock(blp); -} - static int __noinline cache_lookup_dot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) @@ -1426,7 +1402,7 @@ static __noinline int cache_remove_cnp(struct vnode *dvp, struct componentname *cnp) { struct namecache *ncp; - struct rwlock *blp; + struct mtx *blp; struct mtx *dvlp, *dvlp2; uint32_t hash; int error; @@ -1474,7 +1450,7 @@ retry: if (CK_SLIST_EMPTY(NCHHASH(hash))) goto out_no_entry; - rw_wlock(blp); + mtx_lock(blp); CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && @@ -1484,11 +1460,11 @@ retry: /* We failed to find an entry */ if (ncp == NULL) { - rw_wunlock(blp); + mtx_unlock(blp); goto out_no_entry; } - error = cache_zap_wlocked_bucket(ncp, cnp, hash, blp); + error = cache_zap_locked_bucket(ncp, cnp, hash, blp); if (__predict_false(error != 0)) { zap_and_exit_bucket_fail++; cache_maybe_yield(); @@ -1545,7 +1521,7 @@ cache_lookup_fallback(struct vnode *dvp, struct vnode struct timespec *tsp, int *ticksp) { struct namecache *ncp; - struct rwlock *blp; + struct mtx *blp; uint32_t hash; enum vgetstate vs; int error; @@ -1556,7 +1532,7 @@ cache_lookup_fallback(struct vnode *dvp, struct vnode retry: hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); blp = HASH2BUCKETLOCK(hash); - rw_rlock(blp); + mtx_lock(blp); CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && @@ -1566,7 +1542,7 @@ retry: /* We failed to find an entry */ if (__predict_false(ncp == NULL)) { - rw_runlock(blp); + mtx_unlock(blp); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); counter_u64_add(nummiss, 1); @@ -1590,7 +1566,7 @@ retry: */ MPASS(dvp != *vpp); vs = vget_prep(*vpp); - cache_lookup_unlock(blp); + mtx_unlock(blp); error = vget_finish(*vpp, cnp->cn_lkflags, vs); if (error) { *vpp = NULL; @@ -1623,7 +1599,7 @@ negative_success: counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); cache_negative_hit(ncp); - cache_lookup_unlock(blp); + mtx_unlock(blp); if (whiteout) cnp->cn_flags |= ISWHITEOUT; return (ENOENT); @@ -1750,7 +1726,7 @@ out_fallback: struct celockstate { struct mtx *vlp[3]; - struct rwlock *blp[2]; + struct mtx *blp[2]; }; CTASSERT((nitems(((struct celockstate *)0)->vlp) == 3)); CTASSERT((nitems(((struct celockstate *)0)->blp) == 2)); @@ -1839,8 +1815,8 @@ out: } static void -cache_lock_buckets_cel(struct celockstate *cel, struct rwlock *blp1, - struct rwlock *blp2) +cache_lock_buckets_cel(struct celockstate *cel, struct mtx *blp1, + struct mtx *blp2) { MPASS(cel->blp[0] == NULL); @@ -1849,10 +1825,10 @@ cache_lock_buckets_cel(struct celockstate *cel, struct cache_sort_vnodes(&blp1, &blp2); if (blp1 != NULL) { - rw_wlock(blp1); + mtx_lock(blp1); cel->blp[0] = blp1; } - rw_wlock(blp2); + mtx_lock(blp2); cel->blp[1] = blp2; } @@ -1861,8 +1837,8 @@ cache_unlock_buckets_cel(struct celockstate *cel) { if (cel->blp[0] != NULL) - rw_wunlock(cel->blp[0]); - rw_wunlock(cel->blp[1]); + mtx_unlock(cel->blp[0]); + mtx_unlock(cel->blp[1]); } /* @@ -1881,7 +1857,7 @@ cache_enter_lock(struct celockstate *cel, struct vnode uint32_t hash) { struct namecache *ncp; - struct rwlock *blps[2]; + struct mtx *blps[2]; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -1922,7 +1898,7 @@ cache_enter_lock_dd(struct celockstate *cel, struct vn uint32_t hash) { struct namecache *ncp; - struct rwlock *blps[2]; + struct mtx *blps[2]; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -2256,7 +2232,7 @@ nchinit(void *dummy __unused) bucketlocks = malloc(sizeof(*bucketlocks) * numbucketlocks, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numbucketlocks; i++) - rw_init_flags(&bucketlocks[i], "ncbuc", RW_DUPOK | RW_RECURSE); + mtx_init(&bucketlocks[i], "ncbuc", NULL, MTX_DUPOK | MTX_RECURSE); ncvnodehash = ncbuckethash; vnodelocks = malloc(sizeof(*vnodelocks) * numvnodelocks, M_VFSCACHE, M_WAITOK | M_ZERO); @@ -2482,7 +2458,7 @@ cache_purgevfs(struct mount *mp, bool force) { TAILQ_HEAD(, namecache) ncps; struct mtx *vlp1, *vlp2; - struct rwlock *blp; + struct mtx *blp; struct nchashhead *bucket; struct namecache *ncp, *nnp; u_long i, j, n_nchash; @@ -2496,23 +2472,23 @@ cache_purgevfs(struct mount *mp, bool force) n_nchash = nchash + 1; vlp1 = vlp2 = NULL; for (i = 0; i < numbucketlocks; i++) { - blp = (struct rwlock *)&bucketlocks[i]; - rw_wlock(blp); + blp = (struct mtx *)&bucketlocks[i]; + mtx_lock(blp); for (j = i; j < n_nchash; j += numbucketlocks) { retry: bucket = &nchashtbl[j]; CK_SLIST_FOREACH_SAFE(ncp, bucket, nc_hash, nnp) { - cache_assert_bucket_locked(ncp, RA_WLOCKED); + cache_assert_bucket_locked(ncp); if (ncp->nc_dvp->v_mount != mp) continue; - error = cache_zap_wlocked_bucket_kl(ncp, blp, + error = cache_zap_locked_bucket_kl(ncp, blp, &vlp1, &vlp2); if (error != 0) goto retry; TAILQ_INSERT_HEAD(&ncps, ncp, nc_dst); } } - rw_wunlock(blp); + mtx_unlock(blp); if (vlp1 == NULL && vlp2 == NULL) cache_maybe_yield(); } From owner-svn-src-head@freebsd.org Wed Aug 26 12:52:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2172E3D4884; Wed, 26 Aug 2020 12:52:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5PM05gTz3yDL; Wed, 26 Aug 2020 12:52:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC20713711; Wed, 26 Aug 2020 12:52:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCqsj8027792; Wed, 26 Aug 2020 12:52:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCqsPO027791; Wed, 26 Aug 2020 12:52:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261252.07QCqsPO027791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364814 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:52:55 -0000 Author: mjg Date: Wed Aug 26 12:52:54 2020 New Revision: 364814 URL: https://svnweb.freebsd.org/changeset/base/364814 Log: cache: make it mandatory to request both timestamps or neither Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:52:17 2020 (r364813) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:52:54 2020 (r364814) @@ -415,14 +415,12 @@ cache_out_ts(struct namecache *ncp, struct timespec *t (tsp == NULL && ticksp == NULL), ("No NCF_TS")); - if (tsp == NULL && ticksp == NULL) + if (tsp == NULL) return; ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); - if (tsp != NULL) - *tsp = ncp_ts->nc_time; - if (ticksp != NULL) - *ticksp = ncp_ts->nc_ticks; + *tsp = ncp_ts->nc_time; + *ticksp = ncp_ts->nc_ticks; } #ifdef DEBUG_CACHE @@ -1616,6 +1614,8 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st int error; bool whiteout; u_short nc_flag; + + MPASS((tsp == NULL && ticksp == NULL) || (tsp != NULL && ticksp != NULL)); #ifdef DEBUG_CACHE if (__predict_false(!doingcache)) { From owner-svn-src-head@freebsd.org Wed Aug 26 12:53:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 273C33D45CA; Wed, 26 Aug 2020 12:53:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5Pn0DGhz3yCS; Wed, 26 Aug 2020 12:53:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF35313691; Wed, 26 Aug 2020 12:53:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCrGm2027860; Wed, 26 Aug 2020 12:53:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCrGWr027859; Wed, 26 Aug 2020 12:53:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261253.07QCrGWr027859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364815 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:53:17 -0000 Author: mjg Date: Wed Aug 26 12:53:16 2020 New Revision: 364815 URL: https://svnweb.freebsd.org/changeset/base/364815 Log: cache: stop null checking in cache_free Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:52:54 2020 (r364814) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:53:16 2020 (r364815) @@ -388,8 +388,7 @@ cache_free(struct namecache *ncp) { struct namecache_ts *ncp_ts; - if (ncp == NULL) - return; + MPASS(ncp != NULL); if ((ncp->nc_flag & NCF_DVDROP) != 0) vdrop(ncp->nc_dvp); if (__predict_false(ncp->nc_flag & NCF_TS)) { @@ -980,7 +979,8 @@ cache_negative_zap_one(void) } mtx_unlock(blp); mtx_unlock(dvlp); - cache_free(ncp); + if (ncp != NULL) + cache_free(ncp); } /* @@ -1962,7 +1962,8 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnod dvp->v_cache_dd = NULL; vn_seqc_write_end(dvp); cache_enter_unlock(&cel); - cache_free(ncp); + if (ncp != NULL) + cache_free(ncp); } /* @@ -2158,7 +2159,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, cache_enter_unlock(&cel); if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); - cache_free(ndd); + if (ndd != NULL) + cache_free(ndd); return; out_unlock_free: cache_enter_unlock(&cel); From owner-svn-src-head@freebsd.org Wed Aug 26 12:54:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1D7C3D464A; Wed, 26 Aug 2020 12:54:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5Qy4KHWz3yTF; Wed, 26 Aug 2020 12:54:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78AC7135DD; Wed, 26 Aug 2020 12:54:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QCsIEr027945; Wed, 26 Aug 2020 12:54:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QCsIbx027944; Wed, 26 Aug 2020 12:54:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008261254.07QCsIbx027944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 12:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364816 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 12:54:18 -0000 Author: mjg Date: Wed Aug 26 12:54:18 2020 New Revision: 364816 URL: https://svnweb.freebsd.org/changeset/base/364816 Log: cache: relock on failure in cache_zap_locked_vnode This gets rid of bogus scheme of yielding in hopes the blocking thread will make progress. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 26 12:53:16 2020 (r364815) +++ head/sys/kern/vfs_cache.c Wed Aug 26 12:54:18 2020 (r364816) @@ -1134,8 +1134,15 @@ cache_zap_locked_vnode(struct namecache *ncp, struct v to_unlock = vlp2; } else { if (!mtx_trylock(vlp1)) { - error = EAGAIN; - goto out; + /* + * TODO: Very wasteful but rare. + */ + mtx_unlock(pvlp); + mtx_lock(vlp1); + mtx_lock(vlp2); + mtx_unlock(vlp2); + mtx_unlock(vlp1); + return (EAGAIN); } to_unlock = vlp1; } @@ -1377,7 +1384,6 @@ negative_success: error = cache_zap_locked_vnode(ncp, dvp); if (__predict_false(error != 0)) { zap_and_exit_bucket_fail2++; - cache_maybe_yield(); goto retry; } cache_free(ncp); @@ -1465,7 +1471,6 @@ retry: error = cache_zap_locked_bucket(ncp, cnp, hash, blp); if (__predict_false(error != 0)) { zap_and_exit_bucket_fail++; - cache_maybe_yield(); goto retry; } counter_u64_add(numposzaps, 1); @@ -1584,7 +1589,6 @@ negative_success: error = cache_zap_locked_vnode(ncp, dvp); if (__predict_false(error != 0)) { zap_and_exit_bucket_fail2++; - cache_maybe_yield(); goto retry; } cache_free(ncp); From owner-svn-src-head@freebsd.org Wed Aug 26 13:13:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4901E3D4D21; Wed, 26 Aug 2020 13:13:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc5sg1BDGz40Pm; Wed, 26 Aug 2020 13:13:59 +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 0BDDA13741; Wed, 26 Aug 2020 13:13:59 +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 07QDDwBE040124; Wed, 26 Aug 2020 13:13:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QDDwRm040119; Wed, 26 Aug 2020 13:13:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008261313.07QDDwRm040119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Aug 2020 13:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364817 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 364817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 13:13:59 -0000 Author: cy Date: Wed Aug 26 13:13:57 2020 New Revision: 364817 URL: https://svnweb.freebsd.org/changeset/base/364817 Log: As of r364746 (OpenZFS import) existing ZPOOLs are not imported prior to zvol and mountcritlocal resulting in ZVOLs (swap and virtual machine UFS filesystems) being unavailable, leading to boot failures. We move the zpool import from zfs to a new zpool script, with the -N option to avoid mounting datasets while making the ZPOOL's datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs available for subsequent use for swap (in the zvol rc sript) or for UFS or other filesystems in fstab(5), mounted by mountcritlocal. Reviewed by: freqlabs (previous version) Differential Revision: https://reviews.freebsd.org/D26185 Added: head/libexec/rc/rc.d/zpool (contents, props changed) Modified: head/libexec/rc/rc.d/Makefile head/libexec/rc/rc.d/mountcritlocal head/libexec/rc/rc.d/zfs head/libexec/rc/rc.d/zvol Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Wed Aug 26 12:54:18 2020 (r364816) +++ head/libexec/rc/rc.d/Makefile Wed Aug 26 13:13:57 2020 (r364817) @@ -318,6 +318,7 @@ CONFGROUPS+= ZFS ZFS+= zfs ZFS+= zfsbe ZFS+= zfsd +ZFS+= zpool ZFS+= zvol .endif Modified: head/libexec/rc/rc.d/mountcritlocal ============================================================================== --- head/libexec/rc/rc.d/mountcritlocal Wed Aug 26 12:54:18 2020 (r364816) +++ head/libexec/rc/rc.d/mountcritlocal Wed Aug 26 13:13:57 2020 (r364817) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritlocal -# REQUIRE: root hostid_save mdconfig +# REQUIRE: root hostid_save mdconfig zvol # KEYWORD: nojail shutdown . /etc/rc.subr Modified: head/libexec/rc/rc.d/zfs ============================================================================== --- head/libexec/rc/rc.d/zfs Wed Aug 26 12:54:18 2020 (r364816) +++ head/libexec/rc/rc.d/zfs Wed Aug 26 13:13:57 2020 (r364817) @@ -25,13 +25,6 @@ zfs_start_jail() zfs_start_main() { - local cachefile - - for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do - if [ -r $cachefile ]; then - zpool import -c $cachefile -a - fi - done zfs mount -va zfs share -a if [ ! -r /etc/zfs/exports ]; then Added: head/libexec/rc/rc.d/zpool ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/rc.d/zpool Wed Aug 26 13:13:57 2020 (r364817) @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zpool +# REQUIRE: hostid +# BEFORE: zvol mountcritlocal +# KEYWORD: nojail + +. /etc/rc.subr + +name="zpool" +desc="Import ZPOOLs" +rcvar="zfs_enable" +start_cmd="zpool_start" +required_modules="zfs" + +zpool_start() +{ + local cachefile + + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do + if [ -r $cachefile ]; then + zpool import -c $cachefile -a -N + fi + done +} + +load_rc_config $name +run_rc_command "$1" Modified: head/libexec/rc/rc.d/zvol ============================================================================== --- head/libexec/rc/rc.d/zvol Wed Aug 26 12:54:18 2020 (r364816) +++ head/libexec/rc/rc.d/zvol Wed Aug 26 13:13:57 2020 (r364817) @@ -4,7 +4,7 @@ # # PROVIDE: zvol -# REQUIRE: hostid +# REQUIRE: zpool # BEFORE: dumpon # KEYWORD: nojail From owner-svn-src-head@freebsd.org Wed Aug 26 14:02:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15FF23D5D3C; Wed, 26 Aug 2020 14:02:39 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc6xp6tbnz431T; Wed, 26 Aug 2020 14:02:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFCF814068; Wed, 26 Aug 2020 14:02:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QE2c3l072481; Wed, 26 Aug 2020 14:02:38 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QE2c58072480; Wed, 26 Aug 2020 14:02:38 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008261402.07QE2c58072480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 26 Aug 2020 14:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364818 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 364818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 14:02:39 -0000 Author: tsoome Date: Wed Aug 26 14:02:38 2020 New Revision: 364818 URL: https://svnweb.freebsd.org/changeset/base/364818 Log: efibootmgr: wrong check for opts.order opts.order && !(opts.order) does not really make sense. Reported by: swildner Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Wed Aug 26 13:13:57 2020 (r364817) +++ head/usr.sbin/efibootmgr/efibootmgr.c Wed Aug 26 14:02:38 2020 (r364818) @@ -295,7 +295,7 @@ parse_args(int argc, char *argv[]) return; } - if (opts.order && !(opts.order)) + if (opts.order != NULL && *opts.order == '\0') errx(1, "%s", ORDER_USAGE); if ((opts.set_inactive || opts.set_active) && !opts.has_bootnum) From owner-svn-src-head@freebsd.org Wed Aug 26 14:31:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A0113D63BD; Wed, 26 Aug 2020 14:31:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc7bD3CPZz44Nk; Wed, 26 Aug 2020 14:31:36 +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 514D51492B; Wed, 26 Aug 2020 14:31:36 +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 07QEVaWB090753; Wed, 26 Aug 2020 14:31:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QEVals090752; Wed, 26 Aug 2020 14:31:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008261431.07QEVals090752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Aug 2020 14:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364819 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 14:31:36 -0000 Author: markj Date: Wed Aug 26 14:31:35 2020 New Revision: 364819 URL: https://svnweb.freebsd.org/changeset/base/364819 Log: vmem: Avoid allocating span tags when segments are never released. vmem uses span tags to delimit imported segments, so that they can be released if the segment becomes free in the future. However, the per-domain kernel KVA arenas never release resources, so the span tags between imported ranges are unused when the ranges are contiguous. Furthermore, such span tags prevent coalescing of free segments across KVA_QUANTUM boundaries, resulting in internal fragmentation which inhibits superpage promotion in the kernel map. Stop allocating span tags in arenas that never release resources. This saves a small amount of memory and allows free segements to coalesce across import boundaries. This manifests as improved kernel superpage usage during poudriere runs, which also helps to reduce physical memory fragmentation by reducing the number of broken partially populated reservations. Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24548 Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Aug 26 14:02:38 2020 (r364818) +++ head/sys/kern/subr_vmem.c Wed Aug 26 14:31:35 2020 (r364819) @@ -249,6 +249,18 @@ static struct vmem memguard_arena_storage; vmem_t *memguard_arena = &memguard_arena_storage; #endif +static bool +bt_isbusy(bt_t *bt) +{ + return (bt->bt_type == BT_TYPE_BUSY); +} + +static bool +bt_isfree(bt_t *bt) +{ + return (bt->bt_type == BT_TYPE_FREE); +} + /* * Fill the vmem's boundary tag cache. We guarantee that boundary tag * allocation will not fail once bt_fill() passes. To do so we cache @@ -795,25 +807,49 @@ SYSINIT(vfs, SI_SUB_CONFIGURE, SI_ORDER_ANY, vmem_star static void vmem_add1(vmem_t *vm, vmem_addr_t addr, vmem_size_t size, int type) { - bt_t *btspan; - bt_t *btfree; + bt_t *btfree, *btprev, *btspan; + VMEM_ASSERT_LOCKED(vm); MPASS(type == BT_TYPE_SPAN || type == BT_TYPE_SPAN_STATIC); MPASS((size & vm->vm_quantum_mask) == 0); - btspan = bt_alloc(vm); - btspan->bt_type = type; - btspan->bt_start = addr; - btspan->bt_size = size; - bt_insseg_tail(vm, btspan); + if (vm->vm_releasefn == NULL) { + /* + * The new segment will never be released, so see if it is + * contiguous with respect to an existing segment. In this case + * a span tag is not needed, and it may be possible now or in + * the future to coalesce the new segment with an existing free + * segment. + */ + btprev = TAILQ_LAST(&vm->vm_seglist, vmem_seglist); + if ((!bt_isbusy(btprev) && !bt_isfree(btprev)) || + btprev->bt_start + btprev->bt_size != addr) + btprev = NULL; + } else { + btprev = NULL; + } - btfree = bt_alloc(vm); - btfree->bt_type = BT_TYPE_FREE; - btfree->bt_start = addr; - btfree->bt_size = size; - bt_insseg(vm, btfree, btspan); - bt_insfree(vm, btfree); + if (btprev == NULL || bt_isbusy(btprev)) { + if (btprev == NULL) { + btspan = bt_alloc(vm); + btspan->bt_type = type; + btspan->bt_start = addr; + btspan->bt_size = size; + bt_insseg_tail(vm, btspan); + } + btfree = bt_alloc(vm); + btfree->bt_type = BT_TYPE_FREE; + btfree->bt_start = addr; + btfree->bt_size = size; + bt_insseg_tail(vm, btfree); + bt_insfree(vm, btfree); + } else { + bt_remfree(vm, btprev); + btprev->bt_size += size; + bt_insfree(vm, btprev); + } + vm->vm_size += size; } @@ -1147,6 +1183,7 @@ vmem_set_import(vmem_t *vm, vmem_import_t *importfn, { VMEM_LOCK(vm); + KASSERT(vm->vm_size == 0, ("%s: arena is non-empty", __func__)); vm->vm_importfn = importfn; vm->vm_releasefn = releasefn; vm->vm_arg = arg; From owner-svn-src-head@freebsd.org Wed Aug 26 14:31:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12173D63C0; Wed, 26 Aug 2020 14:31:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc7bS4Kh7z44Wt; Wed, 26 Aug 2020 14:31:48 +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 7346A145C4; Wed, 26 Aug 2020 14:31:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QEVmCh090832; Wed, 26 Aug 2020 14:31:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QEVmrO090831; Wed, 26 Aug 2020 14:31:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008261431.07QEVmrO090831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 26 Aug 2020 14:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364820 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 364820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 14:31:48 -0000 Author: markj Date: Wed Aug 26 14:31:48 2020 New Revision: 364820 URL: https://svnweb.freebsd.org/changeset/base/364820 Log: Use a large kmem arena import size on NUMA systems. This helps minimize internal fragmentation that occurs when 2MB imports are interleaved across NUMA domains. Virtually all KVA allocations on direct map platforms consume more than one page, so the fragmentation manifests as runs of 511 4KB page mappings in the kernel. Reviewed by: alc, kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26050 Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Wed Aug 26 14:31:35 2020 (r364819) +++ head/sys/vm/vm_kern.c Wed Aug 26 14:31:48 2020 (r364820) @@ -128,6 +128,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif #define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) +#define KVA_NUMA_IMPORT_QUANTUM (KVA_QUANTUM * 128) extern void uma_startup2(void); @@ -745,6 +746,7 @@ kva_import_domain(void *arena, vmem_size_t size, int f void kmem_init(vm_offset_t start, vm_offset_t end) { + vm_size_t quantum; int domain; vm_map_init(kernel_map, kernel_pmap, VM_MIN_KERNEL_ADDRESS, end); @@ -774,10 +776,20 @@ kmem_init(vm_offset_t start, vm_offset_t end) vm_map_unlock(kernel_map); /* + * Use a large import quantum on NUMA systems. This helps minimize + * interleaving of superpages, reducing internal fragmentation within + * the per-domain arenas. + */ + if (vm_ndomains > 1 && PMAP_HAS_DMAP) + quantum = KVA_NUMA_IMPORT_QUANTUM; + else + quantum = KVA_QUANTUM; + + /* * Initialize the kernel_arena. This can grow on demand. */ vmem_init(kernel_arena, "kernel arena", 0, 0, PAGE_SIZE, 0, 0); - vmem_set_import(kernel_arena, kva_import, NULL, NULL, KVA_QUANTUM); + vmem_set_import(kernel_arena, kva_import, NULL, NULL, quantum); for (domain = 0; domain < vm_ndomains; domain++) { /* @@ -789,13 +801,15 @@ kmem_init(vm_offset_t start, vm_offset_t end) vm_dom[domain].vmd_kernel_arena = vmem_create( "kernel arena domain", 0, 0, PAGE_SIZE, 0, M_WAITOK); vmem_set_import(vm_dom[domain].vmd_kernel_arena, - kva_import_domain, NULL, kernel_arena, KVA_QUANTUM); + kva_import_domain, NULL, kernel_arena, quantum); /* * In architectures with superpages, maintain separate arenas * for allocations with permissions that differ from the * "standard" read/write permissions used for kernel memory, * so as not to inhibit superpage promotion. + * + * Use the base import quantum since this arena is rarely used. */ #if VM_NRESERVLEVEL > 0 vm_dom[domain].vmd_kernel_rwx_arena = vmem_create( From owner-svn-src-head@freebsd.org Wed Aug 26 15:43:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 623823D7ED6; Wed, 26 Aug 2020 15:43:45 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bc9BT1zk8z49yK; Wed, 26 Aug 2020 15:43:45 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 276A3157E4; Wed, 26 Aug 2020 15:43:45 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QFhjDx045549; Wed, 26 Aug 2020 15:43:45 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QFhjH9045548; Wed, 26 Aug 2020 15:43:45 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008261543.07QFhjH9045548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Wed, 26 Aug 2020 15:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364821 - head/cddl/sbin/zpool X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/cddl/sbin/zpool X-SVN-Commit-Revision: 364821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 15:43:45 -0000 Author: freqlabs Date: Wed Aug 26 15:43:44 2020 New Revision: 364821 URL: https://svnweb.freebsd.org/changeset/base/364821 Log: Install zfs-events.5 Sponsored by: iXsystems, Inc. Modified: head/cddl/sbin/zpool/Makefile Modified: head/cddl/sbin/zpool/Makefile ============================================================================== --- head/cddl/sbin/zpool/Makefile Wed Aug 26 14:31:48 2020 (r364820) +++ head/cddl/sbin/zpool/Makefile Wed Aug 26 15:43:44 2020 (r364821) @@ -12,6 +12,7 @@ PACKAGE= runtime PROG= zpool MAN= \ spl-module-parameters.5 \ + zfs-events.5 \ zfs-module-parameters.5 \ zpool.8 \ zpool-add.8 \ From owner-svn-src-head@freebsd.org Wed Aug 26 16:32:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D96F3B165B; Wed, 26 Aug 2020 16:32:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcBGg2L8Kz4FjH; Wed, 26 Aug 2020 16:32:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 343C6212DD; Wed, 26 Aug 2020 16:32:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f174.google.com with SMTP id c12so1844812qtn.9; Wed, 26 Aug 2020 09:32:27 -0700 (PDT) X-Gm-Message-State: AOAM531VDah+kGMm437OQFEJSLXnbpRYGMo4oLBAhjir9SdgvJjjEQgy X48aKBpQiioeINAdkOeHaShingQICUNQ0RbtCdY= X-Google-Smtp-Source: ABdhPJy56ZAOpVxBYbPq6oDBFpW1gJf2ey6iFUY6krpSJYl8uhIJQ8KQ1cEKGMMm5kw0XX6/CwMRL5UlfBvH+G4JpDM= X-Received: by 2002:ac8:70cd:: with SMTP id g13mr14968212qtp.53.1598459546769; Wed, 26 Aug 2020 09:32:26 -0700 (PDT) MIME-Version: 1.0 References: <202008260043.07Q0h0kH077834@repo.freebsd.org> <20200826115743.GA1791@kloomba> In-Reply-To: <20200826115743.GA1791@kloomba> From: Kyle Evans Date: Wed, 26 Aug 2020 11:32:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364791 - head/usr.sbin/jail To: Roman Bogorodskiy Cc: Jamie Gritton , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 16:32:27 -0000 On Wed, Aug 26, 2020 at 6:58 AM Roman Bogorodskiy wrote: > > Jamie Gritton wrote: > > > Author: jamie > > Date: Wed Aug 26 00:42:59 2020 > > New Revision: 364791 > > URL: https://svnweb.freebsd.org/changeset/base/364791 > > > > Log: > > Handle jail.conf variables that have the same names as parameters. > > > > PR: 248444 > > Submitted by: Akos Somfai > > Reported by: Markus Stoff > > > > Modified: > > head/usr.sbin/jail/config.c > > > > Modified: head/usr.sbin/jail/config.c > > ============================================================================== > > --- head/usr.sbin/jail/config.c Wed Aug 26 00:31:59 2020 (r364790) > > +++ head/usr.sbin/jail/config.c Wed Aug 26 00:42:59 2020 (r364791) > > @@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e > > else > > for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) > > if (!(intparams[ipnum].flags & PF_CONV) && > > - equalopts(name, intparams[ipnum].name)) { > > + equalopts(name, intparams[ipnum].name) && > > + !(p->flags & PF_VAR)) { > > j->intparams[ipnum] = np; > > np->flags |= intparams[ipnum].flags; > > break; > > Looks like it's causing jail(8) to segfault, at least when using with > poudriere: > It looks like it's also wiped out a good chunk of the test suite, as reported by lwhsu: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16305/testReport/ From owner-svn-src-head@freebsd.org Wed Aug 26 16:34:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89CB13B1755; Wed, 26 Aug 2020 16:34:56 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcBKX2gj0z4FyC; Wed, 26 Aug 2020 16:34:56 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 07QGYtat018444; Wed, 26 Aug 2020 09:34:55 -0700 (PDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 26 Aug 2020 09:34:55 -0700 From: James Gritton To: Kyle Evans Cc: Roman Bogorodskiy , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364791 - head/usr.sbin/jail In-Reply-To: References: <202008260043.07Q0h0kH077834@repo.freebsd.org> <20200826115743.GA1791@kloomba> User-Agent: Roundcube Webmail/1.4.1 Message-ID: <85c530bbdd61107631f305fa06b0dd48@freebsd.org> X-Sender: jamie@freebsd.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Wed, 26 Aug 2020 10:34:55 -0600 (MDT) X-Rspamd-Queue-Id: 4BcBKX2gj0z4FyC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:30247, ipnet:199.192.164.0/22, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 16:34:56 -0000 On 2020-08-26 09:32, Kyle Evans wrote: > On Wed, Aug 26, 2020 at 6:58 AM Roman Bogorodskiy > wrote: >> >> Jamie Gritton wrote: >> >> > Author: jamie >> > Date: Wed Aug 26 00:42:59 2020 >> > New Revision: 364791 >> > URL: https://svnweb.freebsd.org/changeset/base/364791 >> > >> > Log: >> > Handle jail.conf variables that have the same names as parameters. >> > >> > PR: 248444 >> > Submitted by: Akos Somfai >> > Reported by: Markus Stoff >> > >> > Modified: >> > head/usr.sbin/jail/config.c >> > >> > Modified: head/usr.sbin/jail/config.c >> > ============================================================================== >> > --- head/usr.sbin/jail/config.c Wed Aug 26 00:31:59 2020 (r364790) >> > +++ head/usr.sbin/jail/config.c Wed Aug 26 00:42:59 2020 (r364791) >> > @@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e >> > else >> > for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) >> > if (!(intparams[ipnum].flags & PF_CONV) && >> > - equalopts(name, intparams[ipnum].name)) { >> > + equalopts(name, intparams[ipnum].name) && >> > + !(p->flags & PF_VAR)) { >> > j->intparams[ipnum] = np; >> > np->flags |= intparams[ipnum].flags; >> > break; >> >> Looks like it's causing jail(8) to segfault, at least when using with >> poudriere: >> > > It looks like it's also wiped out a good chunk of the test suite, as > reported by lwhsu: > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16305/testReport/ Ooh - I killed things nicely, didn't I? I'll get on that. - Jamie From owner-svn-src-head@freebsd.org Wed Aug 26 16:55:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9898F3B2A55; Wed, 26 Aug 2020 16:55:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcBnK3xBZz4JD0; Wed, 26 Aug 2020 16:55:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51FDA161B4; Wed, 26 Aug 2020 16:55:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QGtXq6097015; Wed, 26 Aug 2020 16:55:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QGtSZx096979; Wed, 26 Aug 2020 16:55:28 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202008261655.07QGtSZx096979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 26 Aug 2020 16:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm X-SVN-Commit-Revision: 364822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 16:55:33 -0000 Author: jkim Date: Wed Aug 26 16:55:28 2020 New Revision: 364822 URL: https://svnweb.freebsd.org/changeset/base/364822 Log: Fix Clang version detection. We prepend "FreeBSD" to Clang version string. This broke compiler test for AVX instruction support. Reported by: jhb Modified: head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha1-586.pl head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha256-586.pl head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl Modified: head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -70,7 +70,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -108,7 +108,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); -$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); $shaext=1; ### set to zero if compiling for 1.0.1 Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -70,7 +70,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=12); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $addx = ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); Modified: head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -81,7 +81,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -75,7 +75,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -60,7 +60,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl ============================================================================== --- head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -62,7 +62,7 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" && $1>=10); # first version supporting AVX $ymm=1 if ($xmm && !$ymm && - `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ && + `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); # first version supporting AVX $a="eax"; Modified: head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -85,7 +85,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl ============================================================================== --- head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -47,7 +47,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); Modified: head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -72,7 +72,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); Modified: head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -90,7 +90,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } Modified: head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -116,7 +116,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl ============================================================================== --- head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -71,7 +71,7 @@ if ($sse2) { $avx = ($1>=2.09) + ($1>=2.10); } - if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) { + if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } } Modified: head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -90,7 +90,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=12); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/sha/asm/sha1-586.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha1-586.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha1-586.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -144,7 +144,7 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" && `ml 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); # first version supporting AVX -$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ && +$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); # first version supporting AVX $shaext=$xmm; ### set to zero if compiling for 1.0.1 Modified: head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -119,7 +119,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/sha/asm/sha256-586.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha256-586.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha256-586.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -96,7 +96,7 @@ if ($xmm && !$avx && $ARGV[0] eq "win32" && $avx = ($1>=10) + ($1>=11); } -if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) { +if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -67,7 +67,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } Modified: head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl Wed Aug 26 15:43:44 2020 (r364821) +++ head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl Wed Aug 26 16:55:28 2020 (r364822) @@ -135,7 +135,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } From owner-svn-src-head@freebsd.org Wed Aug 26 16:56:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACE163B2E36; Wed, 26 Aug 2020 16:56:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcBpj4YFHz4HxV; Wed, 26 Aug 2020 16:56:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 676A516160; Wed, 26 Aug 2020 16:56:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QGujdU097252; Wed, 26 Aug 2020 16:56:45 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QGujQS097248; Wed, 26 Aug 2020 16:56:45 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202008261656.07QGujQS097248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 26 Aug 2020 16:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364823 - in head/secure/lib/libcrypto: amd64 i386 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/secure/lib/libcrypto: amd64 i386 X-SVN-Commit-Revision: 364823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 16:56:45 -0000 Author: jkim Date: Wed Aug 26 16:56:44 2020 New Revision: 364823 URL: https://svnweb.freebsd.org/changeset/base/364823 Log: Regen X86 assembly files after r364822. Modified: head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S head/secure/lib/libcrypto/amd64/chacha-x86_64.S head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/poly1305-x86_64.S head/secure/lib/libcrypto/amd64/rsaz-avx2.S head/secure/lib/libcrypto/amd64/rsaz-x86_64.S head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha1-x86_64.S head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha256-x86_64.S head/secure/lib/libcrypto/amd64/sha512-x86_64.S head/secure/lib/libcrypto/amd64/x25519-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/i386/chacha-x86.S head/secure/lib/libcrypto/i386/poly1305-x86.S head/secure/lib/libcrypto/i386/sha1-586.S head/secure/lib/libcrypto/i386/sha256-586.S Modified: head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed Aug 26 16:55:28 2020 (r364822) +++ head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed Aug 26 16:56:44 2020 (r364823) @@ -2,20 +2,790 @@ /* Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. */ .text -.globl aesni_gcm_encrypt -.type aesni_gcm_encrypt,@function -aesni_gcm_encrypt: +.type _aesni_ctr32_ghash_6x,@function +.align 32 +_aesni_ctr32_ghash_6x: .cfi_startproc - xorl %eax,%eax + vmovdqu 32(%r11),%xmm2 + subq $6,%rdx + vpxor %xmm4,%xmm4,%xmm4 + vmovdqu 0-128(%rcx),%xmm15 + vpaddb %xmm2,%xmm1,%xmm10 + vpaddb %xmm2,%xmm10,%xmm11 + vpaddb %xmm2,%xmm11,%xmm12 + vpaddb %xmm2,%xmm12,%xmm13 + vpaddb %xmm2,%xmm13,%xmm14 + vpxor %xmm15,%xmm1,%xmm9 + vmovdqu %xmm4,16+8(%rsp) + jmp .Loop6x + +.align 32 +.Loop6x: + addl $100663296,%ebx + jc .Lhandle_ctr32 + vmovdqu 0-32(%r9),%xmm3 + vpaddb %xmm2,%xmm14,%xmm1 + vpxor %xmm15,%xmm10,%xmm10 + vpxor %xmm15,%xmm11,%xmm11 + +.Lresume_ctr32: + vmovdqu %xmm1,(%r8) + vpclmulqdq $0x10,%xmm3,%xmm7,%xmm5 + vpxor %xmm15,%xmm12,%xmm12 + vmovups 16-128(%rcx),%xmm2 + vpclmulqdq $0x01,%xmm3,%xmm7,%xmm6 + xorq %r12,%r12 + cmpq %r14,%r15 + + vaesenc %xmm2,%xmm9,%xmm9 + vmovdqu 48+8(%rsp),%xmm0 + vpxor %xmm15,%xmm13,%xmm13 + vpclmulqdq $0x00,%xmm3,%xmm7,%xmm1 + vaesenc %xmm2,%xmm10,%xmm10 + vpxor %xmm15,%xmm14,%xmm14 + setnc %r12b + vpclmulqdq $0x11,%xmm3,%xmm7,%xmm7 + vaesenc %xmm2,%xmm11,%xmm11 + vmovdqu 16-32(%r9),%xmm3 + negq %r12 + vaesenc %xmm2,%xmm12,%xmm12 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm3,%xmm0,%xmm5 + vpxor %xmm4,%xmm8,%xmm8 + vaesenc %xmm2,%xmm13,%xmm13 + vpxor %xmm5,%xmm1,%xmm4 + andq $0x60,%r12 + vmovups 32-128(%rcx),%xmm15 + vpclmulqdq $0x10,%xmm3,%xmm0,%xmm1 + vaesenc %xmm2,%xmm14,%xmm14 + + vpclmulqdq $0x01,%xmm3,%xmm0,%xmm2 + leaq (%r14,%r12,1),%r14 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor 16+8(%rsp),%xmm8,%xmm8 + vpclmulqdq $0x11,%xmm3,%xmm0,%xmm3 + vmovdqu 64+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 88(%r14),%r13 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 80(%r14),%r12 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,32+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,40+8(%rsp) + vmovdqu 48-32(%r9),%xmm5 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 48-128(%rcx),%xmm15 + vpxor %xmm1,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm5,%xmm0,%xmm1 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm2,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm5,%xmm0,%xmm2 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor %xmm3,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm5,%xmm0,%xmm3 + vaesenc %xmm15,%xmm11,%xmm11 + vpclmulqdq $0x11,%xmm5,%xmm0,%xmm5 + vmovdqu 80+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor %xmm1,%xmm4,%xmm4 + vmovdqu 64-32(%r9),%xmm1 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 64-128(%rcx),%xmm15 + vpxor %xmm2,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm1,%xmm0,%xmm2 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm3,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm1,%xmm0,%xmm3 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 72(%r14),%r13 + vpxor %xmm5,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm1,%xmm0,%xmm5 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 64(%r14),%r12 + vpclmulqdq $0x11,%xmm1,%xmm0,%xmm1 + vmovdqu 96+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,48+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,56+8(%rsp) + vpxor %xmm2,%xmm4,%xmm4 + vmovdqu 96-32(%r9),%xmm2 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 80-128(%rcx),%xmm15 + vpxor %xmm3,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm2,%xmm0,%xmm3 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm2,%xmm0,%xmm5 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 56(%r14),%r13 + vpxor %xmm1,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm2,%xmm0,%xmm1 + vpxor 112+8(%rsp),%xmm8,%xmm8 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 48(%r14),%r12 + vpclmulqdq $0x11,%xmm2,%xmm0,%xmm2 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,64+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,72+8(%rsp) + vpxor %xmm3,%xmm4,%xmm4 + vmovdqu 112-32(%r9),%xmm3 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 96-128(%rcx),%xmm15 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm5 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm1,%xmm6,%xmm6 + vpclmulqdq $0x01,%xmm3,%xmm8,%xmm1 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 40(%r14),%r13 + vpxor %xmm2,%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm3,%xmm8,%xmm2 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 32(%r14),%r12 + vpclmulqdq $0x11,%xmm3,%xmm8,%xmm8 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,80+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,88+8(%rsp) + vpxor %xmm5,%xmm6,%xmm6 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor %xmm1,%xmm6,%xmm6 + + vmovups 112-128(%rcx),%xmm15 + vpslldq $8,%xmm6,%xmm5 + vpxor %xmm2,%xmm4,%xmm4 + vmovdqu 16(%r11),%xmm3 + + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm8,%xmm7,%xmm7 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor %xmm5,%xmm4,%xmm4 + movbeq 24(%r14),%r13 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 16(%r14),%r12 + vpalignr $8,%xmm4,%xmm4,%xmm0 + vpclmulqdq $0x10,%xmm3,%xmm4,%xmm4 + movq %r13,96+8(%rsp) + vaesenc %xmm15,%xmm12,%xmm12 + movq %r12,104+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + vmovups 128-128(%rcx),%xmm1 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vmovups 144-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm10,%xmm10 + vpsrldq $8,%xmm6,%xmm6 + vaesenc %xmm1,%xmm11,%xmm11 + vpxor %xmm6,%xmm7,%xmm7 + vaesenc %xmm1,%xmm12,%xmm12 + vpxor %xmm0,%xmm4,%xmm4 + movbeq 8(%r14),%r13 + vaesenc %xmm1,%xmm13,%xmm13 + movbeq 0(%r14),%r12 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 160-128(%rcx),%xmm1 + cmpl $11,%ebp + jb .Lenc_tail + + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vaesenc %xmm1,%xmm10,%xmm10 + vaesenc %xmm1,%xmm11,%xmm11 + vaesenc %xmm1,%xmm12,%xmm12 + vaesenc %xmm1,%xmm13,%xmm13 + vmovups 176-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 192-128(%rcx),%xmm1 + je .Lenc_tail + + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vaesenc %xmm1,%xmm10,%xmm10 + vaesenc %xmm1,%xmm11,%xmm11 + vaesenc %xmm1,%xmm12,%xmm12 + vaesenc %xmm1,%xmm13,%xmm13 + vmovups 208-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 224-128(%rcx),%xmm1 + jmp .Lenc_tail + +.align 32 +.Lhandle_ctr32: + vmovdqu (%r11),%xmm0 + vpshufb %xmm0,%xmm1,%xmm6 + vmovdqu 48(%r11),%xmm5 + vpaddd 64(%r11),%xmm6,%xmm10 + vpaddd %xmm5,%xmm6,%xmm11 + vmovdqu 0-32(%r9),%xmm3 + vpaddd %xmm5,%xmm10,%xmm12 + vpshufb %xmm0,%xmm10,%xmm10 + vpaddd %xmm5,%xmm11,%xmm13 + vpshufb %xmm0,%xmm11,%xmm11 + vpxor %xmm15,%xmm10,%xmm10 + vpaddd %xmm5,%xmm12,%xmm14 + vpshufb %xmm0,%xmm12,%xmm12 + vpxor %xmm15,%xmm11,%xmm11 + vpaddd %xmm5,%xmm13,%xmm1 + vpshufb %xmm0,%xmm13,%xmm13 + vpshufb %xmm0,%xmm14,%xmm14 + vpshufb %xmm0,%xmm1,%xmm1 + jmp .Lresume_ctr32 + +.align 32 +.Lenc_tail: + vaesenc %xmm15,%xmm9,%xmm9 + vmovdqu %xmm7,16+8(%rsp) + vpalignr $8,%xmm4,%xmm4,%xmm8 + vaesenc %xmm15,%xmm10,%xmm10 + vpclmulqdq $0x10,%xmm3,%xmm4,%xmm4 + vpxor 0(%rdi),%xmm1,%xmm2 + vaesenc %xmm15,%xmm11,%xmm11 + vpxor 16(%rdi),%xmm1,%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + vpxor 32(%rdi),%xmm1,%xmm5 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor 48(%rdi),%xmm1,%xmm6 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor 64(%rdi),%xmm1,%xmm7 + vpxor 80(%rdi),%xmm1,%xmm3 + vmovdqu (%r8),%xmm1 + + vaesenclast %xmm2,%xmm9,%xmm9 + vmovdqu 32(%r11),%xmm2 + vaesenclast %xmm0,%xmm10,%xmm10 + vpaddb %xmm2,%xmm1,%xmm0 + movq %r13,112+8(%rsp) + leaq 96(%rdi),%rdi + vaesenclast %xmm5,%xmm11,%xmm11 + vpaddb %xmm2,%xmm0,%xmm5 + movq %r12,120+8(%rsp) + leaq 96(%rsi),%rsi + vmovdqu 0-128(%rcx),%xmm15 + vaesenclast %xmm6,%xmm12,%xmm12 + vpaddb %xmm2,%xmm5,%xmm6 + vaesenclast %xmm7,%xmm13,%xmm13 + vpaddb %xmm2,%xmm6,%xmm7 + vaesenclast %xmm3,%xmm14,%xmm14 + vpaddb %xmm2,%xmm7,%xmm3 + + addq $0x60,%r10 + subq $0x6,%rdx + jc .L6x_done + + vmovups %xmm9,-96(%rsi) + vpxor %xmm15,%xmm1,%xmm9 + vmovups %xmm10,-80(%rsi) + vmovdqa %xmm0,%xmm10 + vmovups %xmm11,-64(%rsi) + vmovdqa %xmm5,%xmm11 + vmovups %xmm12,-48(%rsi) + vmovdqa %xmm6,%xmm12 + vmovups %xmm13,-32(%rsi) + vmovdqa %xmm7,%xmm13 + vmovups %xmm14,-16(%rsi) + vmovdqa %xmm3,%xmm14 + vmovdqu 32+8(%rsp),%xmm7 + jmp .Loop6x + +.L6x_done: + vpxor 16+8(%rsp),%xmm8,%xmm8 + vpxor %xmm4,%xmm8,%xmm8 + .byte 0xf3,0xc3 .cfi_endproc -.size aesni_gcm_encrypt,.-aesni_gcm_encrypt - +.size _aesni_ctr32_ghash_6x,.-_aesni_ctr32_ghash_6x .globl aesni_gcm_decrypt .type aesni_gcm_decrypt,@function +.align 32 aesni_gcm_decrypt: .cfi_startproc - xorl %eax,%eax + xorq %r10,%r10 + cmpq $0x60,%rdx + jb .Lgcm_dec_abort + + leaq (%rsp),%rax +.cfi_def_cfa_register %rax + pushq %rbx +.cfi_offset %rbx,-16 + pushq %rbp +.cfi_offset %rbp,-24 + pushq %r12 +.cfi_offset %r12,-32 + pushq %r13 +.cfi_offset %r13,-40 + pushq %r14 +.cfi_offset %r14,-48 + pushq %r15 +.cfi_offset %r15,-56 + vzeroupper + + vmovdqu (%r8),%xmm1 + addq $-128,%rsp + movl 12(%r8),%ebx + leaq .Lbswap_mask(%rip),%r11 + leaq -128(%rcx),%r14 + movq $0xf80,%r15 + vmovdqu (%r9),%xmm8 + andq $-128,%rsp + vmovdqu (%r11),%xmm0 + leaq 128(%rcx),%rcx + leaq 32+32(%r9),%r9 + movl 240-128(%rcx),%ebp + vpshufb %xmm0,%xmm8,%xmm8 + + andq %r15,%r14 + andq %rsp,%r15 + subq %r14,%r15 + jc .Ldec_no_key_aliasing + cmpq $768,%r15 + jnc .Ldec_no_key_aliasing + subq %r15,%rsp +.Ldec_no_key_aliasing: + + vmovdqu 80(%rdi),%xmm7 + leaq (%rdi),%r14 + vmovdqu 64(%rdi),%xmm4 + leaq -192(%rdi,%rdx,1),%r15 + vmovdqu 48(%rdi),%xmm5 + shrq $4,%rdx + xorq %r10,%r10 + vmovdqu 32(%rdi),%xmm6 + vpshufb %xmm0,%xmm7,%xmm7 + vmovdqu 16(%rdi),%xmm2 + vpshufb %xmm0,%xmm4,%xmm4 + vmovdqu (%rdi),%xmm3 + vpshufb %xmm0,%xmm5,%xmm5 + vmovdqu %xmm4,48(%rsp) + vpshufb %xmm0,%xmm6,%xmm6 + vmovdqu %xmm5,64(%rsp) + vpshufb %xmm0,%xmm2,%xmm2 + vmovdqu %xmm6,80(%rsp) + vpshufb %xmm0,%xmm3,%xmm3 + vmovdqu %xmm2,96(%rsp) + vmovdqu %xmm3,112(%rsp) + + call _aesni_ctr32_ghash_6x + + vmovups %xmm9,-96(%rsi) + vmovups %xmm10,-80(%rsi) + vmovups %xmm11,-64(%rsi) + vmovups %xmm12,-48(%rsi) + vmovups %xmm13,-32(%rsi) + vmovups %xmm14,-16(%rsi) + + vpshufb (%r11),%xmm8,%xmm8 + vmovdqu %xmm8,-64(%r9) + + vzeroupper + movq -48(%rax),%r15 +.cfi_restore %r15 + movq -40(%rax),%r14 +.cfi_restore %r14 + movq -32(%rax),%r13 +.cfi_restore %r13 + movq -24(%rax),%r12 +.cfi_restore %r12 + movq -16(%rax),%rbp +.cfi_restore %rbp + movq -8(%rax),%rbx +.cfi_restore %rbx + leaq (%rax),%rsp +.cfi_def_cfa_register %rsp +.Lgcm_dec_abort: + movq %r10,%rax .byte 0xf3,0xc3 .cfi_endproc .size aesni_gcm_decrypt,.-aesni_gcm_decrypt +.type _aesni_ctr32_6x,@function +.align 32 +_aesni_ctr32_6x: +.cfi_startproc + vmovdqu 0-128(%rcx),%xmm4 + vmovdqu 32(%r11),%xmm2 + leaq -1(%rbp),%r13 + vmovups 16-128(%rcx),%xmm15 + leaq 32-128(%rcx),%r12 + vpxor %xmm4,%xmm1,%xmm9 + addl $100663296,%ebx + jc .Lhandle_ctr32_2 + vpaddb %xmm2,%xmm1,%xmm10 + vpaddb %xmm2,%xmm10,%xmm11 + vpxor %xmm4,%xmm10,%xmm10 + vpaddb %xmm2,%xmm11,%xmm12 + vpxor %xmm4,%xmm11,%xmm11 + vpaddb %xmm2,%xmm12,%xmm13 + vpxor %xmm4,%xmm12,%xmm12 + vpaddb %xmm2,%xmm13,%xmm14 + vpxor %xmm4,%xmm13,%xmm13 + vpaddb %xmm2,%xmm14,%xmm1 + vpxor %xmm4,%xmm14,%xmm14 + jmp .Loop_ctr32 + +.align 16 +.Loop_ctr32: + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + vmovups (%r12),%xmm15 + leaq 16(%r12),%r12 + decl %r13d + jnz .Loop_ctr32 + + vmovdqu (%r12),%xmm3 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor 0(%rdi),%xmm3,%xmm4 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor 16(%rdi),%xmm3,%xmm5 + vaesenc %xmm15,%xmm11,%xmm11 + vpxor 32(%rdi),%xmm3,%xmm6 + vaesenc %xmm15,%xmm12,%xmm12 + vpxor 48(%rdi),%xmm3,%xmm8 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor 64(%rdi),%xmm3,%xmm2 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor 80(%rdi),%xmm3,%xmm3 + leaq 96(%rdi),%rdi + + vaesenclast %xmm4,%xmm9,%xmm9 + vaesenclast %xmm5,%xmm10,%xmm10 + vaesenclast %xmm6,%xmm11,%xmm11 + vaesenclast %xmm8,%xmm12,%xmm12 + vaesenclast %xmm2,%xmm13,%xmm13 + vaesenclast %xmm3,%xmm14,%xmm14 + vmovups %xmm9,0(%rsi) + vmovups %xmm10,16(%rsi) + vmovups %xmm11,32(%rsi) + vmovups %xmm12,48(%rsi) + vmovups %xmm13,64(%rsi) + vmovups %xmm14,80(%rsi) + leaq 96(%rsi),%rsi + + .byte 0xf3,0xc3 +.align 32 +.Lhandle_ctr32_2: + vpshufb %xmm0,%xmm1,%xmm6 + vmovdqu 48(%r11),%xmm5 + vpaddd 64(%r11),%xmm6,%xmm10 + vpaddd %xmm5,%xmm6,%xmm11 + vpaddd %xmm5,%xmm10,%xmm12 + vpshufb %xmm0,%xmm10,%xmm10 + vpaddd %xmm5,%xmm11,%xmm13 + vpshufb %xmm0,%xmm11,%xmm11 + vpxor %xmm4,%xmm10,%xmm10 + vpaddd %xmm5,%xmm12,%xmm14 + vpshufb %xmm0,%xmm12,%xmm12 + vpxor %xmm4,%xmm11,%xmm11 + vpaddd %xmm5,%xmm13,%xmm1 + vpshufb %xmm0,%xmm13,%xmm13 + vpxor %xmm4,%xmm12,%xmm12 + vpshufb %xmm0,%xmm14,%xmm14 + vpxor %xmm4,%xmm13,%xmm13 + vpshufb %xmm0,%xmm1,%xmm1 + vpxor %xmm4,%xmm14,%xmm14 + jmp .Loop_ctr32 +.cfi_endproc +.size _aesni_ctr32_6x,.-_aesni_ctr32_6x + +.globl aesni_gcm_encrypt +.type aesni_gcm_encrypt,@function +.align 32 +aesni_gcm_encrypt: +.cfi_startproc + xorq %r10,%r10 + cmpq $288,%rdx + jb .Lgcm_enc_abort + + leaq (%rsp),%rax +.cfi_def_cfa_register %rax + pushq %rbx +.cfi_offset %rbx,-16 + pushq %rbp +.cfi_offset %rbp,-24 + pushq %r12 +.cfi_offset %r12,-32 + pushq %r13 +.cfi_offset %r13,-40 + pushq %r14 +.cfi_offset %r14,-48 + pushq %r15 +.cfi_offset %r15,-56 + vzeroupper + + vmovdqu (%r8),%xmm1 + addq $-128,%rsp + movl 12(%r8),%ebx + leaq .Lbswap_mask(%rip),%r11 + leaq -128(%rcx),%r14 + movq $0xf80,%r15 + leaq 128(%rcx),%rcx + vmovdqu (%r11),%xmm0 + andq $-128,%rsp + movl 240-128(%rcx),%ebp + + andq %r15,%r14 + andq %rsp,%r15 + subq %r14,%r15 + jc .Lenc_no_key_aliasing + cmpq $768,%r15 + jnc .Lenc_no_key_aliasing + subq %r15,%rsp +.Lenc_no_key_aliasing: + + leaq (%rsi),%r14 + leaq -192(%rsi,%rdx,1),%r15 + shrq $4,%rdx + + call _aesni_ctr32_6x + vpshufb %xmm0,%xmm9,%xmm8 + vpshufb %xmm0,%xmm10,%xmm2 + vmovdqu %xmm8,112(%rsp) + vpshufb %xmm0,%xmm11,%xmm4 + vmovdqu %xmm2,96(%rsp) + vpshufb %xmm0,%xmm12,%xmm5 + vmovdqu %xmm4,80(%rsp) + vpshufb %xmm0,%xmm13,%xmm6 + vmovdqu %xmm5,64(%rsp) + vpshufb %xmm0,%xmm14,%xmm7 + vmovdqu %xmm6,48(%rsp) + + call _aesni_ctr32_6x + + vmovdqu (%r9),%xmm8 + leaq 32+32(%r9),%r9 + subq $12,%rdx + movq $192,%r10 + vpshufb %xmm0,%xmm8,%xmm8 + + call _aesni_ctr32_ghash_6x + vmovdqu 32(%rsp),%xmm7 + vmovdqu (%r11),%xmm0 + vmovdqu 0-32(%r9),%xmm3 + vpunpckhqdq %xmm7,%xmm7,%xmm1 + vmovdqu 32-32(%r9),%xmm15 + vmovups %xmm9,-96(%rsi) + vpshufb %xmm0,%xmm9,%xmm9 + vpxor %xmm7,%xmm1,%xmm1 + vmovups %xmm10,-80(%rsi) + vpshufb %xmm0,%xmm10,%xmm10 + vmovups %xmm11,-64(%rsi) + vpshufb %xmm0,%xmm11,%xmm11 + vmovups %xmm12,-48(%rsi) + vpshufb %xmm0,%xmm12,%xmm12 + vmovups %xmm13,-32(%rsi) + vpshufb %xmm0,%xmm13,%xmm13 + vmovups %xmm14,-16(%rsi) + vpshufb %xmm0,%xmm14,%xmm14 + vmovdqu %xmm9,16(%rsp) + vmovdqu 48(%rsp),%xmm6 + vmovdqu 16-32(%r9),%xmm0 + vpunpckhqdq %xmm6,%xmm6,%xmm2 + vpclmulqdq $0x00,%xmm3,%xmm7,%xmm5 + vpxor %xmm6,%xmm2,%xmm2 + vpclmulqdq $0x11,%xmm3,%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm15,%xmm1,%xmm1 + + vmovdqu 64(%rsp),%xmm9 + vpclmulqdq $0x00,%xmm0,%xmm6,%xmm4 + vmovdqu 48-32(%r9),%xmm3 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm9,%xmm9,%xmm5 + vpclmulqdq $0x11,%xmm0,%xmm6,%xmm6 + vpxor %xmm9,%xmm5,%xmm5 + vpxor %xmm7,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm15,%xmm2,%xmm2 + vmovdqu 80-32(%r9),%xmm15 + vpxor %xmm1,%xmm2,%xmm2 + + vmovdqu 80(%rsp),%xmm1 + vpclmulqdq $0x00,%xmm3,%xmm9,%xmm7 + vmovdqu 64-32(%r9),%xmm0 + vpxor %xmm4,%xmm7,%xmm7 + vpunpckhqdq %xmm1,%xmm1,%xmm4 + vpclmulqdq $0x11,%xmm3,%xmm9,%xmm9 + vpxor %xmm1,%xmm4,%xmm4 + vpxor %xmm6,%xmm9,%xmm9 + vpclmulqdq $0x00,%xmm15,%xmm5,%xmm5 + vpxor %xmm2,%xmm5,%xmm5 + + vmovdqu 96(%rsp),%xmm2 + vpclmulqdq $0x00,%xmm0,%xmm1,%xmm6 + vmovdqu 96-32(%r9),%xmm3 + vpxor %xmm7,%xmm6,%xmm6 + vpunpckhqdq %xmm2,%xmm2,%xmm7 + vpclmulqdq $0x11,%xmm0,%xmm1,%xmm1 + vpxor %xmm2,%xmm7,%xmm7 + vpxor %xmm9,%xmm1,%xmm1 + vpclmulqdq $0x10,%xmm15,%xmm4,%xmm4 + vmovdqu 128-32(%r9),%xmm15 + vpxor %xmm5,%xmm4,%xmm4 + + vpxor 112(%rsp),%xmm8,%xmm8 + vpclmulqdq $0x00,%xmm3,%xmm2,%xmm5 + vmovdqu 112-32(%r9),%xmm0 + vpunpckhqdq %xmm8,%xmm8,%xmm9 + vpxor %xmm6,%xmm5,%xmm5 + vpclmulqdq $0x11,%xmm3,%xmm2,%xmm2 + vpxor %xmm8,%xmm9,%xmm9 + vpxor %xmm1,%xmm2,%xmm2 + vpclmulqdq $0x00,%xmm15,%xmm7,%xmm7 + vpxor %xmm4,%xmm7,%xmm4 + + vpclmulqdq $0x00,%xmm0,%xmm8,%xmm6 + vmovdqu 0-32(%r9),%xmm3 + vpunpckhqdq %xmm14,%xmm14,%xmm1 + vpclmulqdq $0x11,%xmm0,%xmm8,%xmm8 + vpxor %xmm14,%xmm1,%xmm1 + vpxor %xmm5,%xmm6,%xmm5 + vpclmulqdq $0x10,%xmm15,%xmm9,%xmm9 + vmovdqu 32-32(%r9),%xmm15 + vpxor %xmm2,%xmm8,%xmm7 + vpxor %xmm4,%xmm9,%xmm6 + + vmovdqu 16-32(%r9),%xmm0 + vpxor %xmm5,%xmm7,%xmm9 + vpclmulqdq $0x00,%xmm3,%xmm14,%xmm4 + vpxor %xmm9,%xmm6,%xmm6 + vpunpckhqdq %xmm13,%xmm13,%xmm2 + vpclmulqdq $0x11,%xmm3,%xmm14,%xmm14 + vpxor %xmm13,%xmm2,%xmm2 + vpslldq $8,%xmm6,%xmm9 + vpclmulqdq $0x00,%xmm15,%xmm1,%xmm1 + vpxor %xmm9,%xmm5,%xmm8 + vpsrldq $8,%xmm6,%xmm6 + vpxor %xmm6,%xmm7,%xmm7 + + vpclmulqdq $0x00,%xmm0,%xmm13,%xmm5 + vmovdqu 48-32(%r9),%xmm3 + vpxor %xmm4,%xmm5,%xmm5 + vpunpckhqdq %xmm12,%xmm12,%xmm9 + vpclmulqdq $0x11,%xmm0,%xmm13,%xmm13 + vpxor %xmm12,%xmm9,%xmm9 + vpxor %xmm14,%xmm13,%xmm13 + vpalignr $8,%xmm8,%xmm8,%xmm14 + vpclmulqdq $0x10,%xmm15,%xmm2,%xmm2 + vmovdqu 80-32(%r9),%xmm15 + vpxor %xmm1,%xmm2,%xmm2 + + vpclmulqdq $0x00,%xmm3,%xmm12,%xmm4 + vmovdqu 64-32(%r9),%xmm0 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm11,%xmm11,%xmm1 + vpclmulqdq $0x11,%xmm3,%xmm12,%xmm12 + vpxor %xmm11,%xmm1,%xmm1 + vpxor %xmm13,%xmm12,%xmm12 + vxorps 16(%rsp),%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm15,%xmm9,%xmm9 + vpxor %xmm2,%xmm9,%xmm9 + + vpclmulqdq $0x10,16(%r11),%xmm8,%xmm8 + vxorps %xmm14,%xmm8,%xmm8 + + vpclmulqdq $0x00,%xmm0,%xmm11,%xmm5 + vmovdqu 96-32(%r9),%xmm3 + vpxor %xmm4,%xmm5,%xmm5 + vpunpckhqdq %xmm10,%xmm10,%xmm2 + vpclmulqdq $0x11,%xmm0,%xmm11,%xmm11 + vpxor %xmm10,%xmm2,%xmm2 + vpalignr $8,%xmm8,%xmm8,%xmm14 + vpxor %xmm12,%xmm11,%xmm11 + vpclmulqdq $0x10,%xmm15,%xmm1,%xmm1 + vmovdqu 128-32(%r9),%xmm15 + vpxor %xmm9,%xmm1,%xmm1 + + vxorps %xmm7,%xmm14,%xmm14 + vpclmulqdq $0x10,16(%r11),%xmm8,%xmm8 + vxorps %xmm14,%xmm8,%xmm8 + + vpclmulqdq $0x00,%xmm3,%xmm10,%xmm4 + vmovdqu 112-32(%r9),%xmm0 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm8,%xmm8,%xmm9 + vpclmulqdq $0x11,%xmm3,%xmm10,%xmm10 + vpxor %xmm8,%xmm9,%xmm9 + vpxor %xmm11,%xmm10,%xmm10 + vpclmulqdq $0x00,%xmm15,%xmm2,%xmm2 + vpxor %xmm1,%xmm2,%xmm2 + + vpclmulqdq $0x00,%xmm0,%xmm8,%xmm5 + vpclmulqdq $0x11,%xmm0,%xmm8,%xmm7 + vpxor %xmm4,%xmm5,%xmm5 + vpclmulqdq $0x10,%xmm15,%xmm9,%xmm6 + vpxor %xmm10,%xmm7,%xmm7 + vpxor %xmm2,%xmm6,%xmm6 + + vpxor %xmm5,%xmm7,%xmm4 + vpxor %xmm4,%xmm6,%xmm6 + vpslldq $8,%xmm6,%xmm1 + vmovdqu 16(%r11),%xmm3 + vpsrldq $8,%xmm6,%xmm6 + vpxor %xmm1,%xmm5,%xmm8 + vpxor %xmm6,%xmm7,%xmm7 + + vpalignr $8,%xmm8,%xmm8,%xmm2 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm8 + vpxor %xmm2,%xmm8,%xmm8 + + vpalignr $8,%xmm8,%xmm8,%xmm2 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm8 + vpxor %xmm7,%xmm2,%xmm2 + vpxor %xmm2,%xmm8,%xmm8 + vpshufb (%r11),%xmm8,%xmm8 + vmovdqu %xmm8,-64(%r9) + + vzeroupper + movq -48(%rax),%r15 +.cfi_restore %r15 + movq -40(%rax),%r14 +.cfi_restore %r14 + movq -32(%rax),%r13 +.cfi_restore %r13 + movq -24(%rax),%r12 +.cfi_restore %r12 + movq -16(%rax),%rbp +.cfi_restore %rbp + movq -8(%rax),%rbx +.cfi_restore %rbx + leaq (%rax),%rsp +.cfi_def_cfa_register %rsp +.Lgcm_enc_abort: + movq %r10,%rax + .byte 0xf3,0xc3 +.cfi_endproc +.size aesni_gcm_encrypt,.-aesni_gcm_encrypt +.align 64 +.Lbswap_mask: +.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +.Lpoly: +.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2 +.Lone_msb: +.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +.Ltwo_lsb: +.byte 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.Lone_lsb: +.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.align 64 Modified: head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed Aug 26 16:55:28 2020 (r364822) +++ head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed Aug 26 16:56:44 2020 (r364823) @@ -9,6 +9,14 @@ .align 32 aesni_multi_cbc_encrypt: .cfi_startproc + cmpl $2,%edx + jb .Lenc_non_avx + movl OPENSSL_ia32cap_P+4(%rip),%ecx + testl $268435456,%ecx + jnz _avx_cbc_enc_shortcut + jmp .Lenc_non_avx +.align 16 +.Lenc_non_avx: movq %rsp,%rax .cfi_def_cfa_register %rax pushq %rbx @@ -283,6 +291,14 @@ aesni_multi_cbc_encrypt: .align 32 aesni_multi_cbc_decrypt: .cfi_startproc + cmpl $2,%edx + jb .Ldec_non_avx + movl OPENSSL_ia32cap_P+4(%rip),%ecx + testl $268435456,%ecx + jnz _avx_cbc_dec_shortcut + jmp .Ldec_non_avx +.align 16 +.Ldec_non_avx: movq %rsp,%rax .cfi_def_cfa_register %rax pushq %rbx @@ -542,3 +558,952 @@ aesni_multi_cbc_decrypt: .byte 0xf3,0xc3 .cfi_endproc .size aesni_multi_cbc_decrypt,.-aesni_multi_cbc_decrypt +.type aesni_multi_cbc_encrypt_avx,@function +.align 32 +aesni_multi_cbc_encrypt_avx: +.cfi_startproc +_avx_cbc_enc_shortcut: + movq %rsp,%rax +.cfi_def_cfa_register %rax + pushq %rbx +.cfi_offset %rbx,-16 + pushq %rbp +.cfi_offset %rbp,-24 + pushq %r12 +.cfi_offset %r12,-32 + pushq %r13 +.cfi_offset %r13,-40 + pushq %r14 +.cfi_offset %r14,-48 + pushq %r15 +.cfi_offset %r15,-56 + + + + + + + + + subq $192,%rsp + andq $-128,%rsp + movq %rax,16(%rsp) +.cfi_escape 0x0f,0x05,0x77,0x10,0x06,0x23,0x08 + +.Lenc8x_body: + vzeroupper + vmovdqu (%rsi),%xmm15 + leaq 120(%rsi),%rsi + leaq 160(%rdi),%rdi + shrl $1,%edx + +.Lenc8x_loop_grande: + + xorl %edx,%edx + movl -144(%rdi),%ecx + movq -160(%rdi),%r8 + cmpl %edx,%ecx + movq -152(%rdi),%rbx + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -136(%rdi),%xmm2 + movl %ecx,32(%rsp) + cmovleq %rsp,%r8 + subq %r8,%rbx + movq %rbx,64(%rsp) + movl -104(%rdi),%ecx + movq -120(%rdi),%r9 + cmpl %edx,%ecx + movq -112(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -96(%rdi),%xmm3 + movl %ecx,36(%rsp) + cmovleq %rsp,%r9 + subq %r9,%rbp + movq %rbp,72(%rsp) + movl -64(%rdi),%ecx + movq -80(%rdi),%r10 + cmpl %edx,%ecx + movq -72(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -56(%rdi),%xmm4 + movl %ecx,40(%rsp) + cmovleq %rsp,%r10 + subq %r10,%rbp + movq %rbp,80(%rsp) + movl -24(%rdi),%ecx + movq -40(%rdi),%r11 + cmpl %edx,%ecx + movq -32(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -16(%rdi),%xmm5 + movl %ecx,44(%rsp) + cmovleq %rsp,%r11 + subq %r11,%rbp + movq %rbp,88(%rsp) + movl 16(%rdi),%ecx + movq 0(%rdi),%r12 + cmpl %edx,%ecx + movq 8(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 24(%rdi),%xmm6 + movl %ecx,48(%rsp) + cmovleq %rsp,%r12 + subq %r12,%rbp + movq %rbp,96(%rsp) + movl 56(%rdi),%ecx + movq 40(%rdi),%r13 + cmpl %edx,%ecx + movq 48(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 64(%rdi),%xmm7 + movl %ecx,52(%rsp) + cmovleq %rsp,%r13 + subq %r13,%rbp + movq %rbp,104(%rsp) + movl 96(%rdi),%ecx + movq 80(%rdi),%r14 + cmpl %edx,%ecx + movq 88(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 104(%rdi),%xmm8 + movl %ecx,56(%rsp) + cmovleq %rsp,%r14 + subq %r14,%rbp + movq %rbp,112(%rsp) + movl 136(%rdi),%ecx + movq 120(%rdi),%r15 + cmpl %edx,%ecx + movq 128(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 144(%rdi),%xmm9 + movl %ecx,60(%rsp) + cmovleq %rsp,%r15 + subq %r15,%rbp + movq %rbp,120(%rsp) + testl %edx,%edx + jz .Lenc8x_done + + vmovups 16-120(%rsi),%xmm1 + vmovups 32-120(%rsi),%xmm0 + movl 240-120(%rsi),%eax + + vpxor (%r8),%xmm15,%xmm10 + leaq 128(%rsp),%rbp + vpxor (%r9),%xmm15,%xmm11 + vpxor (%r10),%xmm15,%xmm12 + vpxor (%r11),%xmm15,%xmm13 + vpxor %xmm10,%xmm2,%xmm2 + vpxor (%r12),%xmm15,%xmm10 + vpxor %xmm11,%xmm3,%xmm3 + vpxor (%r13),%xmm15,%xmm11 + vpxor %xmm12,%xmm4,%xmm4 + vpxor (%r14),%xmm15,%xmm12 + vpxor %xmm13,%xmm5,%xmm5 + vpxor (%r15),%xmm15,%xmm13 + vpxor %xmm10,%xmm6,%xmm6 + movl $1,%ecx + vpxor %xmm11,%xmm7,%xmm7 + vpxor %xmm12,%xmm8,%xmm8 + vpxor %xmm13,%xmm9,%xmm9 + jmp .Loop_enc8x + +.align 32 +.Loop_enc8x: + vaesenc %xmm1,%xmm2,%xmm2 + cmpl 32+0(%rsp),%ecx + vaesenc %xmm1,%xmm3,%xmm3 + prefetcht0 31(%r8) + vaesenc %xmm1,%xmm4,%xmm4 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 26 17:04:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4BD83B33A1; Wed, 26 Aug 2020 17:04:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcBzk39N0z4Jq8; Wed, 26 Aug 2020 17:04:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x32c.google.com with SMTP id w2so2268727wmi.1; Wed, 26 Aug 2020 10:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VOFJKTTWHwEIws6WD+/o1HDeM/AMNWjMasLkA5XoMHo=; b=koCQG1ZO+g9PPn0kPUQ1I+Zg79MNEUUIxG4BxXQYOwuxH6aBP2xU8TOB7SWFZ6AkA4 fSqbsyz0Yz/P1dQlKDkP8yC8yvXi0Z73tsx4PDX5gYwvqUXTEJh0CfUC+n94BpBR9wvx hanav/iMR6KwW0q12DedXMfiBbfMsHsTLePga+I5Y9cV9TBuqbtfw/+a+Nm2r/JsGyuN jAGymfw3RaRH4LQJUoqUIHhE+v/umE4U7+0FuuSXKO9AUVKzh331uGwPKjWUp/X9N9na kFtoaO4/umIXfiLLBISYtN0jWSLr+FOzI8LSsWwb4oCXQK6nyLn13q6Aqcj5khOKgO9S uFaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VOFJKTTWHwEIws6WD+/o1HDeM/AMNWjMasLkA5XoMHo=; b=ceiBRAfDpXf6yAm1ezedK0rhYJhGUlaBO5tye1amWnjaeEGKKtvU02caTF8M69y9m1 i8T0xY1rGJbh7/JIYk4ZTEeCpx5HVDrFSGt11hXdAcdUkBzeNl8MabUCAuk44ptajyWx ZYS5QduDvrr9Nyp1rsj6FUuMTwrUbNntj7Oqt9Ac0LIEiNrtDfhAUy0yHU4ht7030xcM TgZF1J3F3MtG8zGV2xICJ2OdT2nJp9ojjE68NEaWP7fVeZEjtTO6l1rVVtyAL+b48GDt WmDslqms2W0iJwF2fFEmdI8Yxsjr9n4hunIKEeqo7emjrd+7JESzYbKZHV+MJ7lsmmyF w3XQ== X-Gm-Message-State: AOAM531cZlXXTm4CVNq47CIu2xr/MHUmpXa5kGNZV0rmh4q+QwsJV96k 0Qsr5zprLr2MSgrMuIh+bMi+J9A4qJMrRiCbHoSBuAiS X-Google-Smtp-Source: ABdhPJzlOtfoNcukJX3y+bXO7pDST0mdAEdHyetGz7zkNvAg0Js0qelALWYQC0M0uv/OfZLMo51UH5A6jqFTVukmqlg= X-Received: by 2002:a05:600c:4150:: with SMTP id h16mr8170919wmm.127.1598461471633; Wed, 26 Aug 2020 10:04:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:5347:0:0:0:0:0 with HTTP; Wed, 26 Aug 2020 10:04:30 -0700 (PDT) In-Reply-To: <202008261655.07QGtSZx096979@repo.freebsd.org> References: <202008261655.07QGtSZx096979@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 26 Aug 2020 19:04:30 +0200 Message-ID: Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BcBzk39N0z4Jq8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:04:34 -0000 On 8/26/20, Jung-uk Kim wrote: > Author: jkim > Date: Wed Aug 26 16:55:28 2020 > New Revision: 364822 > URL: https://svnweb.freebsd.org/changeset/base/364822 > > Log: > Fix Clang version detection. > > We prepend "FreeBSD" to Clang version string. This broke compiler test > for > AVX instruction support. > What about other software checking in similar fashion? imo the right fix is to stop mucking with the way clang reports itself > Reported by: jhb > > Modified: > head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl > head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl > head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl > head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl > head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl > head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl > head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl > head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl > head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl > head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl > head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl > head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl > head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl > head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl > head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl > head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl > head/crypto/openssl/crypto/sha/asm/sha1-586.pl > head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl > head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl > head/crypto/openssl/crypto/sha/asm/sha256-586.pl > head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl > head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl > > Modified: head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -70,7 +70,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -108,7 +108,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ > $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) > && > `ml64 2>&1` =~ /Version ([0-9]+)\./ && > $1>=10); > -$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based > on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); > +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based > on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0); > > $shaext=1; ### set to zero if compiling for 1.0.1 > > > Modified: head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -70,7 +70,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=12); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl > ============================================================================== > --- head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/bn/asm/rsaz-avx2.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $addx = ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) > ([0-9]+)\.([0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) > ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $avx = ($ver>=3.0) + ($ver>=3.01); > $addx = ($ver>=3.03); > > Modified: head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -81,7 +81,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $addx = ($ver>=3.03); > } > > Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl > ============================================================================== > --- head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -75,7 +75,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $addx = ($ver>=3.03); > } > > Modified: head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl > ============================================================================== > --- head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -60,7 +60,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $addx = ($ver>=3.03); > } > > Modified: head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl > ============================================================================== > --- head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/chacha/asm/chacha-x86.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -62,7 +62,7 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" && > $1>=10); # first version supporting AVX > > $ymm=1 if ($xmm && !$ymm && > - `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) > ([0-9]+\.[0-9]+)/ && > + `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) > ([0-9]+\.[0-9]+)/ && > $2>=3.0); # first version supporting AVX > > $a="eax"; > > Modified: head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/chacha/asm/chacha-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -85,7 +85,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl > ============================================================================== > --- head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/ec/asm/ecp_nistz256-avx2.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -47,7 +47,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) > ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $avx = ($ver>=3.0) + ($ver>=3.01); > $addx = ($ver>=3.03); > > Modified: head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -72,7 +72,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $avx = ($ver>=3.0) + ($ver>=3.01); > $addx = ($ver>=3.03); > > Modified: head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/ec/asm/x25519-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -90,7 +90,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{AS > $addx = ($1>=12); > } > > -if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+)\.([0-9]+)/) { > my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 > $addx = ($ver>=3.03); > } > > Modified: head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -116,7 +116,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl > ============================================================================== > --- head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/poly1305/asm/poly1305-x86.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -71,7 +71,7 @@ if ($sse2) { > $avx = ($1>=2.09) + ($1>=2.10); > } > > - if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on > LLVM) ([0-9]+\.[0-9]+)/) { > + if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) > ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > } > > Modified: head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/poly1305/asm/poly1305-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -90,7 +90,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=12); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/sha/asm/sha1-586.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha1-586.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha1-586.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -144,7 +144,7 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" && > `ml 2>&1` =~ /Version ([0-9]+)\./ && > $1>=10); # first version supporting AVX > > -$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) > version|based on LLVM) ([0-9]+\.[0-9]+)/ && > +$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) > version|based on LLVM) ([0-9]+\.[0-9]+)/ && > $2>=3.0); # first version supporting AVX > > $shaext=$xmm; ### set to zero if compiling for 1.0.1 > > Modified: head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -66,7 +66,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -119,7 +119,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/sha/asm/sha256-586.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha256-586.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha256-586.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -96,7 +96,7 @@ if ($xmm && !$avx && $ARGV[0] eq "win32" && > $avx = ($1>=10) + ($1>=11); > } > > -if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based > on LLVM) ([0-9]+\.[0-9]+)/) { > +if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based > on LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl Wed Aug 26 > 15:43:44 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl Wed Aug 26 > 16:55:28 2020 (r364822) > @@ -67,7 +67,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > > Modified: head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl > ============================================================================== > --- head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl Wed Aug 26 15:43:44 > 2020 (r364821) > +++ head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl Wed Aug 26 16:55:28 > 2020 (r364822) > @@ -135,7 +135,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM > $avx = ($1>=10) + ($1>=11); > } > > -if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on > LLVM) ([0-9]+\.[0-9]+)/) { > $avx = ($2>=3.0) + ($2>3.0); > } > > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Aug 26 17:06:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D6AD3B33C4; Wed, 26 Aug 2020 17:06:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcC1j2lcPz4KC1; Wed, 26 Aug 2020 17:06:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41FF71644A; Wed, 26 Aug 2020 17:06:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QH6HvX004456; Wed, 26 Aug 2020 17:06:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QH6Hu3004455; Wed, 26 Aug 2020 17:06:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008261706.07QH6Hu3004455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 26 Aug 2020 17:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364824 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 364824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:06:17 -0000 Author: imp Date: Wed Aug 26 17:06:16 2020 New Revision: 364824 URL: https://svnweb.freebsd.org/changeset/base/364824 Log: Make sbuf_setpos match the implementation. sbuf_setpos can only be used to truncate the buffer, never to make it longer. Update the documentation to reflect this. Reviewed By: allanjude, phk Differential Revision: https://reviews.freebsd.org/D26198 Modified: head/share/man/man9/sbuf.9 Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Wed Aug 26 16:56:44 2020 (r364823) +++ head/share/man/man9/sbuf.9 Wed Aug 26 17:06:16 2020 (r364824) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2019 +.Dd August 26, 2020 .Dt SBUF 9 .Os .Sh NAME @@ -370,9 +370,8 @@ function sets the .Fa sbuf Ns 's end position to .Fa pos , -which is a value between zero and one less than the size of the -storage buffer. -This effectively truncates the sbuf at the new position. +which is a value between zero and the current position in the buffer. +It can only truncate the sbuf to the new position. .Pp The .Fn sbuf_bcat From owner-svn-src-head@freebsd.org Wed Aug 26 17:09:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DD8B3B34F5 for ; Wed, 26 Aug 2020 17:09:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcC5J280Yz4K7c for ; Wed, 26 Aug 2020 17:09:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f68.google.com with SMTP id z9so2542947wmk.1 for ; Wed, 26 Aug 2020 10:09:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ntgY0YbWc++h+4H7EEPy/uu+suEfWWPLprozJLlXe6Y=; b=BSx+UjTeJDfcDX/bs2F75lPeAa4ZdpAKegt23tPZl5fqIngqTEy9w59npdE0GtDhjm 6Z9kVJrJ7gepe9Nbv4tMI58iRYsuq5ZqzdGYKJhrArdfIhtNX5haukXu9pwZI8uDwzQA 0R89h1Rn27Yn0XSenNqDS8cbuZjS2CaT5uWAW9TOC05pCMsaXkA0OkFIFg2/dOQokbZu vIqFInuEyw+jaKLpOD/2CgGfCHGHwS2KlbQQFlKKOcaqovxIIJyrpW/rStG8CA7bWoGL HF9VFv0JlFA+6V6l13/q3PqbPjQygR5NxpLUij7TbPXvFteQIgUeV+M6doTHM5rAWY2C T+zg== X-Gm-Message-State: AOAM532k9PsB9cWsh7eFBUHimzX1O2Okwa5OkEFCZgvQTl4UaZmvPQNK lF+edBE7DdKLMgY9kXZkasL3Qw== X-Google-Smtp-Source: ABdhPJy/2hXvCGtEz76xXzi2lXDVTSItHsBvbKZzokPktwEKGDOUyBDFJds6g2CKXAL51WmnfpWvXQ== X-Received: by 2002:a1c:740e:: with SMTP id p14mr7747479wmc.179.1598461762694; Wed, 26 Aug 2020 10:09:22 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id z6sm7188356wml.41.2020.08.26.10.09.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 10:09:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm From: Jessica Clarke In-Reply-To: Date: Wed, 26 Aug 2020 18:09:19 +0100 Cc: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <1005AA00-136E-4C56-807B-391CEC2A0051@freebsd.org> References: <202008261655.07QGtSZx096979@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BcC5J280Yz4K7c X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.68 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.49)[-0.485]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.81)[-0.805]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.83)[-0.832]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.68:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.68:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:09:25 -0000 On 26 Aug 2020, at 18:04, Mateusz Guzik wrote: > > On 8/26/20, Jung-uk Kim wrote: >> Author: jkim >> Date: Wed Aug 26 16:55:28 2020 >> New Revision: 364822 >> URL: https://svnweb.freebsd.org/changeset/base/364822 >> >> Log: >> Fix Clang version detection. >> >> We prepend "FreeBSD" to Clang version string. This broke compiler test >> for >> AVX instruction support. >> > > What about other software checking in similar fashion? imo the right > fix is to stop mucking with the way clang reports itself Apple's LLVM also does the same thing. Whilst it may be better to leave the string alone, it is sometimes useful information and, given the existence of Apple's LLVM, well-behaved software should already be dealing with this properly; based on this commit, upstream OpenSSL seems like it suffers the same bug on macOS. Jess From owner-svn-src-head@freebsd.org Wed Aug 26 17:14:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EA713B399E for ; Wed, 26 Aug 2020 17:14:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcCBc5nglz4KTY for ; Wed, 26 Aug 2020 17:14:00 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1598462033; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=M20qIZO7XpFVL5388mF/cn9UmDW4c1AXMLeZ1xn5D7STGwWelf6ATo5cyP9fgyOo/aijEIBv+0KwO 5PHAPjO5fvqXiJf37lQCWRQ/VOLlZXSC/qtlusUTAMdBAh6c636wCiqqdKugEUF7QMpgpFOnZM/u8g c93p8/8b0qWEYZMwu+9IScuaWDefbSZ6Z4irKDI8ZtdkMg0ngYSVdzMxSaAv/6QLUuj85WZMgWOWLR X/b8wxULj/RJQlHn1r5QFbDeaBkhFoUxrsCtaV1tEs5N45HaM6x4Sh+pVFCnnHXUo2tjJrXX79TGoA 4DO0G0OCeUi+GvSOA8jhpHtYyygSuCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=gu8G8Q5LNIslAcGyVspUc1TuCeoFLiJ1W/FInZc8ZwU=; b=O83o0GtwXPgqEl6W9AzDFdlQQgvdG+r0dEhm1WcI/wR1iLBuZfpZMjhN+7syFtAliFOuDZcw9ZqUp eLI9Yt65vb1JNn6xFbS0l18Xa3Ybg6GnbbiutIFOHUYylNXwT7gb9z3mHgjRYtvkURyus85PzJNr49 TcPx6eJR63cQ8gBbDo/xDo6ES+ttCjeS4DaxOwsuSunfBkEeHZaIZ+T3E1lnO/d0npW33NCv0omRBP kG3cwcYTBpR1TflNkFP7aHAZAcBolszDw3uOtxvikw2/e6IFCk7pvjmizQjab5At0qHYuKmVQxfIIo cDA8rRwWEnJ4DYvkUAWhEEW8rl0DBPg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=gu8G8Q5LNIslAcGyVspUc1TuCeoFLiJ1W/FInZc8ZwU=; b=n4GBsKvgdx5HvwV+kSYYOShvfFkdzqy/tpPnDtQNqRjpGezHW//PMlB0gsL/IxqXSRUgURNj2OGNy yiI/Zg2NUKIfqLICGv4J+RSOZrHGzuimRnA1esjl8JpxboS558FOY0Fg5M1W2N/qavd8QJWBZwhwNu k4oXTpLWHU7fN0TqUF4A8AqvTzG7eg4ybiUN5l6fEJCEvyl6JKiRqfOfsx7wDwCd9QjJPxZweZHP87 2TmEXL5LhnnYREVtYGDsbcANE1ZoUYMtIGxIRoT3m6fatGaLuQ7lzr3He2ub3wTKEh5SxvxPx+VKdT jSyOed3xhOowq3kDWUFSxa6DH6rbcPw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 82ba72f9-e7bf-11ea-a2bb-9f0c275c2f69 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 82ba72f9-e7bf-11ea-a2bb-9f0c275c2f69; Wed, 26 Aug 2020 17:13:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 07QHDocY018073; Wed, 26 Aug 2020 11:13:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <7f1149b6e8dfd1600ff235b7b1aaae3b746b4a9f.camel@freebsd.org> Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm From: Ian Lepore To: Mateusz Guzik , Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 26 Aug 2020 11:13:50 -0600 In-Reply-To: References: <202008261655.07QGtSZx096979@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BcCBc5nglz4KTY X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:14:01 -0000 On Wed, 2020-08-26 at 19:04 +0200, Mateusz Guzik wrote: > On 8/26/20, Jung-uk Kim wrote: > > Author: jkim > > Date: Wed Aug 26 16:55:28 2020 > > New Revision: 364822 > > URL: https://svnweb.freebsd.org/changeset/base/364822 > > > > Log: > > Fix Clang version detection. > > > > We prepend "FreeBSD" to Clang version string. This broke > > compiler test > > for > > AVX instruction support. > > > > What about other software checking in similar fashion? imo the right > fix is to stop mucking with the way clang reports itself > Maybe it would be better to not modify the start of the string. Instead of FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) maybe clang version 9.0.1 for FreeBSD (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) -- Ian From owner-svn-src-head@freebsd.org Wed Aug 26 17:15:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69F153B3D84; Wed, 26 Aug 2020 17:15:36 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcCDS0s5sz4LLV; Wed, 26 Aug 2020 17:15:35 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-lj1-x232.google.com with SMTP id w25so3219392ljo.12; Wed, 26 Aug 2020 10:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pIomMq6JNXdW4oe4tWBNLahOmtF0xVJ6CD/N2hvWO6o=; b=CcQdK1cc65on8vuRR11S4vWNsAbPL8ZgTmQxQTlCl9GJpSFMNqHkSm0+SBFr1WFkhy McnKuwLwQL/sW1/Cqveo/qZN2B6rrTJNUHotSse8e4lUP0L3h8EasbTpcP7Wx1PVrrto e97PCSoodCbO+yqOjL/ZWEiDDHfidWhBdmLYMsIi8Y7hfzMPQETzwpC8PerqxRcf8sL2 LPp0/16aDQB9b02YARqcvUlUU/a+2QAg+7IZZg5DygcSxAdg2JsZj3KEvEvuzdkZ0FOm jJJlWx+W+SYeGoVn3hUmgjE1Pjuigxgi61Tr7sp8JCDWxklyM6h2anr8YS5XZmJUt0Ba LI2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pIomMq6JNXdW4oe4tWBNLahOmtF0xVJ6CD/N2hvWO6o=; b=g439XWjzFKaNyFwRT5MaKLwwB2K5gDlHVD+lyFUUJa7nlM9q74PQDyDJvaLMUGZ7Xl 8l6NynmsgCAxLRG3UHUVU1iUehM7XlBzcfIxT9uUQCJHMNLOqO6OrNyG/Wxp0NmRTik1 LMEND7ZPBwI7Jmdzai8VOjXhMnJMQ9Y7jDjRAR1dJe8nBJGboFoX09dBi2xDg/IEtQVA g6N+/JMMysRbNaCAQCdisqarZEedFBRmCVmjE9W/zFDHBCM0+UsrRG1EViqlb5do3Poi dKJNbRKUUmlLXj830R4fCc+Gg241NRA3UwbSQ4gS5xEmeGrpfYZlWxjOlX3KbqHXmMev S0YQ== X-Gm-Message-State: AOAM5317C62kfU8bgHPq/WQAT5YF7LiAGZDHwxBuKhRFhqKPwNCnXGPM WX4uHh/gY+UKbBh9TfKXmxXtz6cmP003/6huC1xxwhm0up8= X-Google-Smtp-Source: ABdhPJxSDUet0WMmNUPb/07KKDad+w+RS9VJNU2Rj1pUAkAOFP3Xf2GNaCB17tlEtU1wujYi0lEec/+AtNdNETMfPTc= X-Received: by 2002:a2e:91d4:: with SMTP id u20mr7119273ljg.87.1598462133210; Wed, 26 Aug 2020 10:15:33 -0700 (PDT) MIME-Version: 1.0 References: <202008260729.07Q7THlo023745@repo.freebsd.org> In-Reply-To: <202008260729.07Q7THlo023745@repo.freebsd.org> From: Matthew Macy Date: Wed, 26 Aug 2020 10:15:21 -0700 Message-ID: Subject: Re: svn commit: r364806 - in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl To: Toomas Soome Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BcCDS0s5sz4LLV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:15:36 -0000 Do not commit directly to sys/contrib. PR, vendor branch update, then merge. On Wed, Aug 26, 2020 at 12:29 AM Toomas Soome wrote: > > Author: tsoome > Date: Wed Aug 26 07:29:17 2020 > New Revision: 364806 > URL: https://svnweb.freebsd.org/changeset/base/364806 > > Log: > remove pragma ident lines > > The #pragma ident is historical relict and not needed any more, this > pragma is actually unknown for common compilers and is only causing > trouble. > > Modified: > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h > head/sys/contrib/openzfs/module/os/freebsd/spl/list.c > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -26,8 +26,6 @@ > #ifndef _SYS_ACL_IMPL_H > #define _SYS_ACL_IMPL_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #ifdef __cplusplus > extern "C" { > #endif > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -31,8 +31,6 @@ > #ifndef _SYS_CMN_ERR_H > #define _SYS_CMN_ERR_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #if !defined(_ASM) > #include > #endif > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -26,8 +26,6 @@ > #ifndef _SYS_EXTDIRENT_H > #define _SYS_EXTDIRENT_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #ifdef __cplusplus > extern "C" { > #endif > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -26,8 +26,6 @@ > #ifndef _SYS_LIST_H > #define _SYS_LIST_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #include > > #ifdef __cplusplus > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -27,8 +27,6 @@ > #ifndef _SYS_LIST_IMPL_H > #define _SYS_LIST_IMPL_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #include > > #ifdef __cplusplus > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h > ============================================================================== > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 07:29:17 2020 (r364806) > @@ -27,8 +27,6 @@ > #ifndef _ZMOD_H > #define _ZMOD_H > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > #ifdef __cplusplus > extern "C" { > #endif > > Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/list.c > ============================================================================== > --- head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 07:00:07 2020 (r364805) > +++ head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 07:29:17 2020 (r364806) > @@ -23,8 +23,6 @@ > * Use is subject to license terms. > */ > > -#pragma ident "%Z%%M% %I% %E% SMI" > - > /* > * Generic doubly-linked list implementation > */ From owner-svn-src-head@freebsd.org Wed Aug 26 17:29:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A87FB3B5451; Wed, 26 Aug 2020 17:29:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcCXr1g2Gz4McG; Wed, 26 Aug 2020 17:29:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id AzF1kqqSeng7KAzF3k2UgE; Wed, 26 Aug 2020 11:29:45 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=4wgsC2hmVBIfBVsB2CoA:9 a=89Yf-Dv4xqrt60fL:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 3B8D553B; Wed, 26 Aug 2020 10:29:43 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07QHTgfB008169; Wed, 26 Aug 2020 10:29:43 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008261729.07QHTgfB008169@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Matthew Macy cc: Toomas Soome , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364806 - in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl In-reply-to: References: <202008260729.07Q7THlo023745@repo.freebsd.org> Comments: In-reply-to Matthew Macy message dated "Wed, 26 Aug 2020 10:15:21 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 26 Aug 2020 10:29:42 -0700 X-CMAE-Envelope: MS4wfGRjMJUAx/IFXqooM/WonBAVmgZdVH11a0uKCyOydhALdlrrkURXI2XzKrk78Al+11LFTYeAwXgDvwp7aJtCf04SC3Ao/QVxM6RyhdNEtmiy7vfKM24e 3PEWK6GDHMkNcRkSpXJwAmPTHcpstF0KKO64FRYute36X3B2auiKGDBJW5nknZdgjlTzERirKrfVPTApVAOqxEa3at7TX3w1GHE8kcZ+p+2qW9Mng8kAe2xq w/NwjsCUFnQMn2BV0YtmAmqWmnJ2uACGZ+zHdr61LzFoW+iRpnVEcul3GNyM3APtq6Rwttb3I+LrcL0gl2vO3Q== X-Rspamd-Queue-Id: 4BcCXr1g2Gz4McG X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.9) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [1.33 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[64.59.134.9:from]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.03)[-0.034]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.134.9:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.05)[-0.051]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.11)[0.111]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:29:49 -0000 If these are local FreeBSD changes then one *should* commit directly to contrib/. vendor is for virgin vendor sources, i.e. without our modifications. svn does a fair job of merging from vendor to contrib (though occasionally it gets it wrong). Ideally we should push our changes back to the vendor, import those into vendor, then merge the official vendor sources/updates only after we receive them from the vendor or after the vendor has officially accepted them. But to put our changes into the vendor branch is wrong. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message , Matthew Macy writes: > Do not commit directly to sys/contrib. PR, vendor branch update, then merge. > > On Wed, Aug 26, 2020 at 12:29 AM Toomas Soome wrote: > > > > Author: tsoome > > Date: Wed Aug 26 07:29:17 2020 > > New Revision: 364806 > > URL: https://svnweb.freebsd.org/changeset/base/364806 > > > > Log: > > remove pragma ident lines > > > > The #pragma ident is historical relict and not needed any more, this > > pragma is actually unknown for common compilers and is only causing > > trouble. > > > > Modified: > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h > > head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h > > head/sys/contrib/openzfs/module/os/freebsd/spl/list.c > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed > Aug 26 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/acl_impl.h Wed > Aug 26 07:29:17 2020 (r364806) > > @@ -26,8 +26,6 @@ > > #ifndef _SYS_ACL_IMPL_H > > #define _SYS_ACL_IMPL_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #ifdef __cplusplus > > extern "C" { > > #endif > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed > Aug 26 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Wed > Aug 26 07:29:17 2020 (r364806) > > @@ -31,8 +31,6 @@ > > #ifndef _SYS_CMN_ERR_H > > #define _SYS_CMN_ERR_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #if !defined(_ASM) > > #include > > #endif > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed > Aug 26 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/extdirent.h Wed > Aug 26 07:29:17 2020 (r364806) > > @@ -26,8 +26,6 @@ > > #ifndef _SYS_EXTDIRENT_H > > #define _SYS_EXTDIRENT_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #ifdef __cplusplus > > extern "C" { > > #endif > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 > 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list.h Wed Aug 26 > 07:29:17 2020 (r364806) > > @@ -26,8 +26,6 @@ > > #ifndef _SYS_LIST_H > > #define _SYS_LIST_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #include > > > > #ifdef __cplusplus > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed > Aug 26 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/list_impl.h Wed > Aug 26 07:29:17 2020 (r364806) > > @@ -27,8 +27,6 @@ > > #ifndef _SYS_LIST_IMPL_H > > #define _SYS_LIST_IMPL_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #include > > > > #ifdef __cplusplus > > > > Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h > > =========================================================================== > === > > --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 > 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/zmod.h Wed Aug 26 > 07:29:17 2020 (r364806) > > @@ -27,8 +27,6 @@ > > #ifndef _ZMOD_H > > #define _ZMOD_H > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > #ifdef __cplusplus > > extern "C" { > > #endif > > > > Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/list.c > > =========================================================================== > === > > --- head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 > 07:00:07 2020 (r364805) > > +++ head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Wed Aug 26 > 07:29:17 2020 (r364806) > > @@ -23,8 +23,6 @@ > > * Use is subject to license terms. > > */ > > > > -#pragma ident "%Z%%M% %I% %E% SMI" > > - > > /* > > * Generic doubly-linked list implementation > > */ > From owner-svn-src-head@freebsd.org Wed Aug 26 17:33:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97AB73B5C04; Wed, 26 Aug 2020 17:33:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcCcm3b6Dz4NKM; Wed, 26 Aug 2020 17:33:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:9808:df28:c1f9:5a05]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id C1AC822515; Wed, 26 Aug 2020 17:33:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364806 - in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl To: Matthew Macy , Toomas Soome Cc: src-committers , svn-src-all , svn-src-head References: <202008260729.07Q7THlo023745@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 26 Aug 2020 10:33:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:33:12 -0000 On 8/26/20 10:15 AM, Matthew Macy wrote: > Do not commit directly to sys/contrib. PR, vendor branch update, then merge. We do live in a world where source control is able to merge changes, and it should be ok in that world to commit things directly while waiting for the PR to be merged and letting the VCS figure it out on the next merge. We haven't had a policy of never comitting directly to contrib/ since the CVS days. I do agree that changes should be pushed upstream to keep local diffs as small as possible, but reasonable judgement should be applied rather than a hard rule banning all commits. > On Wed, Aug 26, 2020 at 12:29 AM Toomas Soome wrote: >> >> Author: tsoome >> Date: Wed Aug 26 07:29:17 2020 >> New Revision: 364806 >> URL: https://svnweb.freebsd.org/changeset/base/364806 >> >> Log: >> remove pragma ident lines >> >> The #pragma ident is historical relict and not needed any more, this >> pragma is actually unknown for common compilers and is only causing >> trouble. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Aug 26 17:43:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D6FF3B5B7A for ; Wed, 26 Aug 2020 17:43:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcCrM2ctKz4Nwf for ; Wed, 26 Aug 2020 17:43:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id y65so2102074qtd.2 for ; Wed, 26 Aug 2020 10:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nYj00C9aJusmZUGmz76zRC062/e0NWALNx/+WIV0dH8=; b=q0Q9D8ieSywwbmzaJAvAwiXH/xFUykGjmLuSY23+lV1qXRYSSmdhkk0qmljj0Ikys4 Bryi6ew1KquzF8rN7+hrBlJM+GlBM2dODl4bVsCG1h8wmvVcmzkwbyW2pSisuumiNLYO GxvOu1qLF3HkUU4U2onPyt+21WyTyLq3GDK9GC1mZXZKEFLuNr8IJlegbKNy0e0e5+5T spnDmxN6l//pBOXNtQLhTrekjeF9f0xkZpC8KhhlOpf/snEoft+fZ18zp126mp02YeFw Xfbx5tDIFutNdMNFWUl+lmLVdoNVwgXXz+sq0N7g6dcP+yn5gji3UEGH47pk0z+ElIK5 SBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nYj00C9aJusmZUGmz76zRC062/e0NWALNx/+WIV0dH8=; b=nqbvent1wOcsghmaCLaoX/i3JFR8/zhVe11O05BqCC8ebJ8s9GfJn6k3Uzy+N06hWf TZdZDogFEosurxV0B62DkdM/LhabEqNfH8FCWFuIsqVUIj/f5VZv0acKtptNNfcd6qPk jODeH61BVGaQdPqOdTY/mIkYza/rPSCrpz8pDhNPDB0EEM40IKS7yEFooTQ7wP+X0xGP UsV/DUfr4SBNUA9BXUH2dMVmmZVBKb3k31LdSMqqO1Kk2GFQcvSf1Ewm36mzgE47+bDR aOsc6vmKwrOusVgHS7i4LNSMkY1CPCR8SAnDIo1xIBTndGwl5uV9Leblz3Yru2+Q/BBn AMOA== X-Gm-Message-State: AOAM533ZYnUWd/ueSybphoGOYRj701Cf4n+QgBMA7lgNIGuNb+tyZyRL iD8f6w4ltrHf1/lhqoW0eQS81n7auFKvrQCYE2brxg== X-Google-Smtp-Source: ABdhPJze8RErX6356bKse+0pPgXKq/MeEqOFgLuF+iVz+XKdKIgAt0Oslu2cuG7UB2h4Y+NiAbDB65KAzuawndBOk1o= X-Received: by 2002:ac8:4719:: with SMTP id f25mr15420642qtp.291.1598463793981; Wed, 26 Aug 2020 10:43:13 -0700 (PDT) MIME-Version: 1.0 References: <202008260729.07Q7THlo023745@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 26 Aug 2020 11:43:03 -0600 Message-ID: Subject: Re: svn commit: r364806 - in head/sys/contrib/openzfs: include/os/freebsd/spl/sys module/os/freebsd/spl To: John Baldwin Cc: Matthew Macy , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BcCrM2ctKz4Nwf X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=q0Q9D8ie; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::830) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.44 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.74)[-0.737]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-0.10)[-0.100]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::830:from]; NEURAL_SPAM_SHORT(0.40)[0.397]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; DMARC_NA(0.00)[bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:43:16 -0000 On Wed, Aug 26, 2020 at 11:33 AM John Baldwin wrote: > On 8/26/20 10:15 AM, Matthew Macy wrote: > > Do not commit directly to sys/contrib. PR, vendor branch update, then > merge. > > We do live in a world where source control is able to merge changes, and > it should be ok in that world to commit things directly while waiting for > the PR to be merged and letting the VCS figure it out on the next merge. > We haven't had a policy of never comitting directly to contrib/ since the > CVS days. I do agree that changes should be pushed upstream to keep local > diffs as small as possible, but reasonable judgement should be applied > rather than a hard rule banning all commits. > Matt's wording sucked. However, he's requesting that people push changes upstream for the moment to help him manage because he's planning on doing several more vendor imports in the coming days and these commits lead to conflicts which slow him down. It's not a hard lock, but a very strong request to make his life easier while the velocity upstream is still kinda fast and we need to loop in many of those changes in. Warner > > On Wed, Aug 26, 2020 at 12:29 AM Toomas Soome > wrote: > >> > >> Author: tsoome > >> Date: Wed Aug 26 07:29:17 2020 > >> New Revision: 364806 > >> URL: https://svnweb.freebsd.org/changeset/base/364806 > >> > >> Log: > >> remove pragma ident lines > >> > >> The #pragma ident is historical relict and not needed any more, this > >> pragma is actually unknown for common compilers and is only causing > >> trouble. > > -- > John Baldwin > From owner-svn-src-head@freebsd.org Wed Aug 26 17:52:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5E5C3B6528; Wed, 26 Aug 2020 17:52:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcD345NgLz4PRW; Wed, 26 Aug 2020 17:52:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C9C716F1E; Wed, 26 Aug 2020 17:52:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QHqWM0037818; Wed, 26 Aug 2020 17:52:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QHqWuD037817; Wed, 26 Aug 2020 17:52:32 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008261752.07QHqWuD037817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 26 Aug 2020 17:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364827 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 364827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 17:52:32 -0000 Author: tsoome Date: Wed Aug 26 17:52:32 2020 New Revision: 364827 URL: https://svnweb.freebsd.org/changeset/base/364827 Log: libsa: only skein_block.c is using SKEIN_LOOP Only use SKEIN_LOOP while compiling skein_block.c Modified: head/stand/libsa/zfs/Makefile.inc Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Wed Aug 26 17:15:17 2020 (r364826) +++ head/stand/libsa/zfs/Makefile.inc Wed Aug 26 17:52:32 2020 (r364827) @@ -2,8 +2,6 @@ .PATH: ${ZFSSRC} SRCS+= zfs.c nvlist.c skein.c skein_block.c list.c -# Do not unroll skein loops, reduce code size -CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os @@ -12,6 +10,8 @@ CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SYSDIR}/crypto/skein +# Do not unroll skein loops, reduce code size +CFLAGS.skein_block.c+= -DSKEIN_LOOP=111 CFLAGS.zfs.c+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS+= -Wformat -Wall From owner-svn-src-head@freebsd.org Wed Aug 26 18:34:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DB773B7CB2; Wed, 26 Aug 2020 18:34:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcDz02m46z4S3T; Wed, 26 Aug 2020 18:34:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 28AF62319D; Wed, 26 Aug 2020 18:34:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::9d13:595a:4fbd:9b05] (unknown [IPv6:2001:470:7a58:0:9d13:595a:4fbd:9b05]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0FE7F63D10; Wed, 26 Aug 2020 20:34:02 +0200 (CEST) From: Dimitry Andric Message-Id: <0FAD8A61-49D2-4419-8744-1BAE6DA9C6C2@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_9A17FF09-2CB2-4A7B-B329-1371FDB9E3E6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm Date: Wed, 26 Aug 2020 20:33:54 +0200 In-Reply-To: <7f1149b6e8dfd1600ff235b7b1aaae3b746b4a9f.camel@freebsd.org> Cc: Mateusz Guzik , Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <202008261655.07QGtSZx096979@repo.freebsd.org> <7f1149b6e8dfd1600ff235b7b1aaae3b746b4a9f.camel@freebsd.org> X-Mailer: Apple Mail (2.3445.104.15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 18:34:04 -0000 --Apple-Mail=_9A17FF09-2CB2-4A7B-B329-1371FDB9E3E6 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 26 Aug 2020, at 19:13, Ian Lepore wrote: > > On Wed, 2020-08-26 at 19:04 +0200, Mateusz Guzik wrote: >> On 8/26/20, Jung-uk Kim wrote: >>> Author: jkim >>> Date: Wed Aug 26 16:55:28 2020 >>> New Revision: 364822 >>> URL: https://svnweb.freebsd.org/changeset/base/364822 >>> >>> Log: >>> Fix Clang version detection. >>> >>> We prepend "FreeBSD" to Clang version string. This broke >>> compiler test >>> for >>> AVX instruction support. >>> >> >> What about other software checking in similar fashion? imo the right >> fix is to stop mucking with the way clang reports itself >> > > Maybe it would be better to not modify the start of the string. > Instead of > > FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git > c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) > > maybe > > clang version 9.0.1 for FreeBSD (git@github.com:llvm/llvm-project.git > c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) We have been doing this since, well, forever. And this way actually originates from upstream, we only define the CLANG_VENDOR macro. I see no reason to change this after all those years. A better question is, why these perl scripts "suddenly" started failing? Or have they also failed since forever, and it was only noticed now? -Dimitry --Apple-Mail=_9A17FF09-2CB2-4A7B-B329-1371FDB9E3E6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCX0arEgAKCRCwXqMKLiCW o/9VAKCT6F/WSyi7cwXeJ7uGzED/1l8IQACfUWGC62pRYVUNKPMJBllgLLV4IO4= =1GGW -----END PGP SIGNATURE----- --Apple-Mail=_9A17FF09-2CB2-4A7B-B329-1371FDB9E3E6-- From owner-svn-src-head@freebsd.org Wed Aug 26 18:35:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 887BD3B810B; Wed, 26 Aug 2020 18:35:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcF0j36tfz4SQs; Wed, 26 Aug 2020 18:35:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E90B1715A; Wed, 26 Aug 2020 18:35:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QIZXjo063948; Wed, 26 Aug 2020 18:35:33 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QIZXOd063947; Wed, 26 Aug 2020 18:35:33 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <202008261835.07QIZXOd063947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 26 Aug 2020 18:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364828 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 364828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 18:35:33 -0000 Author: jamie Date: Wed Aug 26 18:35:32 2020 New Revision: 364828 URL: https://svnweb.freebsd.org/changeset/base/364828 Log: Back out r364791 to unbreak jails. Lesson learned: "compile and test" means running the test on the same executable that you just compiled. PR: 248444 Pointy hat to: jamie Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Wed Aug 26 17:52:32 2020 (r364827) +++ head/usr.sbin/jail/config.c Wed Aug 26 18:35:32 2020 (r364828) @@ -393,8 +393,7 @@ add_param(struct cfjail *j, const struct cfparam *p, e else for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) if (!(intparams[ipnum].flags & PF_CONV) && - equalopts(name, intparams[ipnum].name) && - !(p->flags & PF_VAR)) { + equalopts(name, intparams[ipnum].name)) { j->intparams[ipnum] = np; np->flags |= intparams[ipnum].flags; break; From owner-svn-src-head@freebsd.org Wed Aug 26 18:42:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEB373B828F for ; Wed, 26 Aug 2020 18:42:54 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcF995JZbz4SgZ for ; Wed, 26 Aug 2020 18:42:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f68.google.com with SMTP id c15so2842430wrs.11 for ; Wed, 26 Aug 2020 11:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ncPjS7Jp5+JkNRTaEKC5JWpThjx5Kr4F44UN5FhtyKI=; b=GvJoCyi+oz250TrpEd8wiotgPO8HK3t8/4t+JlY8lmqwbv5nKoOZHN/Opfra7jbRKf Tgdl/6XwtDqVyRuwk4caPZKyPWs+/gGRCr0v2KBTSGm2yEV9S+vrpzYNMFcxgqU57HiU CfZNN4jLgewxK6iyv6cUdVIQ7C08DtwgtV5U0NnixZn7xsuxAb3qMJEUB7m13q8BiHAy N32IkE+8wY4+6EZTjO/0xuV22WkSY/ATgyhm5HNO1FCPRQUkYUmzLZH7hfejVjgwOLSN G23tJwAraUQEYchTXOtk6nvZ/KkoTBmLvzX1tLJFFL49IEl/t4WJSVmy/+9Vr/LIHzG8 w2Fw== X-Gm-Message-State: AOAM530siflqEqrcz/6/BDG/0WmomDe8f2WxQTE2dnZGCUgsHs4iaR+9 DG4BR3duhvQ/gNy6d/olv6HDBg== X-Google-Smtp-Source: ABdhPJwSLvakhc8kfYTY9x8rn4apHJ1X4GNvv0BRs7nDvWLiq362PQyAs5gm3P860u40auPZi95ABQ== X-Received: by 2002:adf:8504:: with SMTP id 4mr12088080wrh.289.1598467372227; Wed, 26 Aug 2020 11:42:52 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id b8sm8343372wrx.76.2020.08.26.11.42.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 11:42:51 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm From: Jessica Clarke In-Reply-To: <0FAD8A61-49D2-4419-8744-1BAE6DA9C6C2@FreeBSD.org> Date: Wed, 26 Aug 2020 19:42:50 +0100 Cc: Ian Lepore , Mateusz Guzik , Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <187C5112-6E19-4155-9226-FD23BA03ABA9@freebsd.org> References: <202008261655.07QGtSZx096979@repo.freebsd.org> <7f1149b6e8dfd1600ff235b7b1aaae3b746b4a9f.camel@freebsd.org> <0FAD8A61-49D2-4419-8744-1BAE6DA9C6C2@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BcF995JZbz4SgZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.29)[-0.289]; RCPT_COUNT_SEVEN(0.00)[7]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.90)[-0.904]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.79)[-0.793]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.68:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.68:from]; FREEMAIL_CC(0.00)[FreeBSD.org,gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 18:42:54 -0000 On 26 Aug 2020, at 19:33, Dimitry Andric wrote: > > On 26 Aug 2020, at 19:13, Ian Lepore wrote: >> >> On Wed, 2020-08-26 at 19:04 +0200, Mateusz Guzik wrote: >>> On 8/26/20, Jung-uk Kim wrote: >>>> Author: jkim >>>> Date: Wed Aug 26 16:55:28 2020 >>>> New Revision: 364822 >>>> URL: https://svnweb.freebsd.org/changeset/base/364822 >>>> >>>> Log: >>>> Fix Clang version detection. >>>> >>>> We prepend "FreeBSD" to Clang version string. This broke >>>> compiler test >>>> for >>>> AVX instruction support. >>>> >>> >>> What about other software checking in similar fashion? imo the right >>> fix is to stop mucking with the way clang reports itself >>> >> >> Maybe it would be better to not modify the start of the string. >> Instead of >> >> FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git >> c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) >> >> maybe >> >> clang version 9.0.1 for FreeBSD (git@github.com:llvm/llvm-project.git >> c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) > > We have been doing this since, well, forever. And this way actually > originates from upstream, we only define the CLANG_VENDOR macro. I see > no reason to change this after all those years. > > A better question is, why these perl scripts "suddenly" started failing? > Or have they also failed since forever, and it was only noticed now? Ah, digging deeper it gets more interesting. All those scripts check for "based on LLVM X.Y", a suffix printed for vendor builds. However, that was dropped in https://reviews.llvm.org/D69925 as it's redundant, thereby breaking this detection. So it's fallout from LLVM 10. Also the scripts aren't failing in a sense, they just don't know what compiler is in use so they fall back on not enabling AVX. Jess From owner-svn-src-head@freebsd.org Wed Aug 26 18:55:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E79003B8265; Wed, 26 Aug 2020 18:55:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcFSH5p9hz4T8C; Wed, 26 Aug 2020 18:55:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 91CF6227DA; Wed, 26 Aug 2020 18:55:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm To: Jessica Clarke , Dimitry Andric Cc: Ian Lepore , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008261655.07QGtSZx096979@repo.freebsd.org> <7f1149b6e8dfd1600ff235b7b1aaae3b746b4a9f.camel@freebsd.org> <0FAD8A61-49D2-4419-8744-1BAE6DA9C6C2@FreeBSD.org> <187C5112-6E19-4155-9226-FD23BA03ABA9@freebsd.org> From: Jung-uk Kim Autocrypt: addr=jkim@FreeBSD.org; keydata= mQENBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7JkUdSvQR0 fA59RfTTECMwTrSEfYGUnxIDBraxJ7Ecs/0hGQ7sljIj8WBvlRDU5fU1xfF35aw56T8POQRq F4E6RVJW3YGuTpSwgtGZOTfygcLRhAiq3dFC3JNLaTVTpM8PjOinJyt9AU6RoITGOKwDABEB AAG0Hkp1bmctdWsgS2ltIDxqa2ltQEZyZWVCU0Qub3JnPokBPQQTAQoAJwUCUkHO1QIbAwUJ E0/POwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRB8n5Ym/NvxRqyzB/wL7QtsIpeGfGIA ZPMtgXMucM3NWzomyQMln2j2efUkDKthzh9jBxgF53TjOr7imwIt0PT2k1bqctPrq5IRqnu9 mGroqaCLE3LG2/E3jEaao4k9PO6efwlioyivUo5NrqIQOQ4k3EAXw7d2y0Dk1VpTgdMrnUAB hj7lGlLqS4ydcrf24DdbCRGdEQwqd9DBeBgbWynxAJMgbZBhYVEyIHuQKkJ8qY0ibIPXXuF0 KYDeH0qUHtWV2K3srNyPtymUkBQD84Pl1GWRYx05XdUHDmnX0JV3lg0BfYJZgZv0ehPQrMfY Fd9abTkf9FHQYz1JtsC8wUuRgqElRd6+YAGf8Tt9uQENBFJBztUBCADLtSrP44El2VoJmH14 OFrlOgxzZnbn+Y/Gf1k12mJBiR+A+pBeRLD50p7AiTrjHRxO3cHcl9Dh0uf1VSbXgp8Or0ye iP/86fZPd4k5HXNmDTLL0HecPE08SCqGZ0W8vllQrokB1QxxRUB+fFMPJyMCjDAZ7P9fFTOS dTw1bJSTtOD8Sx8MpZUa9ti06bXFlVYDlaqSdgk181SSx+ZbSKkQR8CIMARlHwiLsa3Z9q9O EJr20HPyxe0AlTvwvFndH61hg7ds63eRvglwRnNON28VXO/lvKXq7Br/CiiyhFdKfINIx2Z5 htYq22tgGTW7mBURbIKoECFBTX9Lv6BXz6w9ABEBAAGJASUEGAEKAA8FAlJBztUCGwwFCRNP zzsACgkQfJ+WJvzb8UZcJQf+IsTCxUEqY7W/pT84sMg5/QD3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Organization: FreeBSD.org Message-ID: <7e156551-1776-ca81-5608-aad10ff7c2de@FreeBSD.org> Date: Wed, 26 Aug 2020 14:55:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <187C5112-6E19-4155-9226-FD23BA03ABA9@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 18:56:00 -0000 On 20. 8. 26., Jessica Clarke wrote: > On 26 Aug 2020, at 19:33, Dimitry Andric wrote: >> >> On 26 Aug 2020, at 19:13, Ian Lepore wrote: >>> >>> On Wed, 2020-08-26 at 19:04 +0200, Mateusz Guzik wrote: >>>> On 8/26/20, Jung-uk Kim wrote: >>>>> Author: jkim >>>>> Date: Wed Aug 26 16:55:28 2020 >>>>> New Revision: 364822 >>>>> URL: https://svnweb.freebsd.org/changeset/base/364822 >>>>> >>>>> Log: >>>>> Fix Clang version detection. >>>>> >>>>> We prepend "FreeBSD" to Clang version string. This broke >>>>> compiler test >>>>> for >>>>> AVX instruction support. >>>>> >>>> >>>> What about other software checking in similar fashion? imo the right >>>> fix is to stop mucking with the way clang reports itself >>>> >>> >>> Maybe it would be better to not modify the start of the string. >>> Instead of >>> >>> FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git >>> c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) >>> >>> maybe >>> >>> clang version 9.0.1 for FreeBSD (git@github.com:llvm/llvm-project.git >>> c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) >> >> We have been doing this since, well, forever. And this way actually >> originates from upstream, we only define the CLANG_VENDOR macro. I see >> no reason to change this after all those years. >> >> A better question is, why these perl scripts "suddenly" started failing? >> Or have they also failed since forever, and it was only noticed now? > > Ah, digging deeper it gets more interesting. All those scripts check > for "based on LLVM X.Y", a suffix printed for vendor builds. However, > that was dropped in https://reviews.llvm.org/D69925 as it's redundant, > thereby breaking this detection. So it's fallout from LLVM 10. Yes, that's correct. BTW, they also changed "-dumpversion" format from Clang 9. % clang80 -dumpversion 4.2.1 % clang90 -dumpversion 9.0.1 Since some do not check whether you are using Clang or GCC, some scripts may think you are using GCC 9 or newer. > Also the scripts aren't failing in a sense, they just don't know what > compiler is in use so they fall back on not enabling AVX. Also, correct. Jung-uk Kim From owner-svn-src-head@freebsd.org Wed Aug 26 19:00:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F2033B86C3; Wed, 26 Aug 2020 19:00:18 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcFYG0RBYz4TZF; Wed, 26 Aug 2020 19:00:18 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCFC717B22; Wed, 26 Aug 2020 19:00:17 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJ0HCm078930; Wed, 26 Aug 2020 19:00:17 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJ0HIk078929; Wed, 26 Aug 2020 19:00:17 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008261900.07QJ0HIk078929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Wed, 26 Aug 2020 19:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364829 - head/cddl/lib/libzpool X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/cddl/lib/libzpool X-SVN-Commit-Revision: 364829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:00:18 -0000 Author: freqlabs Date: Wed Aug 26 19:00:17 2020 New Revision: 364829 URL: https://svnweb.freebsd.org/changeset/base/364829 Log: Tidy up libzpool Makefile Sponsored by: iXsystems, Inc. Modified: head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Wed Aug 26 18:35:32 2020 (r364828) +++ head/cddl/lib/libzpool/Makefile Wed Aug 26 19:00:17 2020 (r364829) @@ -1,16 +1,17 @@ # $FreeBSD$ +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs # ZFS_COMMON_SRCS -.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs -.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon -.PATH: ${SRCTOP}/sys/contrib/openzfs/module/unicode +.PATH: ${ZFSTOP}/module/zfs +.PATH: ${ZFSTOP}/module/zcommon +.PATH: ${ZFSTOP}/module/unicode # LUA_SRCS -.PATH: ${SRCTOP}/sys/contrib/openzfs/module/lua +.PATH: ${ZFSTOP}/module/lua -.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/linux/zfs +.PATH: ${ZFSTOP}/module/os/linux/zfs -.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzpool +.PATH: ${ZFSTOP}/lib/libzpool .if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} @@ -28,8 +29,6 @@ PICFLAG= -fPIC LIB= zpool - - USER_C = \ kernel.c \ taskq.c \ @@ -218,19 +217,19 @@ UNICODE_C = u8_textprep.c uconv.c SRCS= ${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C} WARNS?= 2 -CFLAGS+= -DIN_BASE -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys -CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include -CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID -CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h -CFLAGS+= -I${SRCTOP}/sys/modules/zfs -CFLAGS+= -DLIB_ZPOOL_BUILD -DZFS_DEBUG - +CFLAGS+= \ + -DIN_BASE \ + -I${ZFSTOP}/include \ + -I${ZFSTOP}/lib/libspl/include \ + -I${ZFSTOP}/lib/libspl/include/os/freebsd \ + -I${SRCTOP}/sys \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ + -I${ZFSTOP}/module/icp/include \ + -include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \ + -DHAVE_ISSETUGID \ + -include ${SRCTOP}/sys/modules/zfs/zfs_config.h \ + -I${SRCTOP}/sys/modules/zfs \ + -DLIB_ZPOOL_BUILD -DZFS_DEBUG \ # XXX: pthread doesn't have mutex_owned() equivalent, so we need to look # into libthr private structures. That's sooo evil, but it's only for From owner-svn-src-head@freebsd.org Wed Aug 26 19:03:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C84143B8951; Wed, 26 Aug 2020 19:03:16 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcFch4xcVz4TtY; Wed, 26 Aug 2020 19:03:16 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E14617AB4; Wed, 26 Aug 2020 19:03:16 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJ3Gvl085213; Wed, 26 Aug 2020 19:03:16 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJ3GdU085211; Wed, 26 Aug 2020 19:03:16 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008261903.07QJ3GdU085211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Wed, 26 Aug 2020 19:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364830 - in head/cddl/lib: libzfs libzpool X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/cddl/lib: libzfs libzpool X-SVN-Commit-Revision: 364830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:03:16 -0000 Author: freqlabs Date: Wed Aug 26 19:03:15 2020 New Revision: 364830 URL: https://svnweb.freebsd.org/changeset/base/364830 Log: Move zstd sources from libzfs to libzpool zstd is kernel code that was not supposed to be in libzfs. libzpool provides userland shims for kernel code and is where the zstd code needs to be included. Reported by: John Kennedy Discussed with: mmacy Sponsored by: iXsystems, Inc. Modified: head/cddl/lib/libzfs/Makefile head/cddl/lib/libzpool/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Wed Aug 26 19:00:17 2020 (r364829) +++ head/cddl/lib/libzfs/Makefile Wed Aug 26 19:03:15 2020 (r364830) @@ -58,10 +58,6 @@ KERNEL_C = \ zprop_common.c -KERNEL_C+= zstd.c \ - zfs_zstd.c - - ARCH_C = .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" ARCH_C += zfs_fletcher_intel.c \ @@ -94,8 +90,6 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/in CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h -CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith -CFLAGS.zstd.c= -fno-tree-vectorize .include Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Wed Aug 26 19:00:17 2020 (r364829) +++ head/cddl/lib/libzpool/Makefile Wed Aug 26 19:03:15 2020 (r364830) @@ -8,6 +8,9 @@ ZFSTOP= ${SRCTOP}/sys/contrib/openzfs .PATH: ${ZFSTOP}/module/unicode # LUA_SRCS .PATH: ${ZFSTOP}/module/lua +# ZSTD_SRCS +.PATH: ${ZFSTOP}/module/zstd +.PATH: ${ZFSTOP}/module/zstd/lib .PATH: ${ZFSTOP}/module/os/linux/zfs @@ -44,6 +47,7 @@ KERNEL_C = \ zfs_namecheck.c \ zfs_prop.c \ zfs_uio.c \ + zfs_zstd.c \ zpool_prop.c \ zprop_common.c \ abd.c \ @@ -167,6 +171,7 @@ KERNEL_C = \ zio_inject.c \ zle.c \ zrlock.c \ + zstd.c \ zthr.c ARCH_C = @@ -251,5 +256,8 @@ CSTD= c99 # it without debugging. CFLAGS+= -g -DDEBUG=1 + +CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zstd.c+= -fno-tree-vectorize .include From owner-svn-src-head@freebsd.org Wed Aug 26 19:16:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 687EE3B8EE0; Wed, 26 Aug 2020 19:16:40 +0000 (UTC) (envelope-from bdragon@imap.cc) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcFw80KJGz4VYb; Wed, 26 Aug 2020 19:16:39 +0000 (UTC) (envelope-from bdragon@imap.cc) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2C17E15DF; Wed, 26 Aug 2020 15:16:37 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Wed, 26 Aug 2020 15:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imap.cc; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=mikaS6Z/bflaiO+AZk7v6Qag7H1eVbV vACMvXnjjykA=; b=lJcf2reZpZv+c2TrVl7HT/Oxy+XhZJAFcPzUS7cD3krLB1H XGZGj0bDmyGFeSP0dwW4+RQeuey1BYcN/unY0tTbjITcfkVd1VgWrAGiyrtnTvWy yfg9P9lbaWbaCkz/RNPHQDjFLYASVrlB1nodo5SWOArfA4YkxBT6e941wHihmjok yKJh9mFX4p+d695r3CzggLhNFAJG39Lf37WJyXYsSjVVEZ8v0KQ+OGoqi9TZAVdk FzU2kjh1lwYpz9fu0RqYp4RQ2/cvlbQyxKho005MDDUVMymNuqOAmxYY8cV1Jt9U +6TP+K0jkqLZ1o52kyNDCKbej7O0K0ltYan8ceA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mikaS6 Z/bflaiO+AZk7v6Qag7H1eVbVvACMvXnjjykA=; b=tbPZ6rRtfsJEuDsjuiqikT Ox1G0rOxjFDEC9KBT4n44AV6L28cDb82apPH3eTjQnczz4q2OReWP4l/QhywzDIW Dc00+jAkepUG+8rwucwVyi8Ob/2dNV9oFZ8PrHOsqePKqG4p7bASWzKpuwI+z+RW Cnk+VfqK8oxIHMtGQYpG68Yh5grU3jVJdsCC3FvKScifLVoHI1pBA51x3O5zpHjj n4a3dc+UwpBOdGPB9jn091dXYVBH2Af2ZFmUOO49w+YaqqxOsOGDaAlQUCRGcjdu MAQLoMkjxqVRJd0DFr6/pzDjWcE7k4gkd9qSNoDWtKCUivuMlJzdAQJ2l3FDmIbA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsehimhgrphdrtggtqeenucggtffrrghtthgvrhhnpefgffeiieehudfgfffhheejteef keeuvdeggfejhffhhfeihfefjeeltdeijeejffenucffohhmrghinhepfhhrvggvsghsug drohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pegsughrrghgohhnsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 02CF3C200A5; Wed, 26 Aug 2020 15:16:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> In-Reply-To: <202008260237.07Q2bhwF045988@repo.freebsd.org> References: <202008260237.07Q2bhwF045988@repo.freebsd.org> Date: Wed, 26 Aug 2020 14:16:15 -0500 From: "Brandon Bergren" To: "Alan Somers" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r364799_-_in_head:_share/man/man9_sys/crypto/c?= =?UTF-8?Q?cp_sys/dev/cxgbe/crypto_sys/dev/sec_sys/kern_sys/opencrypto?= Content-Type: text/plain X-Rspamd-Queue-Id: 4BcFw80KJGz4VYb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:16:40 -0000 On Tue, Aug 25, 2020, at 9:37 PM, Alan Somers wrote: > Author: asomers > Date: Wed Aug 26 02:37:42 2020 > New Revision: 364799 > URL: https://svnweb.freebsd.org/changeset/base/364799 > > Modified: head/sys/dev/sec/sec.c > ============================================================================== > --- head/sys/dev/sec/sec.c Wed Aug 26 02:13:27 2020 (r364798) > +++ head/sys/dev/sec/sec.c Wed Aug 26 02:37:42 2020 (r364799) > @@ -851,6 +851,9 @@ sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_ > case CRYPTO_BUF_MBUF: > size = m_length(crp->crp_buf.cb_mbuf, NULL); > break; > + case CRYPTO_BUF_VMPAGE: > + size = PAGE_SIZE - cb->cb_vm_page_offset; > + break; > default: > return (EINVAL); > } Uh, where is cb coming from? Shouldn't this be using crp->crp_buf.cb_vm_page_offset? This is causing a build failure on powerpc and powerpcspe. I don't see why other platforms aren't also erroring out here. From owner-svn-src-head@freebsd.org Wed Aug 26 19:19:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 697703B92CE for ; Wed, 26 Aug 2020 19:19:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcFzJ6436z4W0q for ; Wed, 26 Aug 2020 19:19:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f68.google.com with SMTP id f7so2980156wrw.1 for ; Wed, 26 Aug 2020 12:19:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yDfpRmB3yHyU7x3XNaNjEyQwQkhsYlT4d03gzG2A10E=; b=ZzSVNVNeV+ifrkntBTUT6uoC+Ujrttcj5u60Asz+FUaINXEor5PIYF+ZTH0irM5wXz y0XpH+CAvA5p5I4v3FB6cbzN0qp3P90If/qa9P1PM0C7g9oo64CsKRaQFUJEbFJtbnaL imtdJ4pNGu40eArxz7ezS+CmQZYl/VIoeSOVRNM7ri5YiZwJwJGgalvLDqizB63h0NHp ptgLaQhS24l4YPBpn+bsaOLONiQYwVSdUqtsEVHBm9GbL+6ChCXEQIL5BRwS/HAnc9E4 HFslZb+MrC1GGVUxJexcnaV6/4fzEL+gX/zqN96uv2LaRU6KyBg3S0R5dC4M9adWWseL XWNw== X-Gm-Message-State: AOAM530Plva9QhEF8H/a6aAWuXxkOdt41wv677b9TVtkkCOg1j25mYeV AvTDaICuZSTaGa1EPBx3yGupeOXFY1/ydw== X-Google-Smtp-Source: ABdhPJznz2B+7Q29lEMmwYZLqxcIsOe7YkvXkWykaWVSU1o0z+bOjEoQmXTApcenxXunegdfVvBYoQ== X-Received: by 2002:a5d:684b:: with SMTP id o11mr17735355wrw.101.1598469563309; Wed, 26 Aug 2020 12:19:23 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id g16sm8960067wrs.88.2020.08.26.12.19.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 12:19:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto From: Jessica Clarke In-Reply-To: <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> Date: Wed, 26 Aug 2020 20:19:21 +0100 Cc: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> To: Brandon Bergren X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BcFzJ6436z4W0q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-0.93 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_TO(0.00)[imap.cc]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.82)[-0.821]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.26)[0.262]; NEURAL_HAM_LONG(-0.87)[-0.867]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.68:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.68:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:19:25 -0000 On 26 Aug 2020, at 20:16, Brandon Bergren wrote: > On Tue, Aug 25, 2020, at 9:37 PM, Alan Somers wrote: >> Author: asomers >> Date: Wed Aug 26 02:37:42 2020 >> New Revision: 364799 >> URL: https://svnweb.freebsd.org/changeset/base/364799 >>=20 >> Modified: head/sys/dev/sec/sec.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/sec/sec.c Wed Aug 26 02:13:27 2020 = (r364798) >> +++ head/sys/dev/sec/sec.c Wed Aug 26 02:37:42 2020 = (r364799) >> @@ -851,6 +851,9 @@ sec_desc_map_dma(struct sec_softc *sc, struct = sec_dma_ >> case CRYPTO_BUF_MBUF: >> size =3D m_length(crp->crp_buf.cb_mbuf, NULL); >> break; >> + case CRYPTO_BUF_VMPAGE: >> + size =3D PAGE_SIZE - cb->cb_vm_page_offset; >> + break; >> default: >> return (EINVAL); >> } >=20 > Uh, where is cb coming from? Shouldn't this be using = crp->crp_buf.cb_vm_page_offset? This is causing a build failure on = powerpc and powerpcspe. I don't see why other platforms aren't also = erroring out here. Because it's PowerPC-specific: sys/conf/files.powerpc:dev/sec/sec.c optional sec mpc85xx Jess From owner-svn-src-head@freebsd.org Wed Aug 26 19:21:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0CE83B91F2; Wed, 26 Aug 2020 19:21:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG224m9wz4WJ0; Wed, 26 Aug 2020 19:21:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8201622EEB; Wed, 26 Aug 2020 19:21:46 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 53E6127C0054; Wed, 26 Aug 2020 15:21:46 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Wed, 26 Aug 2020 15:21:46 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeehieeikeekffekleek leegtefgledttefghfduteeikeevfedvhfeggfffudejgfenucffohhmrghinhepfhhrvg gvsghsugdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegsughrrghgohhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqd dutdegvdefheekieegqddukedutdekheduqdgsughrrghgohhnpeephfhrvggvuefuffdr ohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C4E11C200A5; Wed, 26 Aug 2020 15:21:45 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: In-Reply-To: <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> Date: Wed, 26 Aug 2020 14:21:24 -0500 From: "Brandon Bergren" To: "Jessica Clarke" Cc: "Alan Somers" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r364799_-_in_head:_share/man/man9_sys/crypto/c?= =?UTF-8?Q?cp_sys/dev/cxgbe/crypto_sys/dev/sec_sys/kern_sys/opencrypto?= Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:21:46 -0000 On Wed, Aug 26, 2020, at 2:19 PM, Jessica Clarke wrote: > On 26 Aug 2020, at 20:16, Brandon Bergren wrote: > > On Tue, Aug 25, 2020, at 9:37 PM, Alan Somers wrote: > >> Author: asomers > >> Date: Wed Aug 26 02:37:42 2020 > >> New Revision: 364799 > >> URL: https://svnweb.freebsd.org/changeset/base/364799 > >> > >> Modified: head/sys/dev/sec/sec.c > >> ============================================================================== > >> --- head/sys/dev/sec/sec.c Wed Aug 26 02:13:27 2020 (r364798) > >> +++ head/sys/dev/sec/sec.c Wed Aug 26 02:37:42 2020 (r364799) > >> @@ -851,6 +851,9 @@ sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_ > >> case CRYPTO_BUF_MBUF: > >> size = m_length(crp->crp_buf.cb_mbuf, NULL); > >> break; > >> + case CRYPTO_BUF_VMPAGE: > >> + size = PAGE_SIZE - cb->cb_vm_page_offset; > >> + break; > >> default: > >> return (EINVAL); > >> } > > > > Uh, where is cb coming from? Shouldn't this be using crp->crp_buf.cb_vm_page_offset? This is causing a build failure on powerpc and powerpcspe. I don't see why other platforms aren't also erroring out here. > > Because it's PowerPC-specific: > > sys/conf/files.powerpc:dev/sec/sec.c optional sec mpc85xx > > Jess > > No, I mean literally. What scope is cb coming from? It's not a variable that is in scope for that function as far as I can tell. -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Wed Aug 26 19:23:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7D853B95D0 for ; Wed, 26 Aug 2020 19:23:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG3X0nlKz4WgZ for ; Wed, 26 Aug 2020 19:23:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f68.google.com with SMTP id 2so2964203wrj.10 for ; Wed, 26 Aug 2020 12:23:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wju96yoU8bHVs59ytpClBdsnHIvncRhlFZixUsEVb08=; b=WL8/OPS4Ae5jPnqYVOV+xLUYqqvZgPDr1m7csfAIxa2mKysd6lqqpaHLcAuUoOwllW 30HspgpPrCB/wbW/fkGZ4R84LGN9eZArBw0LIKtThPmW9czA8O9jaNOaIcpgKrWCR+mo zE8X7aKIhCbymuAuu0w1iT4f2/qxD4RcsA7IHrDNrXN2QoAoAWGlRifRcqsnuXm0DsEl uthweqqEFyZaSkxypd2PcN/axy2eeWC4ZDRZ4jbCKuZnaQZf7Mr6v2P0jwMqtnnF1FeK kOvCgtVgIjzsYNyxizrBgOX1G00cQx7wnmifDdjOgM5KltlAPJ21pnP78QFH6tlDez5N lmxA== X-Gm-Message-State: AOAM533woI10VhxbzvQc8P/Wg5ZQwOVpF3flnQc47ABuevah1/J7z8lc wqzUeQ50TUCmM5by4EqRgeh5SQ== X-Google-Smtp-Source: ABdhPJwJPNZMim0YE2KFEU+nR4yifbN7zn3FSyea4cIHKLcYCB6bGypp6KXa4SwU0RoiPwigjXXdAA== X-Received: by 2002:a5d:410e:: with SMTP id l14mr16502646wrp.216.1598469782707; Wed, 26 Aug 2020 12:23:02 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id d66sm8616450wmc.16.2020.08.26.12.23.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 12:23:02 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto From: Jessica Clarke In-Reply-To: Date: Wed, 26 Aug 2020 20:23:01 +0100 Cc: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> To: Brandon Bergren X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BcG3X0nlKz4WgZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.31 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.881]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.00)[0.005]; NEURAL_HAM_LONG(-0.94)[-0.938]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.68:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.68:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:23:04 -0000 On 26 Aug 2020, at 20:21, Brandon Bergren wrote: > On Wed, Aug 26, 2020, at 2:19 PM, Jessica Clarke wrote: >> On 26 Aug 2020, at 20:16, Brandon Bergren wrote: >>> On Tue, Aug 25, 2020, at 9:37 PM, Alan Somers wrote: >>>> Author: asomers >>>> Date: Wed Aug 26 02:37:42 2020 >>>> New Revision: 364799 >>>> URL: https://svnweb.freebsd.org/changeset/base/364799 >>>>=20 >>>> Modified: head/sys/dev/sec/sec.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/dev/sec/sec.c Wed Aug 26 02:13:27 2020 = (r364798) >>>> +++ head/sys/dev/sec/sec.c Wed Aug 26 02:37:42 2020 = (r364799) >>>> @@ -851,6 +851,9 @@ sec_desc_map_dma(struct sec_softc *sc, struct = sec_dma_ >>>> case CRYPTO_BUF_MBUF: >>>> size =3D m_length(crp->crp_buf.cb_mbuf, NULL); >>>> break; >>>> + case CRYPTO_BUF_VMPAGE: >>>> + size =3D PAGE_SIZE - cb->cb_vm_page_offset; >>>> + break; >>>> default: >>>> return (EINVAL); >>>> } >>>=20 >>> Uh, where is cb coming from? Shouldn't this be using = crp->crp_buf.cb_vm_page_offset? This is causing a build failure on = powerpc and powerpcspe. I don't see why other platforms aren't also = erroring out here. >>=20 >> Because it's PowerPC-specific: >>=20 >> sys/conf/files.powerpc:dev/sec/sec.c optional sec mpc85xx >>=20 >> Jess >>=20 >>=20 >=20 > No, I mean literally. What scope is cb coming from? It's not a = variable that is in scope for that function as far as I can tell. Oh no I agree it's wrong and your proposal sounds correct. I was just explaining why it's only noticed in PowerPC builds. Jess From owner-svn-src-head@freebsd.org Wed Aug 26 19:23:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39B623B9217; Wed, 26 Aug 2020 19:23:19 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG3p2tKxz4Wpm; Wed, 26 Aug 2020 19:23:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1B295230E3; Wed, 26 Aug 2020 19:23:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id E97D827C0054; Wed, 26 Aug 2020 15:23:15 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Wed, 26 Aug 2020 15:23:15 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeek gedtgeejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsug hrrghgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5D0C1C200A6; Wed, 26 Aug 2020 15:23:15 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> In-Reply-To: References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> Date: Wed, 26 Aug 2020 14:22:53 -0500 From: "Brandon Bergren" To: "Jessica Clarke" Cc: "Alan Somers" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r364799_-_in_head:_share/man/man9_sys/crypto/c?= =?UTF-8?Q?cp_sys/dev/cxgbe/crypto_sys/dev/sec_sys/kern_sys/opencrypto?= Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:23:19 -0000 > No, I mean literally. What scope is cb coming from? It's not a variable > that is in scope for that function as far as I can tell. > Naturally, about two seconds after I sent this, I realized that you meant that it was a powerpc-specific driver and that's why the other platforms don't catch it. Will fix it myself. -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Wed Aug 26 19:26:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21DDE3B9936; Wed, 26 Aug 2020 19:26:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG7s02PQz4X4g; Wed, 26 Aug 2020 19:26:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D432818286; Wed, 26 Aug 2020 19:26:48 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJQmns099755; Wed, 26 Aug 2020 19:26:48 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJQm9V099752; Wed, 26 Aug 2020 19:26:48 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202008261926.07QJQm9V099752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 26 Aug 2020 19:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364831 - head/usr.bin/lockf X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/usr.bin/lockf X-SVN-Commit-Revision: 364831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:26:49 -0000 Author: cperciva Date: Wed Aug 26 19:26:48 2020 New Revision: 364831 URL: https://svnweb.freebsd.org/changeset/base/364831 Log: Add -w option to lockf(1). By default, lockf(1) opens its lock file O_RDONLY|O_EXLOCK. On NFS, if the file already exists, this is split into opening the file read-only and then requesting an exclusive lock -- and the second step fails because NFS does not permit exclusive locking on files which are opened read-only. The new -w option changes the open flags to O_WRONLY|O_EXLOCK, allowing it to work on NFS -- at the cost of not working if the file cannot be opened for writing. (Whether the traditional BSD behaviour of allowing exclusive locks to be obtained on a file which cannot be opened for writing is a good idea is perhaps questionable since it may allow less-privileged users to perform a local denial of service; however this behaviour has been present for a long time and changing it now seems like it would cause problems.) Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D26005 Modified: head/usr.bin/lockf/lockf.1 head/usr.bin/lockf/lockf.c Modified: head/usr.bin/lockf/lockf.1 ============================================================================== --- head/usr.bin/lockf/lockf.1 Wed Aug 26 19:03:15 2020 (r364830) +++ head/usr.bin/lockf/lockf.1 Wed Aug 26 19:26:48 2020 (r364831) @@ -1,4 +1,4 @@ -.\" + .\" .\" Copyright (C) 1998 John D. Polstra. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2020 +.Dd August 26, 2020 .Dt LOCKF 1 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl kns +.Op Fl knsw .Op Fl t Ar seconds .Ar file .Ar command @@ -121,6 +121,14 @@ When a lock times out, is .Em not executed. +.It Fl w +Causes +.Nm +to open +.Ar file +for writing rather than reading. +This is necessary on filesystems (including NFSv4) where a file which +has been opened read-only cannot be exclusively locked. .El .Pp In no event will Modified: head/usr.bin/lockf/lockf.c ============================================================================== --- head/usr.bin/lockf/lockf.c Wed Aug 26 19:03:15 2020 (r364830) +++ head/usr.bin/lockf/lockf.c Wed Aug 26 19:26:48 2020 (r364831) @@ -62,9 +62,9 @@ main(int argc, char **argv) pid_t child; silent = keep = 0; - flags = O_CREAT; + flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "sknt:")) != -1) { + while ((ch = getopt(argc, argv, "sknt:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -84,6 +84,9 @@ main(int argc, char **argv) "invalid timeout \"%s\"", optarg); } break; + case 'w': + flags = (flags & ~O_RDONLY) | O_WRONLY; + break; default: usage(); } @@ -171,7 +174,7 @@ acquire_lock(const char *name, int flags) { int fd; - if ((fd = open(name, O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { + if ((fd = open(name, O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); else if (errno == ENOENT && (flags & O_CREAT) == 0) From owner-svn-src-head@freebsd.org Wed Aug 26 19:27:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88CF13B9274; Wed, 26 Aug 2020 19:27:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG8H751Fz4XHL; Wed, 26 Aug 2020 19:27:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id e23so1687224otk.7; Wed, 26 Aug 2020 12:27:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BWw+drxS7w6tP/jIa6PjUGEnoOI5AqSgggc+hX1DyeA=; b=NHXrd+y0BjCvO3DYdftQPHMDf5vQtazm0dry8WLQUKrMSc0HGT6IBBHM3Hx+szSr3M 9JK6pdICf5KfkXyyn2BFBZonILZ9Oj5NCx/8ESUC6UN3RPm6G2jtbAqnmuwFeYDo4QJy M++Ubpr0FxW6odyWBY9O/dh/W7RTrgpPYkPRkOiBbmVU4NrfthusO2xUGZ8ClkGgz57P f26YDU8vQ8JzGEKJMZv7BuUL1qAPSWJKHPf12H5IZ0yeVG8r8sxNKWY/eAojESDEXnqz vJ7gLO70UA56qIUgIQfLSI1xEMTl84nS3NatJHUCbrnfktOLENXAKS+z7IeJHA34uOTc qu1Q== X-Gm-Message-State: AOAM53343u/iebLK7ImswmEB9p5s2Lsr27eLXLJ1OycxZuCE5Bid5cQo G2+rnYjOszd8mXRtiV25FvF14P8d5Jzh5tqFLobjFj9dwhR4xA== X-Google-Smtp-Source: ABdhPJzvGZEdamVRc+h8b05je+xd9gpM4bmMJ5ULx3dY1Nt3LSfqvmJpQEm0ITNwSrgm9lGhJz2t3bQtF5GjgH6sQWk= X-Received: by 2002:a9d:7856:: with SMTP id c22mr1612837otm.18.1598470030466; Wed, 26 Aug 2020 12:27:10 -0700 (PDT) MIME-Version: 1.0 References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> In-Reply-To: <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> From: Alan Somers Date: Wed, 26 Aug 2020 13:26:59 -0600 Message-ID: Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto To: Brandon Bergren Cc: Jessica Clarke , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BcG8H751Fz4XHL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:27:12 -0000 On Wed, Aug 26, 2020 at 1:23 PM Brandon Bergren wrote: > > > No, I mean literally. What scope is cb coming from? It's not a variable > > that is in scope for that function as far as I can tell. > > > > Naturally, about two seconds after I sent this, I realized that you meant > that it was a powerpc-specific driver and that's why the other platforms > don't catch it. > > Will fix it myself. > > -- > Brandon Bergren > bdragon@FreeBSD.org > It probably came copy/pasted from another file :( . I'll fix it; and figure out why my universe build didn't catch this. -Alan From owner-svn-src-head@freebsd.org Wed Aug 26 19:28:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B9E63B9A62; Wed, 26 Aug 2020 19:28:31 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcG9q0MQKz4XMX; Wed, 26 Aug 2020 19:28:31 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E538217AEA; Wed, 26 Aug 2020 19:28:30 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJSUh3099882; Wed, 26 Aug 2020 19:28:30 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJSUrq099881; Wed, 26 Aug 2020 19:28:30 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202008261928.07QJSUrq099881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 26 Aug 2020 19:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364832 - head/usr.bin/lockf X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/usr.bin/lockf X-SVN-Commit-Revision: 364832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:28:31 -0000 Author: cperciva Date: Wed Aug 26 19:28:30 2020 New Revision: 364832 URL: https://svnweb.freebsd.org/changeset/base/364832 Log: Remove whitespace which accidentaly snuck into r364831. Modified: head/usr.bin/lockf/lockf.1 Modified: head/usr.bin/lockf/lockf.1 ============================================================================== --- head/usr.bin/lockf/lockf.1 Wed Aug 26 19:26:48 2020 (r364831) +++ head/usr.bin/lockf/lockf.1 Wed Aug 26 19:28:30 2020 (r364832) @@ -1,4 +1,4 @@ - .\" +.\" .\" Copyright (C) 1998 John D. Polstra. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Wed Aug 26 19:30:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 414EB3B9C91; Wed, 26 Aug 2020 19:30:25 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGD06YKsz4XLB; Wed, 26 Aug 2020 19:30:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f171.google.com with SMTP id k4so2800288ilr.12; Wed, 26 Aug 2020 12:30:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=54Zls/TBfWKx3UzA5XbeG5/uPe8kHj1BRykl5Wq8U6Q=; b=d0FaaeFD5UuRpItxPhAbdHwpXm9UFmmFEIb7nJNkYsNm0obeEVP9d7z59P6zq5JLx+ FlrJ6U6kMkfGUQ8/6dZ1jf1V93jssTyH6PYHJxxL8UTx4MHaLjQ+qMc6G/bIONzCbqfI EbNME9ZR0pVVhq5Q1PdyxnUjQqpi3bWrEHYbwhsGVTL8hmMMl6eRhpMJAmKKe26pYFuW iDv6zt0qCwBtSb7oxzxl0B7l7oThceboq0B17mlZcyyNji0z8opHhQjCB7ZSLPF/RSd0 xR+bPxfCTw7WBq+S3zRYcZGKIHBx44BEchGLTYPgR4jqZG+audZ7FstI+m2Va2MOtiLn Ppug== X-Gm-Message-State: AOAM532dUyIh25hWBXVUHrf76m6hfY0CrTdIb6ftW5+FLoRaK4xO8QYX sRDPXynw691SkPe1qk1rJ78bAkRMJrBzgTPnDbjVzGFj X-Google-Smtp-Source: ABdhPJxuBLNpjqrxysnA4Z0doWu+/+nOxSxxe5H5XxlBB/0cj+YQsn8CjcAfYxQ4rv+NIsbAZu3yYsAVK5uiMaOZiR8= X-Received: by 2002:a92:d711:: with SMTP id m17mr12056610iln.256.1598470222647; Wed, 26 Aug 2020 12:30:22 -0700 (PDT) MIME-Version: 1.0 References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> In-Reply-To: From: Ed Maste Date: Wed, 26 Aug 2020 15:30:10 -0400 Message-ID: Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto To: Alan Somers Cc: Brandon Bergren , Jessica Clarke , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BcGD06YKsz4XLB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:30:25 -0000 On Wed, 26 Aug 2020 at 15:27, Alan Somers wrote: > > It probably came copy/pasted from another file :( . I'll fix it; and figure out why my universe build didn't catch this. IIRC powerpcspe is not included in universe/tinderbox. From owner-svn-src-head@freebsd.org Wed Aug 26 19:30:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45ECF3B9D93; Wed, 26 Aug 2020 19:30:43 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGDM1CxXz4XLx; Wed, 26 Aug 2020 19:30:43 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D91B17D52; Wed, 26 Aug 2020 19:30:43 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJUgqL000970; Wed, 26 Aug 2020 19:30:42 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJUgOq000969; Wed, 26 Aug 2020 19:30:42 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202008261930.07QJUgOq000969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Wed, 26 Aug 2020 19:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364833 - head/sys/dev/sec X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/dev/sec X-SVN-Commit-Revision: 364833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:30:43 -0000 Author: bdragon Date: Wed Aug 26 19:30:42 2020 New Revision: 364833 URL: https://svnweb.freebsd.org/changeset/base/364833 Log: [PowerPC] Fix build failure in sec.c Fix a typo in r364799 that was breaking powerpc and powerpcspe build. MFC with: 364799 Modified: head/sys/dev/sec/sec.c Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Wed Aug 26 19:28:30 2020 (r364832) +++ head/sys/dev/sec/sec.c Wed Aug 26 19:30:42 2020 (r364833) @@ -852,7 +852,7 @@ sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_ size = m_length(crp->crp_buf.cb_mbuf, NULL); break; case CRYPTO_BUF_VMPAGE: - size = PAGE_SIZE - cb->cb_vm_page_offset; + size = PAGE_SIZE - crp->crp_buf.cb_vm_page_offset; break; default: return (EINVAL); From owner-svn-src-head@freebsd.org Wed Aug 26 19:32:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B2C63B9E22; Wed, 26 Aug 2020 19:32:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGGM6Skkz4Y1T; Wed, 26 Aug 2020 19:32:27 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oo1-f49.google.com with SMTP id j19so706674oor.2; Wed, 26 Aug 2020 12:32:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5nX6ggvy4vHMjMZAMWS2TDA9ynXI+xaHOTWuy7Loz08=; b=hXm4cPIbaL5BEBr7jQVES7OdAtEYXmv3xFHOiBUnWMTfIjbZ49iosNDm9KHgx/K158 fHVlMsN912M656eh9SudB4IuSOxjhepPsHYw/ng8aIE6dGVmD9mIRg6Nkg1KzSh5auDo EKFrq1PR2Hsoc2CnCQ90Q2LbpuRa1Mj/CINlcbaEPhUDOv5Z1D/NsXTAyo6T6/Pw70V7 SoMZ4cpz4D+F7k33J838AdJ19S7rl6rg11fV94Mifb5LYUzJZInaPRGQvs8xeZMMqlS/ oGHZj1UGnAsAo9XaJjuJ6JvUDit2pbHWDAURcA+/0CLh7Wa3v3XATUaZyY2eKFbgEaSO 3qww== X-Gm-Message-State: AOAM530kLtNtENGzWG69QhAUb5eriJoAiHX+WqoVc9e09I0YTO0FaWFM j6V4gffa87ipnOqlk7NIsqRGHu6sDYBFN70qm0wursHFjjKArA== X-Google-Smtp-Source: ABdhPJzvgh0H9i40Zg1PKx2txe7voAl1KSoUcVAld3vm4I0jxDt6szLeKkTfS7Zgj62aYfCSpr5hrdX1Kp17iArGry0= X-Received: by 2002:a4a:3553:: with SMTP id w19mr11693823oog.79.1598470346448; Wed, 26 Aug 2020 12:32:26 -0700 (PDT) MIME-Version: 1.0 References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> In-Reply-To: From: Alan Somers Date: Wed, 26 Aug 2020 13:32:15 -0600 Message-ID: Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto To: Ed Maste Cc: Brandon Bergren , Jessica Clarke , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BcGGM6Skkz4Y1T X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:32:28 -0000 On Wed, Aug 26, 2020 at 1:30 PM Ed Maste wrote: > On Wed, 26 Aug 2020 at 15:27, Alan Somers wrote: > > > > It probably came copy/pasted from another file :( . I'll fix it; and > figure out why my universe build didn't catch this. > > IIRC powerpcspe is not included in universe/tinderbox. > Oh, it's only for powerpcspe and not for all powerpc? Now I don't feel so bad. -Alan From owner-svn-src-head@freebsd.org Wed Aug 26 19:32:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDCE53B9CCF; Wed, 26 Aug 2020 19:32:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGGN5fN6z4Y6P; Wed, 26 Aug 2020 19:32:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2C20180C4; Wed, 26 Aug 2020 19:32:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QJWSQS005747; Wed, 26 Aug 2020 19:32:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QJWSUb005732; Wed, 26 Aug 2020 19:32:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008261932.07QJWSUb005732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 26 Aug 2020 19:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364834 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:32:29 -0000 Author: imp Date: Wed Aug 26 19:32:28 2020 New Revision: 364834 URL: https://svnweb.freebsd.org/changeset/base/364834 Log: Each entry in UPDATING needs a date It's rare for there to be two updating entries on the same day (once a decade or so), but we have that here. Add the date to the second one since devd and zfs are unrelated. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 26 19:30:42 2020 (r364833) +++ head/UPDATING Wed Aug 26 19:32:28 2020 (r364834) @@ -32,7 +32,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 'zpool upgrade' for the next few weeks. The change should be transparent unless you want to use new features. - +20200824: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with other use. The old notification will be created as well, but From owner-svn-src-head@freebsd.org Wed Aug 26 19:33:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC5053BA044; Wed, 26 Aug 2020 19:33:13 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGHF5vvbz4Y5T; Wed, 26 Aug 2020 19:33:13 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A87D9236D9; Wed, 26 Aug 2020 19:33:13 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 8A81A27C0054; Wed, 26 Aug 2020 15:33:13 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Wed, 26 Aug 2020 15:33:13 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgudefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfeftddutdelgeek gedtgeejkeffvdejtddthefggfevuefggfefledvgefhgfenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsug hrrghgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5C187C200A5; Wed, 26 Aug 2020 15:33:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <53bc8e18-d275-45f3-8f64-5a5f4b20e6b2@www.fastmail.com> In-Reply-To: References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> Date: Wed, 26 Aug 2020 14:32:51 -0500 From: "Brandon Bergren" To: "Ed Maste" , "Alan Somers" Cc: "Jessica Clarke" , src-committers , svn-src-all , svn-src-head Subject: =?UTF-8?Q?Re:_svn_commit:_r364799_-_in_head:_share/man/man9_sys/crypto/c?= =?UTF-8?Q?cp_sys/dev/cxgbe/crypto_sys/dev/sec_sys/kern_sys/opencrypto?= Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:33:14 -0000 r364833 On Wed, Aug 26, 2020, at 2:30 PM, Ed Maste wrote: > On Wed, 26 Aug 2020 at 15:27, Alan Somers wrote: > > > > It probably came copy/pasted from another file :( . I'll fix it; and figure out why my universe build didn't catch this. > > IIRC powerpcspe is not included in universe/tinderbox. > -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Wed Aug 26 19:34:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 351023BA0D3; Wed, 26 Aug 2020 19:34:20 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGJW6MR7z4YVQ; Wed, 26 Aug 2020 19:34:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f173.google.com with SMTP id z22so2572746oid.1; Wed, 26 Aug 2020 12:34:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OHhCg7UisRLjz6StE47uVx/avG1Rzgkr6J9sA2i0m0Y=; b=hf4J1ViIaPUUP1a3QtBWtr0IXatchxjsFfEbklH40pD7o8X48aKAKgdHfxFaa+AJGc PnkoNhGr8D5hGbkudcncu05pYkTg2to5gYW27etxgEFGnzMYsuirpnG6NZuub7HJQOjL P0lefIaJRJ/jxwBr1K48omoRTyWu1q6Ac9c8CPyTBd6K2G0vRjfZiINymyPg9DzVae1y qvn2CvWIwqQ2dXPwAslutUVG91qHP7HJGAQUnY18ebQE01eoeBmZO+nHHRL1xiFyk3Fq oP5a6JDGWKssi0bM1rRN7buFa9/AH6wPpPId5kiB3lHOf/H4mhWN/xEV93dREVQ4J4wC HqBQ== X-Gm-Message-State: AOAM530uLhbooRohcn5iR3QLDEO5i/cqOqpsa35tGVajldA70MyiNpsd 9256A9RimPd3Tyea5T9eVxyLmjIIFQ6M9cB34i/fryb6Hqqu1w== X-Google-Smtp-Source: ABdhPJxzEruRvfTRvEciaRznMAkDXVOZ4yN5IUqT9dHSpmvxl2ylM2WPwTIw+xhjKROXujHwmRnB9o2M1JBZqTtT/ww= X-Received: by 2002:aca:1c0c:: with SMTP id c12mr4747025oic.73.1598470458390; Wed, 26 Aug 2020 12:34:18 -0700 (PDT) MIME-Version: 1.0 References: <202008261930.07QJUgOq000969@repo.freebsd.org> In-Reply-To: <202008261930.07QJUgOq000969@repo.freebsd.org> From: Alan Somers Date: Wed, 26 Aug 2020 13:34:07 -0600 Message-ID: Subject: Re: svn commit: r364833 - head/sys/dev/sec To: Brandon Bergren Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BcGJW6MR7z4YVQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:34:20 -0000 On Wed, Aug 26, 2020 at 1:30 PM Brandon Bergren wrote: > Author: bdragon > Date: Wed Aug 26 19:30:42 2020 > New Revision: 364833 > URL: https://svnweb.freebsd.org/changeset/base/364833 > > Log: > [PowerPC] Fix build failure in sec.c > > Fix a typo in r364799 that was breaking powerpc and powerpcspe build. > > MFC with: 364799 > > Modified: > head/sys/dev/sec/sec.c > Thanks Brandon. From owner-svn-src-head@freebsd.org Wed Aug 26 19:36:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CA1A3B9FE2; Wed, 26 Aug 2020 19:36:51 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGMR0wBbz4YSs; Wed, 26 Aug 2020 19:36:51 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id F0735236DA; Wed, 26 Aug 2020 19:36:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id E39E427C0054; Wed, 26 Aug 2020 15:36:50 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Wed, 26 Aug 2020 15:36:50 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeeutefhtdeitdeggefg keeiffehleeiheevveeugeegtefgiefhueehteehuefgveenucffohhmrghinhepghhith hhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepsggurhgrghhonhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqud dtgedvfeehkeeigedqudekuddtkeehuddqsggurhgrghhonheppefhrhgvvgeuufffrdho rhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 99C75C200A5; Wed, 26 Aug 2020 15:36:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <2c83de1f-2318-4878-b9fe-d21bb5dd6905@www.fastmail.com> In-Reply-To: <53bc8e18-d275-45f3-8f64-5a5f4b20e6b2@www.fastmail.com> References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> <53bc8e18-d275-45f3-8f64-5a5f4b20e6b2@www.fastmail.com> Date: Wed, 26 Aug 2020 14:36:30 -0500 From: "Brandon Bergren" To: "Ed Maste" , "Alan Somers" Cc: "Jessica Clarke" , src-committers , svn-src-all , svn-src-head Subject: =?UTF-8?Q?Re:_svn_commit:_r364799_-_in_head:_share/man/man9_sys/crypto/c?= =?UTF-8?Q?cp_sys/dev/cxgbe/crypto_sys/dev/sec_sys/kern_sys/opencrypto?= Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:36:51 -0000 My guess as to why universe didn't catch it on powerpc is that MPC85XX is a non GENERIC kernel that is specially built as an alternate kernel -- see https://github.com/freebsd/freebsd-ci/blob/master/jobs/FreeBSD-head-powerpc-build/src.conf On Wed, Aug 26, 2020, at 2:32 PM, Brandon Bergren wrote: > r364833 > > On Wed, Aug 26, 2020, at 2:30 PM, Ed Maste wrote: > > On Wed, 26 Aug 2020 at 15:27, Alan Somers wrote: > > > > > > It probably came copy/pasted from another file :( . I'll fix it; and figure out why my universe build didn't catch this. > > > > IIRC powerpcspe is not included in universe/tinderbox. > > -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Wed Aug 26 19:45:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C69673BA7EA; Wed, 26 Aug 2020 19:45:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcGY7429Zz4ZLR; Wed, 26 Aug 2020 19:45:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:9808:df28:c1f9:5a05]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id A966D234AE; Wed, 26 Aug 2020 19:45:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364799 - in head: share/man/man9 sys/crypto/ccp sys/dev/cxgbe/crypto sys/dev/sec sys/kern sys/opencrypto To: Brandon Bergren , Ed Maste , Alan Somers Cc: Jessica Clarke , src-committers , svn-src-all , svn-src-head References: <202008260237.07Q2bhwF045988@repo.freebsd.org> <7e0abc1a-a397-46c3-b283-2c1ab21a9c4d@www.fastmail.com> <2534D2E5-2974-4067-8B9C-53EE3E8C6A68@freebsd.org> <043633bb-4660-4639-a2b6-84a25f40ca26@www.fastmail.com> <53bc8e18-d275-45f3-8f64-5a5f4b20e6b2@www.fastmail.com> <2c83de1f-2318-4878-b9fe-d21bb5dd6905@www.fastmail.com> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 26 Aug 2020 12:45:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <2c83de1f-2318-4878-b9fe-d21bb5dd6905@www.fastmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 19:45:15 -0000 On 8/26/20 12:36 PM, Brandon Bergren wrote: > My guess as to why universe didn't catch it on powerpc is that MPC85XX is a non GENERIC kernel that is specially built as an alternate kernel -- see https://github.com/freebsd/freebsd-ci/blob/master/jobs/FreeBSD-head-powerpc-build/src.conf It is also built as part of make universe/tinderbox. I've tended to only build a few specific kernel configs to cover crypto drivers not built in amd64's GENERIC build (i386 GENERIC for glxsb, MPC85XX for sec, XLP64 and OCTEON for the mips ones, aarch64 GENERIC for armv8crypto). I believe universe should cover all of those. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Aug 26 20:30:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36E5F3BB923; Wed, 26 Aug 2020 20:30:01 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcHXn0dvBz4cGn; Wed, 26 Aug 2020 20:30:01 +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 EE6CF18D03; Wed, 26 Aug 2020 20:30:00 +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 07QKU0nu042109; Wed, 26 Aug 2020 20:30:00 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QKU0Tg042108; Wed, 26 Aug 2020 20:30:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008262030.07QKU0Tg042108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Aug 2020 20:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364835 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 364835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 20:30:01 -0000 Author: cy Date: Wed Aug 26 20:30:00 2020 New Revision: 364835 URL: https://svnweb.freebsd.org/changeset/base/364835 Log: To avoid breakage for those who build/install without ZFS only rely on rc.d/zpool's BEFORE specification. Reported by: rpokala Modified: head/libexec/rc/rc.d/mountcritlocal Modified: head/libexec/rc/rc.d/mountcritlocal ============================================================================== --- head/libexec/rc/rc.d/mountcritlocal Wed Aug 26 19:32:28 2020 (r364834) +++ head/libexec/rc/rc.d/mountcritlocal Wed Aug 26 20:30:00 2020 (r364835) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritlocal -# REQUIRE: root hostid_save mdconfig zvol +# REQUIRE: root hostid_save mdconfig # KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@freebsd.org Wed Aug 26 20:56:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D99AD3BC688; Wed, 26 Aug 2020 20:56:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcJ6s5Q99z4dkZ; Wed, 26 Aug 2020 20:56:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D30719026; Wed, 26 Aug 2020 20:56:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QKu5vW062221; Wed, 26 Aug 2020 20:56:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QKu5FA062220; Wed, 26 Aug 2020 20:56:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202008262056.07QKu5FA062220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 26 Aug 2020 20:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364836 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 20:56:05 -0000 Author: rmacklem Date: Wed Aug 26 20:56:05 2020 New Revision: 364836 URL: https://svnweb.freebsd.org/changeset/base/364836 Log: Add MNT_EXTLSxxx flags that will be used for NFS over TLS exports. These flags are not currently used, but will be used by future commits to implement export(5) requirements for the use of NFS over TLS by clients. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D26180 Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Wed Aug 26 20:30:00 2020 (r364835) +++ head/sys/sys/mount.h Wed Aug 26 20:56:05 2020 (r364836) @@ -365,6 +365,9 @@ struct mntoptnames { #define MNT_EXPORTANON 0x0000000000000400ULL /* anon uid mapping for all */ #define MNT_EXKERB 0x0000000000000800ULL /* exported with Kerberos */ #define MNT_EXPUBLIC 0x0000000020000000ULL /* public export (WebNFS) */ +#define MNT_EXTLS 0x0000004000000000ULL /* require TLS */ +#define MNT_EXTLSCERT 0x0000008000000000ULL /* require TLS with client cert */ +#define MNT_EXTLSCERTUSER 0x0000010000000000ULL /* require TLS with user cert */ /* * Flags set by internal operations, From owner-svn-src-head@freebsd.org Wed Aug 26 21:13:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D914A3BCAB6; Wed, 26 Aug 2020 21:13:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcJW45QY4z4fm5; Wed, 26 Aug 2020 21:13:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D69A193D5; Wed, 26 Aug 2020 21:13:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QLDaLT074289; Wed, 26 Aug 2020 21:13:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QLDa35074288; Wed, 26 Aug 2020 21:13:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008262113.07QLDa35074288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 26 Aug 2020 21:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364837 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 364837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 21:13:36 -0000 Author: mjg Date: Wed Aug 26 21:13:36 2020 New Revision: 364837 URL: https://svnweb.freebsd.org/changeset/base/364837 Log: fuse: unbreak after r364814 Reported by: kevans Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Aug 26 20:56:05 2020 (r364836) +++ head/sys/fs/fuse/fuse_vnops.c Wed Aug 26 21:13:36 2020 (r364837) @@ -1035,8 +1035,9 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) filesize = 0; } else { struct timespec now, timeout; + int ncpticks; /* here to accomodate for API contract */ - err = cache_lookup(dvp, vpp, cnp, &timeout, NULL); + err = cache_lookup(dvp, vpp, cnp, &timeout, &ncpticks); getnanouptime(&now); SDT_PROBE3(fusefs, , vnops, cache_lookup, err, &timeout, &now); switch (err) { From owner-svn-src-head@freebsd.org Wed Aug 26 21:17:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CB103BCF3E; Wed, 26 Aug 2020 21:17:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcJbL6XXxz4g3N; Wed, 26 Aug 2020 21:17:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4E87196A8; Wed, 26 Aug 2020 21:17:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QLHIqv074883; Wed, 26 Aug 2020 21:17:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QLHIs8074882; Wed, 26 Aug 2020 21:17:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008262117.07QLHIs8074882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 26 Aug 2020 21:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364838 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 364838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 21:17:19 -0000 Author: jhb Date: Wed Aug 26 21:17:18 2020 New Revision: 364838 URL: https://svnweb.freebsd.org/changeset/base/364838 Log: Simplify compat shims for /dev/crypto. - Make session handling always use the CIOGSESSION2 structure. CIOGSESSION requests use a thunk similar to COMPAT_FREEBSD32 session requests. This permits the ioctl handler to use the 'crid' field unconditionally. - Move COMPAT_FREEBSD32 handling out of the main ioctl handler body and instead do conversions in/out of thunk structures in dedicated blocks at the start and end of the ioctl function. Reviewed by: markj (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26178 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Aug 26 21:13:36 2020 (r364837) +++ head/sys/opencrypto/cryptodev.c Wed Aug 26 21:17:18 2020 (r364838) @@ -124,9 +124,10 @@ struct crypt_kop32 { #define CIOCKEY232 _IOWR('c', 107, struct crypt_kop32) static void -session_op_from_32(const struct session_op32 *from, struct session_op *to) +session_op_from_32(const struct session_op32 *from, struct session2_op *to) { + memset(to, 0, sizeof(*to)); CP(*from, *to, cipher); CP(*from, *to, mac); CP(*from, *to, keylen); @@ -134,19 +135,19 @@ session_op_from_32(const struct session_op32 *from, st CP(*from, *to, mackeylen); PTRIN_CP(*from, *to, mackey); CP(*from, *to, ses); + to->crid = CRYPTOCAP_F_HARDWARE; } static void session2_op_from_32(const struct session2_op32 *from, struct session2_op *to) { - session_op_from_32((const struct session_op32 *)from, - (struct session_op *)to); + session_op_from_32((const struct session_op32 *)from, to); CP(*from, *to, crid); } static void -session_op_to_32(const struct session_op *from, struct session_op32 *to) +session_op_to_32(const struct session2_op *from, struct session_op32 *to) { CP(*from, *to, cipher); @@ -162,8 +163,7 @@ static void session2_op_to_32(const struct session2_op *from, struct session2_op32 *to) { - session_op_to_32((const struct session_op *)from, - (struct session_op32 *)to); + session_op_to_32(from, (struct session_op32 *)to); CP(*from, *to, crid); } @@ -240,6 +240,22 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c } #endif +static void +session2_op_from_op(const struct session_op *from, struct session2_op *to) +{ + + memset(to, 0, sizeof(*to)); + memcpy(to, from, sizeof(*from)); + to->crid = CRYPTOCAP_F_HARDWARE; +} + +static void +session2_op_to_op(const struct session2_op *from, struct session_op *to) +{ + + memcpy(to, from, sizeof(*to)); +} + struct csession { TAILQ_ENTRY(csession) next; crypto_session_t cses; @@ -354,11 +370,10 @@ cryptof_ioctl( struct ucred *active_cred, struct thread *td) { -#define SES2(p) ((struct session2_op *)p) struct crypto_session_params csp; struct fcrypt *fcr = fp->f_data; struct csession *cse; - struct session_op *sop; + struct session2_op *sop; struct crypt_op *cop; struct crypt_aead *caead; struct enc_xform *txform = NULL; @@ -369,27 +384,64 @@ cryptof_ioctl( crypto_session_t cses; u_int32_t ses; int error = 0, crid; + union { + struct session2_op sopc; #ifdef COMPAT_FREEBSD32 - struct session2_op sopc; - struct crypt_op copc; - struct crypt_kop kopc; + struct crypt_op copc; + struct crypt_kop kopc; #endif + }; +#ifdef COMPAT_FREEBSD32 + u_long cmd32; + void *data32; + cmd32 = 0; + data32 = NULL; switch (cmd) { - case CIOCGSESSION: - case CIOCGSESSION2: -#ifdef COMPAT_FREEBSD32 case CIOCGSESSION32: + cmd32 = cmd; + data32 = data; + cmd = CIOCGSESSION; + data = &sopc; + session_op_from_32((struct session_op32 *)data32, &sopc); + break; case CIOCGSESSION232: - if (cmd == CIOCGSESSION32) { - session_op_from_32(data, (struct session_op *)&sopc); - sop = (struct session_op *)&sopc; - } else if (cmd == CIOCGSESSION232) { - session2_op_from_32(data, &sopc); - sop = (struct session_op *)&sopc; - } else + cmd32 = cmd; + data32 = data; + cmd = CIOCGSESSION2; + data = &sopc; + session2_op_from_32((struct session2_op32 *)data32, &sopc); + break; + case CIOCCRYPT32: + cmd32 = cmd; + data32 = data; + cmd = CIOCCRYPT; + data = &copc; + crypt_op_from_32((struct crypt_op32 *)data32, &copc); + break; + case CIOCKEY32: + case CIOCKEY232: + cmd32 = cmd; + data32 = data; + if (cmd == CIOCKEY32) + cmd = CIOCKEY; + else + cmd = CIOCKEY2; + data = &kopc; + crypt_kop_from_32((struct crypt_kop32 *)data32, &kopc); + break; + } #endif - sop = (struct session_op *)data; + + switch (cmd) { + case CIOCGSESSION: + case CIOCGSESSION2: + if (cmd == CIOCGSESSION) { + session2_op_from_op(data, &sopc); + sop = &sopc; + } else + sop = (struct session2_op *)data; + switch (sop->cipher) { case 0: break; @@ -652,22 +704,14 @@ cryptof_ioctl( csp.csp_ivlen = AES_CCM_IV_LEN; } - /* NB: CIOCGSESSION2 has the crid */ - if (cmd == CIOCGSESSION2 -#ifdef COMPAT_FREEBSD32 - || cmd == CIOCGSESSION232 -#endif - ) { - crid = SES2(sop)->crid; - error = checkforsoftware(&crid); - if (error) { - CRYPTDEB("checkforsoftware"); - SDT_PROBE1(opencrypto, dev, ioctl, error, - __LINE__); - goto bail; - } - } else - crid = CRYPTOCAP_F_HARDWARE; + crid = sop->crid; + error = checkforsoftware(&crid); + if (error) { + CRYPTDEB("checkforsoftware"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); + goto bail; + } error = crypto_newsession(&cses, &csp, crid); if (error) { CRYPTDEB("crypto_newsession"); @@ -685,28 +729,17 @@ cryptof_ioctl( goto bail; } sop->ses = cse->ses; - if (cmd == CIOCGSESSION2 -#ifdef COMPAT_FREEBSD32 - || cmd == CIOCGSESSION232 -#endif - ) { - /* return hardware/driver id */ - SES2(sop)->crid = crypto_ses2hid(cse->cses); - } + + /* return hardware/driver id */ + sop->crid = crypto_ses2hid(cse->cses); bail: if (error) { free(key, M_XDATA); free(mackey, M_XDATA); } -#ifdef COMPAT_FREEBSD32 - else { - if (cmd == CIOCGSESSION32) - session_op_to_32(sop, data); - else if (cmd == CIOCGSESSION232) - session2_op_to_32((struct session2_op *)sop, - data); - } -#endif + + if (cmd == CIOCGSESSION && error == 0) + session2_op_to_op(sop, data); break; case CIOCFSESSION: ses = *(u_int32_t *)data; @@ -716,14 +749,7 @@ bail: } break; case CIOCCRYPT: -#ifdef COMPAT_FREEBSD32 - case CIOCCRYPT32: - if (cmd == CIOCCRYPT32) { - cop = &copc; - crypt_op_from_32(data, cop); - } else -#endif - cop = (struct crypt_op *)data; + cop = (struct crypt_op *)data; cse = csefind(fcr, cop->ses); if (cse == NULL) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); @@ -731,33 +757,15 @@ bail: } error = cryptodev_op(cse, cop, active_cred, td); csefree(cse); -#ifdef COMPAT_FREEBSD32 - if (error == 0 && cmd == CIOCCRYPT32) - crypt_op_to_32(cop, data); -#endif break; case CIOCKEY: case CIOCKEY2: -#ifdef COMPAT_FREEBSD32 - case CIOCKEY32: - case CIOCKEY232: -#endif if (!crypto_userasymcrypto) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EPERM); /* XXX compat? */ } -#ifdef COMPAT_FREEBSD32 - if (cmd == CIOCKEY32 || cmd == CIOCKEY232) { - kop = &kopc; - crypt_kop_from_32(data, kop); - } else -#endif - kop = (struct crypt_kop *)data; - if (cmd == CIOCKEY -#ifdef COMPAT_FREEBSD32 - || cmd == CIOCKEY32 -#endif - ) { + kop = (struct crypt_kop *)data; + if (cmd == CIOCKEY) { /* NB: crypto core enforces s/w driver use */ kop->crk_crid = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE; @@ -765,10 +773,6 @@ bail: mtx_lock(&Giant); error = cryptodev_key(kop); mtx_unlock(&Giant); -#ifdef COMPAT_FREEBSD32 - if (cmd == CIOCKEY32 || cmd == CIOCKEY232) - crypt_kop_to_32(kop, data); -#endif break; case CIOCASYMFEAT: if (!crypto_userasymcrypto) { @@ -804,8 +808,28 @@ bail: SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); break; } + +#ifdef COMPAT_FREEBSD32 + switch (cmd32) { + case CIOCGSESSION32: + if (error == 0) + session_op_to_32(data, data32); + break; + case CIOCGSESSION232: + if (error == 0) + session2_op_to_32(data, data32); + break; + case CIOCCRYPT32: + if (error == 0) + crypt_op_to_32(data, data32); + break; + case CIOCKEY32: + case CIOCKEY232: + crypt_kop_to_32(data, data32); + break; + } +#endif return (error); -#undef SES2 } static int cryptodev_cb(struct cryptop *); From owner-svn-src-head@freebsd.org Wed Aug 26 21:28:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E324F3BCB3F; Wed, 26 Aug 2020 21:28:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcJrb5gPvz3RdD; Wed, 26 Aug 2020 21:28:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2FA9197D6; Wed, 26 Aug 2020 21:28:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QLSlO9082654; Wed, 26 Aug 2020 21:28:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QLSlUS082653; Wed, 26 Aug 2020 21:28:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008262128.07QLSlUS082653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 26 Aug 2020 21:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364840 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 364840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 21:28:48 -0000 Author: jhb Date: Wed Aug 26 21:28:47 2020 New Revision: 364840 URL: https://svnweb.freebsd.org/changeset/base/364840 Log: Add freebsd32 compat support for CIOCCRYPTAEAD. Reviewed by: markj (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26179 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Aug 26 21:19:05 2020 (r364839) +++ head/sys/opencrypto/cryptodev.c Wed Aug 26 21:28:47 2020 (r364840) @@ -103,6 +103,20 @@ struct crypt_op32 { u_int32_t iv; }; +struct crypt_aead32 { + u_int32_t ses; + u_int16_t op; + u_int16_t flags; + u_int len; + u_int aadlen; + u_int ivlen; + u_int32_t src; + u_int32_t dst; + u_int32_t aad; + u_int32_t tag; + u_int32_t iv; +}; + struct crparam32 { u_int32_t crp_p; u_int crp_nbits; @@ -122,6 +136,7 @@ struct crypt_kop32 { #define CIOCKEY32 _IOWR('c', 104, struct crypt_kop32) #define CIOCGSESSION232 _IOWR('c', 106, struct session2_op32) #define CIOCKEY232 _IOWR('c', 107, struct crypt_kop32) +#define CIOCCRYPTAEAD32 _IOWR('c', 109, struct crypt_aead32) static void session_op_from_32(const struct session_op32 *from, struct session2_op *to) @@ -196,6 +211,40 @@ crypt_op_to_32(const struct crypt_op *from, struct cry } static void +crypt_aead_from_32(const struct crypt_aead32 *from, struct crypt_aead *to) +{ + + CP(*from, *to, ses); + CP(*from, *to, op); + CP(*from, *to, flags); + CP(*from, *to, len); + CP(*from, *to, aadlen); + CP(*from, *to, ivlen); + PTRIN_CP(*from, *to, src); + PTRIN_CP(*from, *to, dst); + PTRIN_CP(*from, *to, aad); + PTRIN_CP(*from, *to, tag); + PTRIN_CP(*from, *to, iv); +} + +static void +crypt_aead_to_32(const struct crypt_aead *from, struct crypt_aead32 *to) +{ + + CP(*from, *to, ses); + CP(*from, *to, op); + CP(*from, *to, flags); + CP(*from, *to, len); + CP(*from, *to, aadlen); + CP(*from, *to, ivlen); + PTROUT_CP(*from, *to, src); + PTROUT_CP(*from, *to, dst); + PTROUT_CP(*from, *to, aad); + PTROUT_CP(*from, *to, tag); + PTROUT_CP(*from, *to, iv); +} + +static void crparam_from_32(const struct crparam32 *from, struct crparam *to) { @@ -388,6 +437,7 @@ cryptof_ioctl( struct session2_op sopc; #ifdef COMPAT_FREEBSD32 struct crypt_op copc; + struct crypt_aead aeadc; struct crypt_kop kopc; #endif }; @@ -419,6 +469,13 @@ cryptof_ioctl( data = &copc; crypt_op_from_32((struct crypt_op32 *)data32, &copc); break; + case CIOCCRYPTAEAD32: + cmd32 = cmd; + data32 = data; + cmd = CIOCCRYPTAEAD; + data = &aeadc; + crypt_aead_from_32((struct crypt_aead32 *)data32, &aeadc); + break; case CIOCKEY32: case CIOCKEY232: cmd32 = cmd; @@ -822,6 +879,10 @@ bail: case CIOCCRYPT32: if (error == 0) crypt_op_to_32(data, data32); + break; + case CIOCCRYPTAEAD32: + if (error == 0) + crypt_aead_to_32(data, data32); break; case CIOCKEY32: case CIOCKEY232: From owner-svn-src-head@freebsd.org Wed Aug 26 21:49:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADEC13BDDC5; Wed, 26 Aug 2020 21:49:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcKJl4Brcz3TSq; Wed, 26 Aug 2020 21:49:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73C0819A9B; Wed, 26 Aug 2020 21:49:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QLnhj6097230; Wed, 26 Aug 2020 21:49:43 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QLnhMI097229; Wed, 26 Aug 2020 21:49:43 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202008262149.07QLnhMI097229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 26 Aug 2020 21:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364844 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 21:49:43 -0000 Author: rmacklem Date: Wed Aug 26 21:49:43 2020 New Revision: 364844 URL: https://svnweb.freebsd.org/changeset/base/364844 Log: Fix a "v_seqc_users == 0 not met" panic when VFS_STATFS() fails during mount. r363210 introduced v_seqc_users to the vnodes. This change requires a vn_seqc_write_end() to match the vn_seqc_write_begin() in vfs_cache_root_clear(). mjg@ provided this patch which seems to fix the panic. Tested for an NFS mount where the VFS_STATFS() call will fail. Submitted by: mjg Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D26160 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Aug 26 21:41:14 2020 (r364843) +++ head/sys/kern/vfs_mount.c Wed Aug 26 21:49:43 2020 (r364844) @@ -969,11 +969,14 @@ vfs_domount_first( if ((error = VFS_MOUNT(mp)) != 0 || (error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { + rootvp = NULL; if (error1 != 0) { error = error1; rootvp = vfs_cache_root_clear(mp); - if (rootvp != NULL) + if (rootvp != NULL) { + vhold(rootvp); vrele(rootvp); + } if ((error1 = VFS_UNMOUNT(mp, 0)) != 0) printf("VFS_UNMOUNT returned %d\n", error1); } @@ -983,6 +986,10 @@ vfs_domount_first( VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); + if (rootvp != NULL) { + vn_seqc_write_end(rootvp); + vdrop(rootvp); + } vn_seqc_write_end(vp); vrele(vp); return (error); From owner-svn-src-head@freebsd.org Wed Aug 26 22:36:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98FC63BF53F; Wed, 26 Aug 2020 22:36:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcLLK3Vwkz3XP5; Wed, 26 Aug 2020 22:36:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AEBB1A50D; Wed, 26 Aug 2020 22:36:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07QMa9VX031066; Wed, 26 Aug 2020 22:36:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07QMa9ZR031065; Wed, 26 Aug 2020 22:36:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008262236.07QMa9ZR031065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 26 Aug 2020 22:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364846 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 364846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 22:36:09 -0000 Author: jhb Date: Wed Aug 26 22:36:08 2020 New Revision: 364846 URL: https://svnweb.freebsd.org/changeset/base/364846 Log: Name the on-stack union of compat thunks. C does not permit an anonymous union at a top-level scope. Pointy hat to: jhb Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Wed Aug 26 22:11:22 2020 (r364845) +++ head/sys/opencrypto/cryptodev.c Wed Aug 26 22:36:08 2020 (r364846) @@ -440,7 +440,7 @@ cryptof_ioctl( struct crypt_aead aeadc; struct crypt_kop kopc; #endif - }; + } thunk; #ifdef COMPAT_FREEBSD32 u_long cmd32; void *data32; @@ -452,29 +452,30 @@ cryptof_ioctl( cmd32 = cmd; data32 = data; cmd = CIOCGSESSION; - data = &sopc; - session_op_from_32((struct session_op32 *)data32, &sopc); + data = &thunk.sopc; + session_op_from_32((struct session_op32 *)data32, &thunk.sopc); break; case CIOCGSESSION232: cmd32 = cmd; data32 = data; cmd = CIOCGSESSION2; - data = &sopc; - session2_op_from_32((struct session2_op32 *)data32, &sopc); + data = &thunk.sopc; + session2_op_from_32((struct session2_op32 *)data32, + &thunk.sopc); break; case CIOCCRYPT32: cmd32 = cmd; data32 = data; cmd = CIOCCRYPT; - data = &copc; - crypt_op_from_32((struct crypt_op32 *)data32, &copc); + data = &thunk.copc; + crypt_op_from_32((struct crypt_op32 *)data32, &thunk.copc); break; case CIOCCRYPTAEAD32: cmd32 = cmd; data32 = data; cmd = CIOCCRYPTAEAD; - data = &aeadc; - crypt_aead_from_32((struct crypt_aead32 *)data32, &aeadc); + data = &thunk.aeadc; + crypt_aead_from_32((struct crypt_aead32 *)data32, &thunk.aeadc); break; case CIOCKEY32: case CIOCKEY232: @@ -484,8 +485,8 @@ cryptof_ioctl( cmd = CIOCKEY; else cmd = CIOCKEY2; - data = &kopc; - crypt_kop_from_32((struct crypt_kop32 *)data32, &kopc); + data = &thunk.kopc; + crypt_kop_from_32((struct crypt_kop32 *)data32, &thunk.kopc); break; } #endif @@ -494,8 +495,8 @@ cryptof_ioctl( case CIOCGSESSION: case CIOCGSESSION2: if (cmd == CIOCGSESSION) { - session2_op_from_op(data, &sopc); - sop = &sopc; + session2_op_from_op(data, &thunk.sopc); + sop = &thunk.sopc; } else sop = (struct session2_op *)data; From owner-svn-src-head@freebsd.org Wed Aug 26 22:41:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F11BD3BF895; Wed, 26 Aug 2020 22:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcLSz69GCz3XkJ; Wed, 26 Aug 2020 22:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:9808:df28:c1f9:5a05]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5187224ED4; Wed, 26 Aug 2020 22:41:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364846 - head/sys/opencrypto From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008262236.07QMa9ZR031065@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Wed, 26 Aug 2020 15:41:53 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202008262236.07QMa9ZR031065@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 22:41:56 -0000 On 8/26/20 3:36 PM, John Baldwin wrote: > Author: jhb > Date: Wed Aug 26 22:36:08 2020 > New Revision: 364846 > URL: https://svnweb.freebsd.org/changeset/base/364846 > > Log: > Name the on-stack union of compat thunks. > > C does not permit an anonymous union at a top-level scope. > > Pointy hat to: jhb I thought I had compiled and tested the previous version prior to commit. While the checkout I had been reset to the reworked version with the union, the cryptodev.ko in the build dir was from two days ago so I tested a pre-union version today apparently. :-/ -- John Baldwin From owner-svn-src-head@freebsd.org Thu Aug 27 00:17:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A3F3C1864; Thu, 27 Aug 2020 00:17:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcNb15928z3cPR; Thu, 27 Aug 2020 00:17:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95CD11B572; Thu, 27 Aug 2020 00:17:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R0HHNO092262; Thu, 27 Aug 2020 00:17:17 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R0HHgJ092261; Thu, 27 Aug 2020 00:17:17 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <202008270017.07R0HHgJ092261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 27 Aug 2020 00:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364850 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 364850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 00:17:17 -0000 Author: jamie Date: Thu Aug 27 00:17:17 2020 New Revision: 364850 URL: https://svnweb.freebsd.org/changeset/base/364850 Log: Don't allow jail.conf variables to have the same names as jail parameters. It was already not allowed in many cases, but crashed instead of giving an error. PR: 248444 Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Wed Aug 26 23:41:46 2020 (r364849) +++ head/usr.sbin/jail/config.c Thu Aug 27 00:17:17 2020 (r364850) @@ -366,8 +366,13 @@ add_param(struct cfjail *j, const struct cfparam *p, e break; if (dp != NULL) { /* Found it - append or replace. */ + if ((flags ^ dp->flags) & PF_VAR) { + jail_warnx(j, "variable \"$%s\" cannot have the same " + "name as a parameter.", name); + return; + } if (dp->flags & PF_IMMUTABLE) { - jail_warnx(j, "cannot redefine variable \"%s\".", + jail_warnx(j, "cannot redefine parameter \"%s\".", dp->name); return; } @@ -394,6 +399,14 @@ add_param(struct cfjail *j, const struct cfparam *p, e for (ipnum = IP__NULL + 1; ipnum < IP_NPARAM; ipnum++) if (!(intparams[ipnum].flags & PF_CONV) && equalopts(name, intparams[ipnum].name)) { + if (flags & PF_VAR) { + jail_warnx(j, + "variable \"$%s\" " + "cannot have the same " + "name as a parameter.", + name); + return; + } j->intparams[ipnum] = np; np->flags |= intparams[ipnum].flags; break; From owner-svn-src-head@freebsd.org Thu Aug 27 03:50:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70D6F3C5B38; Thu, 27 Aug 2020 03:50:35 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcTK72Bh7z44tV; Thu, 27 Aug 2020 03:50:35 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FA851DCB1; Thu, 27 Aug 2020 03:50:35 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R3oZD3036009; Thu, 27 Aug 2020 03:50:35 GMT (envelope-from grog@FreeBSD.org) Received: (from grog@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R3oZ6n036008; Thu, 27 Aug 2020 03:50:35 GMT (envelope-from grog@FreeBSD.org) Message-Id: <202008270350.07R3oZ6n036008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grog set sender to grog@FreeBSD.org using -f From: Greg Lehey Date: Thu, 27 Aug 2020 03:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364854 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: grog X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 364854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 03:50:35 -0000 Author: grog Date: Thu Aug 27 03:50:34 2020 New Revision: 364854 URL: https://svnweb.freebsd.org/changeset/base/364854 Log: Update Hong Kong Liberation Day (hah!) Modified: head/usr.bin/calendar/calendars/calendar.holiday Modified: head/usr.bin/calendar/calendars/calendar.holiday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.holiday Thu Aug 27 00:33:01 2020 (r364853) +++ head/usr.bin/calendar/calendars/calendar.holiday Thu Aug 27 03:50:34 2020 (r364854) @@ -350,7 +350,7 @@ 08/25 Independence Day in Uruguay 08/26 Susan B. Anthony Day in Massachusetts 08/26* Bank Holiday in England and Wales -08/27 Liberation Day in Hong Kong +08/MonLast Liberation Day in Hong Kong 08/28 Heroes Day in Philippines 08/30 Huey P. Long Day in Louisiana 08/30 Victory Day in Turkey From owner-svn-src-head@freebsd.org Thu Aug 27 05:11:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 671EA3C6DE9; Thu, 27 Aug 2020 05:11:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcW6D27ZGz47yK; Thu, 27 Aug 2020 05:11:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DF1F1EC44; Thu, 27 Aug 2020 05:11:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R5BGdo093767; Thu, 27 Aug 2020 05:11:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R5BFJm093764; Thu, 27 Aug 2020 05:11:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008270511.07R5BFJm093764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2020 05:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364855 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 05:11:16 -0000 Author: imp Date: Thu Aug 27 05:11:15 2020 New Revision: 364855 URL: https://svnweb.freebsd.org/changeset/base/364855 Log: Implement FLUSHO Turn FLUSHO on/off with ^O (or whatever VDISCARD is). Honor that to throw away output quickly. This tries to remain true to 4.4BSD behavior (since that was the origin of this feature), with any corrections NetBSD has done. Since the implemenations are a little different, though, some edge conditions may be handled differently. Reviewed by: kib, kevans Differential Review: https://reviews.freebsd.org/D26148 Modified: head/sys/kern/tty.c head/sys/kern/tty_ttydisc.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Aug 27 03:50:34 2020 (r364854) +++ head/sys/kern/tty.c Thu Aug 27 05:11:15 2020 (r364855) @@ -1467,6 +1467,7 @@ tty_signal_sessleader(struct tty *tp, int sig) /* Make signals start output again. */ tp->t_flags &= ~TF_STOPPED; + tp->t_termios.c_lflag &= ~FLUSHO; if (tp->t_session != NULL && tp->t_session->s_leader != NULL) { p = tp->t_session->s_leader; @@ -1486,6 +1487,7 @@ tty_signal_pgrp(struct tty *tp, int sig) /* Make signals start output again. */ tp->t_flags &= ~TF_STOPPED; + tp->t_termios.c_lflag &= ~FLUSHO; if (sig == SIGINFO && !(tp->t_termios.c_lflag & NOKERNINFO)) tty_info(tp); @@ -1930,6 +1932,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da return (0); case TIOCSTART: tp->t_flags &= ~TF_STOPPED; + tp->t_termios.c_lflag &= ~FLUSHO; ttydevsw_outwakeup(tp); ttydevsw_pktnotify(tp, TIOCPKT_START); return (0); Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Thu Aug 27 03:50:34 2020 (r364854) +++ head/sys/kern/tty_ttydisc.c Thu Aug 27 05:11:15 2020 (r364855) @@ -95,6 +95,7 @@ ttydisc_close(struct tty *tp) /* Clean up our flags when leaving the discipline. */ tp->t_flags &= ~(TF_STOPPED|TF_HIWAT|TF_ZOMBIE); + tp->t_termios.c_lflag &= ~FLUSHO; /* * POSIX states that we must drain output and flush input on @@ -474,6 +475,12 @@ ttydisc_write(struct tty *tp, struct uio *uio, int iof MPASS(oblen == 0); + if (CMP_FLAG(l, FLUSHO)) { + uio->uio_offset += uio->uio_resid; + uio->uio_resid = 0; + return (0); + } + /* Step 1: read data. */ obstart = ob; nlen = MIN(uio->uio_resid, sizeof ob); @@ -495,6 +502,12 @@ ttydisc_write(struct tty *tp, struct uio *uio, int iof do { unsigned int plen, wlen; + if (CMP_FLAG(l, FLUSHO)) { + uio->uio_offset += uio->uio_resid; + uio->uio_resid = 0; + return (0); + } + /* Search for special characters for post processing. */ if (CMP_FLAG(o, OPOST)) { plen = ttydisc_findchar(obstart, oblen); @@ -629,6 +642,9 @@ static int ttydisc_echo_force(struct tty *tp, char c, int quote) { + if (CMP_FLAG(l, FLUSHO)) + return 0; + if (CMP_FLAG(o, OPOST) && CTL_ECHO(c, quote)) { /* * Only perform postprocessing when OPOST is turned on @@ -879,8 +895,10 @@ ttydisc_rint(struct tty *tp, char c, int flags) } /* Allow any character to perform a wakeup. */ - if (CMP_FLAG(i, IXANY)) + if (CMP_FLAG(i, IXANY)) { tp->t_flags &= ~TF_STOPPED; + tp->t_termios.c_lflag &= ~FLUSHO; + } /* Remove the top bit. */ if (CMP_FLAG(i, ISTRIP)) @@ -905,6 +923,18 @@ ttydisc_rint(struct tty *tp, char c, int flags) } tp->t_flags |= TF_LITERAL; return (0); + } + /* Discard processing */ + if (CMP_CC(VDISCARD, c)) { + if (CMP_FLAG(l, FLUSHO)) { + tp->t_termios.c_lflag &= ~FLUSHO; + } else { + tty_flush(tp, FWRITE); + ttydisc_echo(tp, c, 0); + if (tp->t_inq.ti_end > 0) + ttydisc_reprint(tp); + tp->t_termios.c_lflag |= FLUSHO; + } } } From owner-svn-src-head@freebsd.org Thu Aug 27 06:30:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D7F3C89EE; Thu, 27 Aug 2020 06:30:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcXss0drNz4DxW; Thu, 27 Aug 2020 06:30:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE8221FD17; Thu, 27 Aug 2020 06:30:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R6UeIj048657; Thu, 27 Aug 2020 06:30:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R6Ueaa048656; Thu, 27 Aug 2020 06:30:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008270630.07R6Ueaa048656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 27 Aug 2020 06:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364856 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 06:30:41 -0000 Author: mjg Date: Thu Aug 27 06:30:40 2020 New Revision: 364856 URL: https://svnweb.freebsd.org/changeset/base/364856 Log: cache: ncp = NULL early to account for sdt probes in ailure path CID: 1432106 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Aug 27 05:11:15 2020 (r364855) +++ head/sys/kern/vfs_cache.c Thu Aug 27 06:30:40 2020 (r364856) @@ -2938,6 +2938,7 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rd i = 0; #endif error = -1; + ncp = NULL; /* for sdt probe down below */ vp_seqc = vn_seqc_read_any(vp); if (seqc_in_modify(vp_seqc)) { cache_rev_failed(&reason); From owner-svn-src-head@freebsd.org Thu Aug 27 06:31:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 728D73C8D65; Thu, 27 Aug 2020 06:31:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcXtm17Dwz4F3Z; Thu, 27 Aug 2020 06:31:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AE6F1FCDE; Thu, 27 Aug 2020 06:31:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R6VRkW050407; Thu, 27 Aug 2020 06:31:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R6VRsE050406; Thu, 27 Aug 2020 06:31:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008270631.07R6VRsE050406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 27 Aug 2020 06:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364857 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 06:31:28 -0000 Author: mjg Date: Thu Aug 27 06:31:27 2020 New Revision: 364857 URL: https://svnweb.freebsd.org/changeset/base/364857 Log: cache: assorted clean ups In particular remove spurious comments, duplicate assertions and the inconsistently done KTR support. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Aug 27 06:30:40 2020 (r364856) +++ head/sys/kern/vfs_cache.c Thu Aug 27 06:31:27 2020 (r364857) @@ -999,9 +999,6 @@ cache_zap_locked(struct namecache *ncp) cache_assert_vnode_locked(ncp->nc_dvp); cache_assert_bucket_locked(ncp); - CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, - (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); - cache_ncp_invalidate(ncp); ncpp = NCP2BUCKET(ncp); @@ -1260,6 +1257,83 @@ cache_zap_locked_bucket_kl(struct namecache *ncp, stru return (EAGAIN); } +static __noinline int +cache_remove_cnp(struct vnode *dvp, struct componentname *cnp) +{ + struct namecache *ncp; + struct mtx *blp; + struct mtx *dvlp, *dvlp2; + uint32_t hash; + int error; + + if (cnp->cn_namelen == 2 && + cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') { + dvlp = VP2VNODELOCK(dvp); + dvlp2 = NULL; + mtx_lock(dvlp); +retry_dotdot: + ncp = dvp->v_cache_dd; + if (ncp == NULL) { + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp); + return (0); + } + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { + if (!cache_zap_locked_vnode_kl2(ncp, dvp, &dvlp2)) + goto retry_dotdot; + MPASS(dvp->v_cache_dd == NULL); + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + cache_free(ncp); + } else { + vn_seqc_write_begin(dvp); + dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); + mtx_unlock(dvlp); + if (dvlp2 != NULL) + mtx_unlock(dvlp2); + } + SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp); + return (1); + } + + hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); + blp = HASH2BUCKETLOCK(hash); +retry: + if (CK_SLIST_EMPTY(NCHHASH(hash))) + goto out_no_entry; + + mtx_lock(blp); + + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + break; + } + + if (ncp == NULL) { + mtx_unlock(blp); + goto out_no_entry; + } + + error = cache_zap_locked_bucket(ncp, cnp, hash, blp); + if (__predict_false(error != 0)) { + zap_and_exit_bucket_fail++; + goto retry; + } + counter_u64_add(numposzaps, 1); + SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp); + cache_free(ncp); + return (1); +out_no_entry: + counter_u64_add(nummisszap, 1); + SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp); + return (0); +} + static int __noinline cache_lookup_dot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) @@ -1267,8 +1341,6 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp int ltype; *vpp = dvp; - CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .", - dvp, cnp->cn_nameptr); counter_u64_add(dothits, 1); SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp); if (tsp != NULL) @@ -1296,10 +1368,6 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp return (-1); } -static __noinline int -cache_remove_cnp(struct vnode *dvp, struct componentname *cnp); - - static int __noinline cache_lookup_dotdot(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) @@ -1324,8 +1392,7 @@ retry: mtx_lock(dvlp); ncp = dvp->v_cache_dd; if (ncp == NULL) { - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, - "..", NULL); + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, "..", NULL); mtx_unlock(dvlp); return (0); } @@ -1336,13 +1403,9 @@ retry: *vpp = ncp->nc_vp; } else *vpp = ncp->nc_dvp; - /* Return failure if negative entry was found. */ if (*vpp == NULL) goto negative_success; - CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", - dvp, cnp->cn_nameptr, *vpp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", - *vpp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", *vpp); cache_out_ts(ncp, tsp, ticksp); if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == NCF_DTS && tsp != NULL) { @@ -1350,12 +1413,7 @@ retry: *tsp = ncp_ts->nc_dotdottime; } - /* - * On success we return a locked and ref'd vnode as per the lookup - * protocol. - */ MPASS(dvp != *vpp); - ltype = 0; /* silence gcc warning */ ltype = VOP_ISLOCKED(dvp); VOP_UNLOCK(dvp); vs = vget_prep(*vpp); @@ -1372,10 +1430,6 @@ retry: *vpp = NULL; goto retry; } - if ((cnp->cn_flags & ISLASTCN) && - (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { - ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); - } return (-1); negative_success: if (__predict_false(cnp->cn_nameiop == CREATE)) { @@ -1402,87 +1456,6 @@ negative_success: return (ENOENT); } -static __noinline int -cache_remove_cnp(struct vnode *dvp, struct componentname *cnp) -{ - struct namecache *ncp; - struct mtx *blp; - struct mtx *dvlp, *dvlp2; - uint32_t hash; - int error; - - if (cnp->cn_namelen == 2 && - cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') { - dvlp = VP2VNODELOCK(dvp); - dvlp2 = NULL; - mtx_lock(dvlp); -retry_dotdot: - ncp = dvp->v_cache_dd; - if (ncp == NULL) { - mtx_unlock(dvlp); - if (dvlp2 != NULL) - mtx_unlock(dvlp2); - SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp); - return (0); - } - if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) { - if (ncp->nc_dvp != dvp) - panic("dvp %p v_cache_dd %p\n", dvp, ncp); - if (!cache_zap_locked_vnode_kl2(ncp, - dvp, &dvlp2)) - goto retry_dotdot; - MPASS(dvp->v_cache_dd == NULL); - mtx_unlock(dvlp); - if (dvlp2 != NULL) - mtx_unlock(dvlp2); - cache_free(ncp); - } else { - vn_seqc_write_begin(dvp); - dvp->v_cache_dd = NULL; - vn_seqc_write_end(dvp); - mtx_unlock(dvlp); - if (dvlp2 != NULL) - mtx_unlock(dvlp2); - } - SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp); - return (1); - } - - hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - blp = HASH2BUCKETLOCK(hash); -retry: - if (CK_SLIST_EMPTY(NCHHASH(hash))) - goto out_no_entry; - - mtx_lock(blp); - - CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { - if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && - !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) - break; - } - - /* We failed to find an entry */ - if (ncp == NULL) { - mtx_unlock(blp); - goto out_no_entry; - } - - error = cache_zap_locked_bucket(ncp, cnp, hash, blp); - if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail++; - goto retry; - } - counter_u64_add(numposzaps, 1); - cache_free(ncp); - SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp); - return (1); -out_no_entry: - SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp); - counter_u64_add(nummisszap, 1); - return (0); -} - /** * Lookup a name in the name cache * @@ -1504,6 +1477,8 @@ out_no_entry: * that was current when the cache entry was created, unless cnp * was ".". * + * Either both tsp and ticks have to be provided or neither of them. + * * # Returns * * - -1: A positive cache hit. vpp will contain the desired vnode. @@ -1543,7 +1518,6 @@ retry: break; } - /* We failed to find an entry */ if (__predict_false(ncp == NULL)) { mtx_unlock(blp); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, @@ -1555,18 +1529,10 @@ retry: if (ncp->nc_flag & NCF_NEGATIVE) goto negative_success; - /* We found a "positive" match, return the vnode */ counter_u64_add(numposhits, 1); *vpp = ncp->nc_vp; - CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", - dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, - *vpp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp); cache_out_ts(ncp, tsp, ticksp); - /* - * On success we return a locked and ref'd vnode as per the lookup - * protocol. - */ MPASS(dvp != *vpp); vs = vget_prep(*vpp); mtx_unlock(blp); @@ -1575,14 +1541,8 @@ retry: *vpp = NULL; goto retry; } - if ((cnp->cn_flags & ISLASTCN) && - (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { - ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); - } return (-1); - negative_success: - /* We found a negative match, and want to create it, so purge */ if (__predict_false(cnp->cn_nameiop == CREATE)) { if (cnp->cn_flags & ISLASTCN) { counter_u64_add(numnegzaps, 1); @@ -1651,7 +1611,6 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st break; } - /* We failed to find an entry */ if (__predict_false(ncp == NULL)) { vfs_smr_exit(); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, @@ -1664,18 +1623,10 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st if (nc_flag & NCF_NEGATIVE) goto negative_success; - /* We found a "positive" match, return the vnode */ counter_u64_add(numposhits, 1); *vpp = ncp->nc_vp; - CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", - dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, - *vpp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp); cache_out_ts(ncp, tsp, ticksp); - /* - * On success we return a locked and ref'd vnode as per the lookup - * protocol. - */ MPASS(dvp != *vpp); if (!cache_ncp_canuse(ncp)) { vfs_smr_exit(); @@ -1693,12 +1644,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st *vpp = NULL; goto out_fallback; } - if ((cnp->cn_flags & ISLASTCN) && - (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { - ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); - } return (-1); - negative_success: if (__predict_false(cnp->cn_nameiop == CREATE)) { if (cnp->cn_flags & ISLASTCN) { @@ -1712,7 +1658,8 @@ negative_success: counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); /* - * We need to take locks to promote an entry. + * TODO: We need to take locks to promote an entry. Code doing it + * in SMR lookup can be modified to be shared. */ negstate = NCP2NEGSTATE(ncp); if ((negstate->neg_flag & NEG_HOT) == 0 || @@ -1850,8 +1797,7 @@ cache_unlock_buckets_cel(struct celockstate *cel) * * This means vnodelocks for dvp, vp and the relevant bucketlock. * However, insertion can result in removal of an old entry. In this - * case we have an additional vnode and bucketlock pair to lock. If the - * entry is negative, ncelock is locked instead of the vnode. + * case we have an additional vnode and bucketlock pair to lock. * * That is, in the worst case we have to lock 3 vnodes and 2 bucketlocks, while * preserving the locking order (smaller address first). @@ -1986,7 +1932,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, int len; u_long lnumcache; - CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNPASS(!VN_IS_DOOMED(dvp), dvp); VNPASS(dvp->v_type != VNON, dvp); if (vp != NULL) { @@ -2416,7 +2361,6 @@ cache_purge_negative(struct vnode *vp) struct namecache *ncp, *nnp; struct mtx *vlp; - CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); SDT_PROBE1(vfs, namecache, purge_negative, done, vp); if (LIST_EMPTY(&vp->v_cache_src)) return; From owner-svn-src-head@freebsd.org Thu Aug 27 06:31:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6553C8E0E; Thu, 27 Aug 2020 06:31:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcXvJ2G0hz4FQt; Thu, 27 Aug 2020 06:31:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 300201FD22; Thu, 27 Aug 2020 06:31:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R6VuTW051194; Thu, 27 Aug 2020 06:31:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R6Vudd051193; Thu, 27 Aug 2020 06:31:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008270631.07R6Vudd051193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 27 Aug 2020 06:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364858 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 06:31:56 -0000 Author: mjg Date: Thu Aug 27 06:31:55 2020 New Revision: 364858 URL: https://svnweb.freebsd.org/changeset/base/364858 Log: cache: don't update timestmaps on found entry Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Aug 27 06:31:27 2020 (r364857) +++ head/sys/kern/vfs_cache.c Thu Aug 27 06:31:55 2020 (r364858) @@ -1925,7 +1925,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, { struct celockstate cel; struct namecache *ncp, *n2, *ndd; - struct namecache_ts *ncp_ts, *n2_ts; + struct namecache_ts *ncp_ts; struct nchashhead *ncpp; uint32_t hash; int flag; @@ -2013,6 +2013,17 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, KASSERT(n2->nc_vp == vp, ("%s: found entry pointing to a different vnode (%p != %p)", __func__, n2->nc_vp, vp)); + /* + * Entries are supposed to be immutable unless in the + * process of getting destroyed. Accommodating for + * changing timestamps is possible but not worth it. + * This should be harmless in terms of correctness, in + * the worst case resulting in an earlier expiration. + * Alternatively, the found entry can be replaced + * altogether. + */ + MPASS((n2->nc_flag & (NCF_TS | NCF_DTS)) == (ncp->nc_flag & (NCF_TS | NCF_DTS))); +#if 0 if (tsp != NULL) { KASSERT((n2->nc_flag & NCF_TS) != 0, ("no NCF_TS")); @@ -2024,6 +2035,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, n2_ts->nc_nc.nc_flag |= NCF_DTS; } } +#endif goto out_unlock_free; } } From owner-svn-src-head@freebsd.org Thu Aug 27 08:08:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BA173CAE30; Thu, 27 Aug 2020 08:08:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcb361m6zz4L0p; Thu, 27 Aug 2020 08:08:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FA3A20CBC; Thu, 27 Aug 2020 08:08:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07R88oeM011669; Thu, 27 Aug 2020 08:08:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07R88nQE011668; Thu, 27 Aug 2020 08:08:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008270808.07R88nQE011668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 27 Aug 2020 08:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364859 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 364859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 08:08:50 -0000 Author: manu Date: Thu Aug 27 08:08:49 2020 New Revision: 364859 URL: https://svnweb.freebsd.org/changeset/base/364859 Log: arm: ti: Fix Beaglebone black MMC after DTS update After DTS sync with Linux kernel 5.8 this patch was included: "ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver" https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2&id=0b4edf111870b83ea77b1d7e16b8ceac29f9f388 Current will not load any driver for MMC and not mount the rootfs. Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c Submitted by: oskar.holmlund@ohdata.se Reported by: phk X-MFC-With: 363853 Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Thu Aug 27 06:31:55 2020 (r364858) +++ head/sys/arm/ti/ti_sdhci.c Thu Aug 27 08:08:49 2020 (r364859) @@ -93,6 +93,7 @@ struct ti_sdhci_softc { * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x. */ static struct ofw_compat_data compat_data[] = { + {"ti,am335-sdhci", 1}, {"ti,omap3-hsmmc", 1}, {"ti,omap4-hsmmc", 1}, {"ti,mmchs", 1}, From owner-svn-src-head@freebsd.org Thu Aug 27 08:10:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAD053CAD78; Thu, 27 Aug 2020 08:10:08 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcb4c0gwpz4LMq; Thu, 27 Aug 2020 08:10:07 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1598515800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1p9q29ydXi/Cf/8MJTfIzu7YzW3aKcsyVuNLicTwDlk=; b=GADf6cigohvccq/rvvWJXRh1kObrmYu0IBzZqmVhplxvaur2Ecz05dvz9+TWeV+7w5MElr RstDHBPq/mjZnuN7pZLCMgcOdC5U6BSDEPLwO6pzB+bfMDXJJnMLr8XIu6ffxOLM7vM0Dc tWs3tVRBY0KngXtoQCmcWFnKTnR/KtA= Received: from amy.home (lfbn-idf2-1-1138-237.w90-92.abo.wanadoo.fr [90.92.20.237]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 2889ed38 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 27 Aug 2020 08:09:59 +0000 (UTC) Date: Thu, 27 Aug 2020 10:09:59 +0200 From: Emmanuel Vadot To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364859 - head/sys/arm/ti Message-Id: <20200827100959.a8ff47ba248c3d8a44402175@bidouilliste.com> In-Reply-To: <202008270808.07R88nQE011668@repo.freebsd.org> References: <202008270808.07R88nQE011668@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bcb4c0gwpz4LMq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 08:10:08 -0000 On Thu, 27 Aug 2020 08:08:49 +0000 (UTC) Emmanuel Vadot wrote: > Author: manu > Date: Thu Aug 27 08:08:49 2020 > New Revision: 364859 > URL: https://svnweb.freebsd.org/changeset/base/364859 > > Log: > arm: ti: Fix Beaglebone black MMC after DTS update > > After DTS sync with Linux kernel 5.8 this patch was included: > "ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver" > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2&id=0b4edf111870b83ea77b1d7e16b8ceac29f9f388 > > Current will not load any driver for MMC and not mount the rootfs. > Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c > > Submitted by: oskar.holmlund@ohdata.se > Reported by: phk > X-MFC-With: 363853 Differential Revision: https://reviews.freebsd.org/D26194 > > Modified: > head/sys/arm/ti/ti_sdhci.c > > Modified: head/sys/arm/ti/ti_sdhci.c > ============================================================================== > --- head/sys/arm/ti/ti_sdhci.c Thu Aug 27 06:31:55 2020 (r364858) > +++ head/sys/arm/ti/ti_sdhci.c Thu Aug 27 08:08:49 2020 (r364859) > @@ -93,6 +93,7 @@ struct ti_sdhci_softc { > * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x. > */ > static struct ofw_compat_data compat_data[] = { > + {"ti,am335-sdhci", 1}, > {"ti,omap3-hsmmc", 1}, > {"ti,omap4-hsmmc", 1}, > {"ti,mmchs", 1}, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Aug 27 08:54:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E4403CB9E2; Thu, 27 Aug 2020 08:54:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcc3L4PMLz4N4w; Thu, 27 Aug 2020 08:54:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f181.google.com with SMTP id w14so5542867ljj.4; Thu, 27 Aug 2020 01:54:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=vlAjSTUAa0MC7qEW9AO0fAH1FtBM05QfssBMY6oklD0=; b=PXhdHp7xhGshL3DdYzxkNMvi+MKifvn3xOHov0NFh8afrnVJVdo9lWdU5uy+D/Snsh JcdAEx83EJUXj2snWxKGxlu88/L4YajE89czxFi5Fw26slC8ODgI/NQ/vFhFkx8JpLmR qxU/RDmTngi08qRNUJ1MmvFre0te3dhBplOSSJwppH3umZio0xPNZMRsqiB4B5PslMGn 7GF66ls43Pimx02/BQmfximr+gHJ2JR3OkZZ0xrXd18bnqo3xi84acgm6GVDC0mk0Syn 1/Ys2rjzPPFt+G+X94Cn4um1ZeH6HcSLIO5NRPzWd6BzeZOA82bs+oheaMLgNr5V8eMw 03pQ== X-Gm-Message-State: AOAM532Q2UXV2KEr7J/UDeVeqleogg0wRE/2jF0FxJ2+CSD0eXXczE3d Lpw1//JF7ARjrvjlrq0I79j0Iun1AOE= X-Google-Smtp-Source: ABdhPJyzbd2+hoq0rd+I3kTBFJTTGp6Zjvy5RHbsCaivdpERpP/gyoN3Ey8oIxWrnxh/Jh6+9rwOtw== X-Received: by 2002:a2e:8904:: with SMTP id d4mr8568602lji.400.1598518444240; Thu, 27 Aug 2020 01:54:04 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 7sm330821ljf.38.2020.08.27.01.54.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Aug 2020 01:54:03 -0700 (PDT) Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008261313.07QDDwRm040119@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> Date: Thu, 27 Aug 2020 11:54:02 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202008261313.07QDDwRm040119@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bcc3L4PMLz4N4w X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.181 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-0.80 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.15)[-0.154]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.62)[-0.616]; NEURAL_HAM_SHORT(-0.03)[-0.030]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.181:from]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.181:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 08:54:07 -0000 On 26/08/2020 16:13, Cy Schubert wrote: > Author: cy > Date: Wed Aug 26 13:13:57 2020 > New Revision: 364817 > URL: https://svnweb.freebsd.org/changeset/base/364817 > > Log: > As of r364746 (OpenZFS import) existing ZPOOLs are not imported > prior to zvol and mountcritlocal resulting in ZVOLs (swap and I probably missed some discussion, so I am curious why that is. > virtual machine UFS filesystems) being unavailable, leading to > boot failures. > We move the zpool import from zfs to a new zpool script, with the > -N option to avoid mounting datasets while making the ZPOOL's > datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs > available for subsequent use for swap (in the zvol rc sript) or > for UFS or other filesystems in fstab(5), mounted by mountcritlocal. > > Reviewed by: freqlabs (previous version) > Differential Revision: https://reviews.freebsd.org/D26185 > > Added: > head/libexec/rc/rc.d/zpool (contents, props changed) [snip] > +zpool_start() > +{ > + local cachefile > + > + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do > + if [ -r $cachefile ]; then > + zpool import -c $cachefile -a -N I would add a break here, so that pools are imported either from one cache file or the other but not both. It makes sense to have two cache file definitions for migration, but I think that it does not make sense to split pools between the cache files. > + fi > + done > +} -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Aug 27 10:28:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 953B23CD5DE; Thu, 27 Aug 2020 10:28: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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcf7x3Zh5z4Rcy; Thu, 27 Aug 2020 10:28: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 5E110225D9; Thu, 27 Aug 2020 10:28: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 07RASDF1004725; Thu, 27 Aug 2020 10:28:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RASCFB004722; Thu, 27 Aug 2020 10:28:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008271028.07RASCFB004722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 27 Aug 2020 10:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364860 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi X-SVN-Commit-Revision: 364860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 10:28:13 -0000 Author: hselasky Date: Thu Aug 27 10:28:12 2020 New Revision: 364860 URL: https://svnweb.freebsd.org/changeset/base/364860 Log: Implement extensible arrays API using the existing radix tree implementation in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D25101 Reviewed by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/xarray.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_xarray.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/linuxkpi/Makefile Added: head/sys/compat/linuxkpi/common/include/linux/xarray.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/xarray.h Thu Aug 27 10:28:12 2020 (r364860) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_XARRAY_H_ +#define _LINUX_XARRAY_H_ + +#include +#include +#include + +#include +#include + +#define XA_LIMIT(min, max) \ + ({ CTASSERT((min) == 0); (uint32_t)(max); }) + +#define XA_FLAGS_ALLOC (1U << 0) +#define XA_FLAGS_LOCK_IRQ (1U << 1) + +#define XA_ERROR(x) \ + ERR_PTR(x) + +#define xa_limit_32b XA_LIMIT(0, 0xFFFFFFFF) + +#define XA_ASSERT_LOCKED(xa) mtx_assert(&(xa)->mtx, MA_OWNED) +#define xa_lock(xa) mtx_lock(&(xa)->mtx) +#define xa_unlock(xa) mtx_unlock(&(xa)->mtx) + +struct xarray { + struct radix_tree_root root; + struct mtx mtx; /* internal mutex */ +}; + +/* + * Extensible arrays API implemented as a wrapper + * around the radix tree implementation. + */ +void *xa_erase(struct xarray *, uint32_t); +void *xa_load(struct xarray *, uint32_t); +int xa_alloc(struct xarray *, uint32_t *, void *, uint32_t, gfp_t); +int xa_alloc_cyclic(struct xarray *, uint32_t *, void *, uint32_t, uint32_t *, gfp_t); +int xa_insert(struct xarray *, uint32_t, void *, gfp_t); +void *xa_store(struct xarray *, uint32_t, void *, gfp_t); +void xa_init_flags(struct xarray *, uint32_t); +bool xa_empty(struct xarray *); +void xa_destroy(struct xarray *); +void *xa_next(struct xarray *, unsigned long *, bool); + +#define xa_for_each(xa, index, entry) \ + for ((entry) = NULL, (index) = 0; \ + ((entry) = xa_next(xa, &index, (entry) != NULL)) != NULL; ) + +/* + * Unlocked version of functions above. + */ +void *__xa_erase(struct xarray *, uint32_t); +int __xa_alloc(struct xarray *, uint32_t *, void *, uint32_t, gfp_t); +int __xa_alloc_cyclic(struct xarray *, uint32_t *, void *, uint32_t, uint32_t *, gfp_t); +int __xa_insert(struct xarray *, uint32_t, void *, gfp_t); +void *__xa_store(struct xarray *, uint32_t, void *, gfp_t); +bool __xa_empty(struct xarray *); +void *__xa_next(struct xarray *, unsigned long *, bool); + +static inline int +xa_err(void *ptr) +{ + return (PTR_ERR_OR_ZERO(ptr)); +} + +#endif /* _LINUX_XARRAY_H_ */ Added: head/sys/compat/linuxkpi/common/src/linux_xarray.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/src/linux_xarray.c Thu Aug 27 10:28:12 2020 (r364860) @@ -0,0 +1,391 @@ +/*- + * Copyright (c) 2020 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +/* + * This function removes the element at the given index and returns + * the pointer to the removed element, if any. + */ +void * +__xa_erase(struct xarray *xa, uint32_t index) +{ + XA_ASSERT_LOCKED(xa); + + return (radix_tree_delete(&xa->root, index)); +} + +void * +xa_erase(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = __xa_erase(xa, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This function returns the element pointer at the given index. A + * value of NULL is returned if the element does not exist. + */ +void * +xa_load(struct xarray *xa, uint32_t index) +{ + void *retval; + + xa_lock(xa); + retval = radix_tree_lookup(&xa->root, index); + xa_unlock(xa); + + return (retval); +} + +/* + * This is an internal function used to sleep until more memory + * becomes available. + */ +static void +xa_vm_wait_locked(struct xarray *xa) +{ + xa_unlock(xa); + vm_wait(NULL); + xa_lock(xa); +} + +/* + * This function iterates the xarray until it finds a free slot where + * it can insert the element pointer to by "ptr". It starts at the + * index pointed to by "pindex" and updates this value at return. The + * "mask" argument defines the maximum index allowed, inclusivly, and + * must be a power of two minus one value. The "gfp" argument + * basically tells if we can wait for more memory to become available + * or not. This function returns zero upon success or a negative error + * code on failure. A typical error code is -ENOMEM which means either + * the xarray is full, or there was not enough internal memory + * available to complete the radix tree insertion. + */ +int +__xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); + + /* mask cannot be zero */ + MPASS(mask != 0); + + /* mask can be any power of two value minus one */ + MPASS((mask & (mask + 1)) == 0); + + *pindex = 0; +retry: + retval = radix_tree_insert(&xa->root, *pindex, ptr); + + switch (retval) { + case -EEXIST: + if (likely(*pindex != mask)) { + (*pindex)++; + goto retry; + } + retval = -ENOMEM; + break; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + return (retval); +} + +int +xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_alloc(xa, pindex, ptr, mask, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function works the same like the "xa_alloc" function, except + * it wraps the next index value to zero when there are no entries + * left at the end of the xarray searching for a free slot from the + * beginning of the array. If the xarray is full -ENOMEM is returned. + */ +int +__xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, + uint32_t *pnext_index, gfp_t gfp) +{ + int retval; + int timeout = 1; + + XA_ASSERT_LOCKED(xa); + + /* mask cannot be zero */ + MPASS(mask != 0); + + /* mask can be any power of two value minus one */ + MPASS((mask & (mask + 1)) == 0); + + *pnext_index = 0; +retry: + retval = radix_tree_insert(&xa->root, *pnext_index, ptr); + + switch (retval) { + case -EEXIST: + if (unlikely(*pnext_index == mask) && !timeout--) { + retval = -ENOMEM; + break; + } + (*pnext_index)++; + (*pnext_index) &= mask; + goto retry; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + *pindex = *pnext_index; + + return (retval); +} + +int +xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, + uint32_t *pnext_index, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_alloc_cyclic(xa, pindex, ptr, mask, pnext_index, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function tries to insert an element at the given index. The + * "gfp" argument basically decides of this function can sleep or not + * trying to allocate internal memory for its radix tree. The + * function returns an error code upon failure. Typical error codes + * are element exists (-EEXIST) or out of memory (-ENOMEM). + */ +int +__xa_insert(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); +retry: + retval = radix_tree_insert(&xa->root, index, ptr); + + switch (retval) { + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + break; + default: + break; + } + return (retval); +} + +int +xa_insert(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + xa_lock(xa); + retval = __xa_insert(xa, index, ptr, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function updates the element at the given index and returns a + * pointer to the old element. The "gfp" argument basically decides of + * this function can sleep or not trying to allocate internal memory + * for its radix tree. The function returns an XA_ERROR() pointer code + * upon failure. Code using this function must always check if the + * return value is an XA_ERROR() code before using the returned value. + */ +void * +__xa_store(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + int retval; + + XA_ASSERT_LOCKED(xa); +retry: + retval = radix_tree_store(&xa->root, index, &ptr); + + switch (retval) { + case 0: + break; + case -ENOMEM: + if (likely(gfp & M_WAITOK)) { + xa_vm_wait_locked(xa); + goto retry; + } + ptr = XA_ERROR(retval); + break; + default: + ptr = XA_ERROR(retval); + break; + } + return (ptr); +} + +void * +xa_store(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) +{ + void *retval; + + xa_lock(xa); + retval = __xa_store(xa, index, ptr, gfp); + xa_unlock(xa); + + return (retval); +} + +/* + * This function initialize an xarray structure. + */ +void +xa_init_flags(struct xarray *xa, uint32_t flags) +{ + memset(xa, 0, sizeof(*xa)); + + mtx_init(&xa->mtx, "lkpi-xarray", NULL, MTX_DEF | MTX_RECURSE); + xa->root.gfp_mask = GFP_NOWAIT; +} + +/* + * This function destroys an xarray structure and all its internal + * memory and locks. + */ +void +xa_destroy(struct xarray *xa) +{ + struct radix_tree_iter iter; + void **ppslot; + + radix_tree_for_each_slot(ppslot, &xa->root, &iter, 0) + radix_tree_iter_delete(&xa->root, &iter, ppslot); + mtx_destroy(&xa->mtx); +} + +/* + * This function checks if an xarray is empty or not. + * It returns true if empty, else false. + */ +bool +__xa_empty(struct xarray *xa) +{ + struct radix_tree_iter iter = {}; + void **temp; + + XA_ASSERT_LOCKED(xa); + + return (!radix_tree_iter_find(&xa->root, &iter, &temp)); +} + +bool +xa_empty(struct xarray *xa) +{ + bool retval; + + xa_lock(xa); + retval = __xa_empty(xa); + xa_unlock(xa); + + return (retval); +} + +/* + * This function returns the next valid xarray entry based on the + * index given by "pindex". The valued pointed to by "pindex" is + * updated before return. + */ +void * +__xa_next(struct xarray *xa, unsigned long *pindex, bool not_first) +{ + struct radix_tree_iter iter = { .index = *pindex }; + void **ppslot; + void *retval; + bool found; + + XA_ASSERT_LOCKED(xa); + + if (not_first) { + /* advance to next index, if any */ + iter.index++; + if (iter.index == 0) + return (NULL); + } + + found = radix_tree_iter_find(&xa->root, &iter, &ppslot); + if (likely(found)) { + retval = *ppslot; + *pindex = iter.index; + } else { + retval = NULL; + } + return (retval); +} + +void * +xa_next(struct xarray *xa, unsigned long *pindex, bool not_first) +{ + void *retval; + + xa_lock(xa); + retval = __xa_next(xa, pindex, not_first); + xa_unlock(xa); + + return (retval); +} Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 27 08:08:49 2020 (r364859) +++ head/sys/conf/files Thu Aug 27 10:28:12 2020 (r364860) @@ -4534,6 +4534,8 @@ compat/linuxkpi/common/src/linux_usb.c optional compa compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_xarray.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_seq_file.c optional compat_linuxkpi | lindebugfs \ compile-with "${LINUXKPI_C}" Modified: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Thu Aug 27 08:08:49 2020 (r364859) +++ head/sys/modules/linuxkpi/Makefile Thu Aug 27 10:28:12 2020 (r364860) @@ -19,7 +19,8 @@ SRCS= linux_compat.c \ linux_slab.c \ linux_tasklet.c \ linux_usb.c \ - linux_work.c + linux_work.c \ + linux_xarray.c SRCS+= ${LINUXKPI_GENSRCS} From owner-svn-src-head@freebsd.org Thu Aug 27 13:05:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2E8A3B0B97; Thu, 27 Aug 2020 13:05:41 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcjdd6B2tz4ZkV; Thu, 27 Aug 2020 13:05:41 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8AF624792; Thu, 27 Aug 2020 13:05:41 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RD5fCI003234; Thu, 27 Aug 2020 13:05:41 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RD5fCL003233; Thu, 27 Aug 2020 13:05:41 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008271305.07RD5fCL003233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 27 Aug 2020 13:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364861 - in head: cddl/lib/libzfs share/mk X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: cddl/lib/libzfs share/mk X-SVN-Commit-Revision: 364861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:05:42 -0000 Author: freqlabs Date: Thu Aug 27 13:05:41 2020 New Revision: 364861 URL: https://svnweb.freebsd.org/changeset/base/364861 Log: libzfs: Add missing crypto dependency libzfs_crypto.c uses PKCS5_PBKDF2_HMAC_SHA1 from libcrypto. Reported by: John Kennedy Sponsored by: iXsystems, Inc. Modified: head/cddl/lib/libzfs/Makefile head/share/mk/src.libnames.mk Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Thu Aug 27 10:28:12 2020 (r364860) +++ head/cddl/lib/libzfs/Makefile Thu Aug 27 13:05:41 2020 (r364861) @@ -12,7 +12,21 @@ PACKAGE= runtime LIB= zfs -LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core zutil +LIBADD= \ + avl \ + bsdxml \ + crypto \ + geom \ + m \ + md \ + nvpair \ + pthread \ + umem \ + util \ + uutil \ + z \ + zfs_core \ + zutil INCS= libzfs.h USER_C = \ Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Thu Aug 27 10:28:12 2020 (r364860) +++ head/share/mk/src.libnames.mk Thu Aug 27 13:05:41 2020 (r364861) @@ -382,7 +382,7 @@ _DP_fifolog= z _DP_ipf= kvm _DP_tpool= spl _DP_uutil= avl spl -_DP_zfs= md pthread umem util uutil m avl bsdxml geom nvpair \ +_DP_zfs= md pthread umem util uutil m avl bsdxml crypto geom nvpair \ z zfs_core zutil _DP_zfs_core= nvpair _DP_zpool= md pthread z icp spl nvpair avl umem From owner-svn-src-head@freebsd.org Thu Aug 27 13:12:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E13BD3B127A; Thu, 27 Aug 2020 13:12:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcjnW5hgxz4Zy8; Thu, 27 Aug 2020 13:12:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A65F52B4E1; Thu, 27 Aug 2020 13:12:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id n129so5769572qkd.6; Thu, 27 Aug 2020 06:12:31 -0700 (PDT) X-Gm-Message-State: AOAM530CiufwmsJnAvMkYjmPKRDXY+peayCfeUfmxk+uroaVItXvnNeX TEHhcrBN1dFZBJI3oHu3omBxGshJYHJXBb+ByGA= X-Google-Smtp-Source: ABdhPJz1IIpmnL9hc0IC4RIpGikWFJwDIUSOEfYyeVX+0BsoFfPO6xIvUKBrCPBXhshHFylsatpSO9f3HHMk/FyrvLY= X-Received: by 2002:a05:620a:12ef:: with SMTP id f15mr19280670qkl.120.1598533951329; Thu, 27 Aug 2020 06:12:31 -0700 (PDT) MIME-Version: 1.0 References: <202008271305.07RD5fCL003233@repo.freebsd.org> In-Reply-To: <202008271305.07RD5fCL003233@repo.freebsd.org> From: Kyle Evans Date: Thu, 27 Aug 2020 08:12:19 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364861 - in head: cddl/lib/libzfs share/mk To: Ryan Moeller Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:12:31 -0000 On Thu, Aug 27, 2020 at 8:05 AM Ryan Moeller wrote: > > Author: freqlabs > Date: Thu Aug 27 13:05:41 2020 > New Revision: 364861 > URL: https://svnweb.freebsd.org/changeset/base/364861 > > Log: > libzfs: Add missing crypto dependency > > libzfs_crypto.c uses PKCS5_PBKDF2_HMAC_SHA1 from libcrypto. > Hmm, interesting; I think this needs an __L dependency in ^/Makefile.inc1 as well, since they're both part of _prebuild_libs if MK_CRYPT+MK_OPENSSL+MK_ZFS. From owner-svn-src-head@freebsd.org Thu Aug 27 13:20:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0F873B1827; Thu, 27 Aug 2020 13:20:13 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcjyP5k1Mz4bmb; Thu, 27 Aug 2020 13:20:13 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3a495.dip0.t-ipconnect.de [79.211.164.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 517E32ACE0; Thu, 27 Aug 2020 13:20:13 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Thu, 27 Aug 2020 15:20:14 +0200 From: Gordon Bergling To: Hiroki Sato Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364449 - head/bin/ls Message-ID: <20200827132014.GA65182@lion.0xfce3.net> References: <202008210620.07L6KC6M091289@repo.freebsd.org> <20200822.194438.808130473746317382.hrs@FreeBSD.org> <20200824085223.GA28970@lion.0xfce3.net> <20200825.232147.141648624023404568.hrs@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20200825.232147.141648624023404568.hrs@FreeBSD.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 2:17PM up 15 days, 15:46, 3 users, load averages: 4.06, 4.07, 4.03 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:20:13 -0000 --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 25, 2020 at 11:21:47PM +0900, Hiroki Sato wrote: > Gordon Bergling wrote > in <20200824085223.GA28970@lion.0xfce3.net>: >=20 > gb> thanks for your feedback. I can only define POSIX.1-200{1,8} or -susv= 4. So what > gb> do you think about the following STANDARDS section? > gb>=20 > gb> For the options that are non-existing I could correct them to -2001 a= nd mention > gb> also -susv4. > gb>=20 > gb> STANDARDS > gb> With the exception of options -g, -n and -o, the ls utility conf= orms to > gb> IEEE Std 1003.1-2001 (=E2=80=9CPOSIX.1=E2=80=9D) and Version=C2= =A04 of the Single UNIX > gb> Specification (=E2=80=9CSUSv4=E2=80=9D). The options -B, -D, -G= , -I, -T, -U, -W, -Z, -b, > gb> -h, -w, -y and -, are compatible extensions not defined in IEEE = Std > gb> 1003.1-2001 (=E2=80=9CPOSIX.1=E2=80=9D). >=20 > It might be a bit tedious, but just adding -2008 looks good to me > like the following: >=20 > |.St -p1003.1-2001 > |and > |.St -p1003.1-2008 . >=20 > p1003.1-2004 is a subset of SUSv3 (and -2008 is one of SUSv4), so > using p1003.1-YYYY consistently sounds less confusing when describing > the conformance within the subsets. >=20 > Regarding the non-standard extensions, I am not sure what > "compatible" means. Some of them are extensions commonly seen on > other BSD-derived OSes, some are available only on FreeBSD, and some > have the same names with GNU's counterpart but different meanings. > Is just mentioning "...are non-standard extensions" with no > specification name sufficient and easier? I have no strong opinion > on that part, but this is just my two cents. >=20 > -- Hiroki I followed your suggestions and created the following differential for further discussions. https://reviews.freebsd.org/D26210 --Gordon --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAl9HswxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09zYpAgAvq9kQo4AgQwWdfnwkHj1mrZL4PYi3wVPSsq9Dmf4hBBtmLjkrjiE5iOy 1FoHgZl576Sr6GOAGWVVay8mdBMjCc2rPudZHcxmQ9cmKthyO4Iby1R46tpXuvU0 DvehfLfIq7dKpDq61kVFj1ldi8W7iCmJ3J8UzhAdZYbd+uE4zL9vX49t6oWpwJCS 5EMt86p9dL9pT3OJz4DZN9cNCk4W+qEupRj6GFXr4l8eTXnhiUwBOI5vbzTPhIXK x0j8RRxPORO6egseyR4+zA/ocwRnPjuIBSAQndSWUOhYvtPkUHhhxAe8CYqpxdJv lZsr501gum2Kcp5Jxfq+1U1nxUvPdw== =eXIV -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6-- From owner-svn-src-head@freebsd.org Thu Aug 27 13:26:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 991FD3B1762; Thu, 27 Aug 2020 13:26:37 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bck5n3ffXz4cWZ; Thu, 27 Aug 2020 13:26:37 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6043924847; Thu, 27 Aug 2020 13:26:37 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RDQbDK016045; Thu, 27 Aug 2020 13:26:37 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RDQbGd016044; Thu, 27 Aug 2020 13:26:37 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008271326.07RDQbGd016044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 27 Aug 2020 13:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364863 - head X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:26:37 -0000 Author: freqlabs Date: Thu Aug 27 13:26:36 2020 New Revision: 364863 URL: https://svnweb.freebsd.org/changeset/base/364863 Log: libzfs: Also add the crypto dependency to Makefile.inc1 Reported by: kevans Discussed with: kevans Sponsored by: iXsystems, Inc. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 27 13:25:24 2020 (r364862) +++ head/Makefile.inc1 Thu Aug 27 13:26:36 2020 (r364863) @@ -2929,6 +2929,7 @@ cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__ cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L cddl/lib/libzfs__L: cddl/lib/libnvpair__L cddl/lib/libzutil__L +cddl/lib/libzfs__L: secure/lib/libcrypto__L lib/libbe__L: cddl/lib/libzfs__L .endif From owner-svn-src-head@freebsd.org Thu Aug 27 13:50:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D63B03B25A1; Thu, 27 Aug 2020 13:50:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BckdC16Thz4dtD; Thu, 27 Aug 2020 13:50:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id BIIEkwq27ng7KBIIGk57tA; Thu, 27 Aug 2020 07:50:20 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=bIl-2ox-_QApRB5rmloA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 58AF216C; Thu, 27 Aug 2020 06:50:18 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07RDoGqn055838; Thu, 27 Aug 2020 06:50:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008271350.07RDoGqn055838@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andriy Gapon cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d In-reply-to: <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> Comments: In-reply-to Andriy Gapon message dated "Thu, 27 Aug 2020 11:54:02 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Aug 2020 06:50:16 -0700 X-CMAE-Envelope: MS4wfOJ0aGetAk7Vp1O7f/DECEji61e7MZq2o5qXZC7SPsnCdsf/P/r2xaOP60e6kng9iVKmxAOJ+//mf+Y3Y2W9BUTcKqGkd2BNiRJdjv+6x30JhRN8DYRp a+cC3K5OAi3HrQPa7N1tcd1UATQsBQhhc00ks9EoVgg45fNdpUN7e4McY8PQ6IgJLyDsumDSJi31BGo0claPbAGrQEI+CDrvV/HiesCH3LKPPLjDBjZ7ToVb CZW/s9Pmj90Td5m+V+s/3xFOkUPMbxvs117wAKMxzOkw8w0omDc6CxbynJsqZ3MiwT/JYdf77glCLgKERNyk4A== X-Rspamd-Queue-Id: 4BckdC16Thz4dtD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:50:23 -0000 In message <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org>, Andriy Gapon wri tes: > On 26/08/2020 16:13, Cy Schubert wrote: > > Author: cy > > Date: Wed Aug 26 13:13:57 2020 > > New Revision: 364817 > > URL: https://svnweb.freebsd.org/changeset/base/364817 > > > > Log: > > As of r364746 (OpenZFS import) existing ZPOOLs are not imported > > prior to zvol and mountcritlocal resulting in ZVOLs (swap and > > I probably missed some discussion, so I am curious why that is. This is because r364746 added the code below to rc.d/zfs and by then it was too late. I simply moved it to a new file that allowed rc.d/zvol and rc.d/mountcritlocal with legacy mounts to work again. This was copied from rc.d/zfs, which was added by r364746. There was no need for a zpool import under the previous version of ZFS, whereas it appears that OpenZFS requires it. > > > virtual machine UFS filesystems) being unavailable, leading to > > boot failures. > > We move the zpool import from zfs to a new zpool script, with the > > -N option to avoid mounting datasets while making the ZPOOL's > > datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs > > available for subsequent use for swap (in the zvol rc sript) or > > for UFS or other filesystems in fstab(5), mounted by mountcritlocal. > > > > Reviewed by: freqlabs (previous version) > > Differential Revision: https://reviews.freebsd.org/D26185 > > > > Added: > > head/libexec/rc/rc.d/zpool (contents, props changed) > [snip] > > +zpool_start() > > +{ > > + local cachefile > > + > > + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do > > + if [ -r $cachefile ]; then > > + zpool import -c $cachefile -a -N > > I would add a break here, so that pools are imported either from one cache fi > le > or the other but not both. It makes sense to have two cache file definitions > for migration, but I think that it does not make sense to split pools between > the cache files. Agreed. > > > + fi > > + done > > +} > > > -- > Andriy Gapon -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Aug 27 13:54:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FB963B29C8; Thu, 27 Aug 2020 13:54:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bckk04kmMz4fNj; Thu, 27 Aug 2020 13:54:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id BIMHkYwsS695cBIMJkPRxo; Thu, 27 Aug 2020 07:54:31 -0600 X-Authority-Analysis: v=2.3 cv=fZA2N3YF c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=BHo-iyq49Ao6tAWaz-oA:9 a=CjuIK1q_8ugA:10 a=2Q2bHuj3vkAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 84CA01C1; Thu, 27 Aug 2020 06:54:29 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07RDsTeW084744; Thu, 27 Aug 2020 06:54:29 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008271354.07RDsTeW084744@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andriy Gapon cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d In-reply-to: <202008271350.07RDoGqn055838@slippy.cwsent.com> References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 27 Aug 2020 06:50:16 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Aug 2020 06:54:29 -0700 X-CMAE-Envelope: MS4wfETUKaKvp5rGlPB4NdPS0RZuUx0vqXg1CTEnzsUTzM8URlbqFbRs8u4Yd8pU1pgv6Mtp8PKOOI85a+VT1RFDt2XpeGGCUu540tHtlBWIMpZg1mETSPqS tdzCt16s5VMj6eu1SaPWV5Hk1rzqbr94GT4O9XjBfDbqcqaMj4+Lgir/mnQNG2iPlYFWtFbcYqdJSA7VrhcMd9RbeyGT4UlY0kyxPtRiaSjnutsq+iyOhUVW vmed8oyZ7UfzpUzbNtxSbGoisL0rJ3O9dnWI0auqFSkbnRjW/5ZnSsGY/Vn9NqWLp4zSYFeN+TCxqePmbl4xwg== X-Rspamd-Queue-Id: 4Bckk04kmMz4fNj X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [1.67 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; ARC_NA(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.09)[-0.090]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.27)[0.269]; NEURAL_SPAM_MEDIUM(0.19)[0.195]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.137:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 13:54:34 -0000 In message <202008271350.07RDoGqn055838@slippy.cwsent.com>, Cy Schubert writes: > In message <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org>, Andriy Gapon > wri > tes: > > On 26/08/2020 16:13, Cy Schubert wrote: > > > Author: cy > > > Date: Wed Aug 26 13:13:57 2020 > > > New Revision: 364817 > > > URL: https://svnweb.freebsd.org/changeset/base/364817 > > > > > > Log: > > > As of r364746 (OpenZFS import) existing ZPOOLs are not imported > > > prior to zvol and mountcritlocal resulting in ZVOLs (swap and > > > > I probably missed some discussion, so I am curious why that is. > > This is because r364746 added the code below to rc.d/zfs and by then it was > too late. I simply moved it to a new file that allowed rc.d/zvol and > rc.d/mountcritlocal with legacy mounts to work again. This was copied from > rc.d/zfs, which was added by r364746. There was no need for a zpool import > under the previous version of ZFS, whereas it appears that OpenZFS requires > it. Let me add, one could say this is a regression. > > > > > > virtual machine UFS filesystems) being unavailable, leading to > > > boot failures. > > > We move the zpool import from zfs to a new zpool script, with the > > > -N option to avoid mounting datasets while making the ZPOOL's > > > datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs > > > available for subsequent use for swap (in the zvol rc sript) or > > > for UFS or other filesystems in fstab(5), mounted by mountcritlocal. > > > > > > Reviewed by: freqlabs (previous version) > > > Differential Revision: https://reviews.freebsd.org/D26185 > > > > > > Added: > > > head/libexec/rc/rc.d/zpool (contents, props changed) > > [snip] > > > +zpool_start() > > > +{ > > > + local cachefile > > > + > > > + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do > > > + if [ -r $cachefile ]; then > > > + zpool import -c $cachefile -a -N > > > > I would add a break here, so that pools are imported either from one cache > fi > > le > > or the other but not both. It makes sense to have two cache file definitio > ns > > for migration, but I think that it does not make sense to split pools betwe > en > > the cache files. > > Agreed. > > > > > > + fi > > > + done > > > +} > > > > > > -- > > Andriy Gapon -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Aug 27 14:03:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FB923B38E8; Thu, 27 Aug 2020 14:03:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BckwP6sm4z3S6F; Thu, 27 Aug 2020 14:03:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id BIV1kYzcu695cBIV2kPTaZ; Thu, 27 Aug 2020 08:03:32 -0600 X-Authority-Analysis: v=2.3 cv=fZA2N3YF c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=REGUHbn5vBxifwaQ5q0A:9 a=CjuIK1q_8ugA:10 a=wak2c0yCqP4A:10 a=2Q2bHuj3vkAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id AD29F1E3; Thu, 27 Aug 2020 07:03:30 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07RE3U56090900; Thu, 27 Aug 2020 07:03:30 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008271403.07RE3U56090900@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Andriy Gapon , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d In-reply-to: <202008271354.07RDsTeW084744@slippy.cwsent.com> References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 27 Aug 2020 06:54:29 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Aug 2020 07:03:30 -0700 X-CMAE-Envelope: MS4wfGIZt2q0BAjZ0xfVqzK1FOe3170e+knqFlNCY6KROSo9NMhSi7CvwgmU9LfmkRuj7CIXA48u5fKf59tvQPQSu9RjffjfdXsvDz+0kS08AU+DcUB6dX7K l3XSZH1KhpAOnAj7M4XiLXTSx//3mQi6P3rTJrgsmTRuAJ0Za14T1/6NUcrB0auq6KuNPakDlGpdP5+CUZ0ricbP1LUp/pfxdppYMgJEGgUBNQ7jLa4AdDqb p5LOn63lUYm6bNebgxD2D7rTxTlHG0bTm7CZjOW4pB5dH5IVtVQPGHTx3WKiDxZUveEglFvxan+FA77b7FOl3A== X-Rspamd-Queue-Id: 4BckwP6sm4z3S6F X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [0.86 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; RECEIVED_SPAMHAUS_PBL(0.00)[70.67.125.17:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[64.59.136.138:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.29)[-0.293]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.07)[0.074]; NEURAL_HAM_LONG(-0.22)[-0.223]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[64.59.136.138:from]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 14:03:35 -0000 What would you suggest in this case, where /etc/zfs/zpool.cache is newer than /boot/zfs/zpool.cache? slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache slippy$ Something like, for I in $(ls -t /etc/zfs/zpool.cache /boot/zfs/zpool.cache) with the break? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message <202008271354.07RDsTeW084744@slippy.cwsent.com>, Cy Schubert writes: > In message <202008271350.07RDoGqn055838@slippy.cwsent.com>, Cy Schubert > writes: > > In message <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org>, Andriy Gapon > > > wri > > tes: > > > On 26/08/2020 16:13, Cy Schubert wrote: > > > > Author: cy > > > > Date: Wed Aug 26 13:13:57 2020 > > > > New Revision: 364817 > > > > URL: https://svnweb.freebsd.org/changeset/base/364817 > > > > > > > > Log: > > > > As of r364746 (OpenZFS import) existing ZPOOLs are not imported > > > > prior to zvol and mountcritlocal resulting in ZVOLs (swap and > > > > > > I probably missed some discussion, so I am curious why that is. > > > > This is because r364746 added the code below to rc.d/zfs and by then it was > > > too late. I simply moved it to a new file that allowed rc.d/zvol and > > rc.d/mountcritlocal with legacy mounts to work again. This was copied from > > rc.d/zfs, which was added by r364746. There was no need for a zpool import > > under the previous version of ZFS, whereas it appears that OpenZFS requires > > > it. > > Let me add, one could say this is a regression. > > > > > > > > > > virtual machine UFS filesystems) being unavailable, leading to > > > > boot failures. > > > > We move the zpool import from zfs to a new zpool script, with the > > > > -N option to avoid mounting datasets while making the ZPOOL's > > > > datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs > > > > available for subsequent use for swap (in the zvol rc sript) or > > > > for UFS or other filesystems in fstab(5), mounted by mountcritlocal. > > > > > > > > Reviewed by: freqlabs (previous version) > > > > Differential Revision: https://reviews.freebsd.org/D26185 > > > > > > > > Added: > > > > head/libexec/rc/rc.d/zpool (contents, props changed) > > > [snip] > > > > +zpool_start() > > > > +{ > > > > + local cachefile > > > > + > > > > + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do > > > > + if [ -r $cachefile ]; then > > > > + zpool import -c $cachefile -a -N > > > > > > I would add a break here, so that pools are imported either from one cach > e > > fi > > > le > > > or the other but not both. It makes sense to have two cache file definit > io > > ns > > > for migration, but I think that it does not make sense to split pools bet > we > > en > > > the cache files. > > > > Agreed. > > > > > > > > > + fi > > > > + done > > > > +} > > > > > > > > > -- > > > Andriy Gapon > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > The need of the many outweighs the greed of the few. > From owner-svn-src-head@freebsd.org Thu Aug 27 14:05:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D7553B3A7A; Thu, 27 Aug 2020 14:05:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bckyl2HYJz3SCs; Thu, 27 Aug 2020 14:05:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2CE5A2B1CD; Thu, 27 Aug 2020 14:05:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f174.google.com with SMTP id o196so5395138qke.8; Thu, 27 Aug 2020 07:05:35 -0700 (PDT) X-Gm-Message-State: AOAM532OZPKn76eR42evKR67bpkXmr2LVz14mwAjHACdNfbJhbsK0/WF 4zY5kcTPm4p5GrWf0ch58i73NK018UCdbeIWy2o= X-Google-Smtp-Source: ABdhPJwItZLo8FW+0XSmZ3nE8lSPp/HH66X5J1a3d9okvmalcfdFeRIfFs+pIAW6dNM5IH+u58elFdiHfldfxhffoOA= X-Received: by 2002:a37:6155:: with SMTP id v82mr18290781qkb.34.1598537134708; Thu, 27 Aug 2020 07:05:34 -0700 (PDT) MIME-Version: 1.0 References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> In-Reply-To: <202008271403.07RE3U56090900@slippy.cwsent.com> From: Kyle Evans Date: Thu, 27 Aug 2020 09:05:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Cy Schubert Cc: Andriy Gapon , Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 14:05:35 -0000 On Thu, Aug 27, 2020 at 9:03 AM Cy Schubert wrote: > > What would you suggest in this case, where /etc/zfs/zpool.cache is newer > than /boot/zfs/zpool.cache? > > slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache > -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache > -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache > slippy$ > > Something like, for I in $(ls -t /etc/zfs/zpool.cache > /boot/zfs/zpool.cache) with the break? > /etc/zfs/zpool.cache is the new location and should generally be favored if it exists, I reckon. From owner-svn-src-head@freebsd.org Thu Aug 27 14:07:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E165E3B3E97 for ; Thu, 27 Aug 2020 14:07:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcl0X5Wx7z3SRw for ; Thu, 27 Aug 2020 14:07:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 744D32A570 for ; Thu, 27 Aug 2020 14:07:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f170.google.com with SMTP id k18so4564516qtm.10 for ; Thu, 27 Aug 2020 07:07:08 -0700 (PDT) X-Gm-Message-State: AOAM530KaQ7lLvlFq4l0iHx+9qEnbbul9U7Ys+QSCretjawrACEXThYT ODxWKrOjIn1y/iEnK8mXUNCz7gTAmkrntjPkIjs= X-Received: by 2002:ac8:6052:: with SMTP id k18mt18770614qtm.60.1598537227998; Thu, 27 Aug 2020 07:07:07 -0700 (PDT) MIME-Version: 1.0 References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> In-Reply-To: From: Kyle Evans Date: Thu, 27 Aug 2020 09:06:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d Cc: Cy Schubert , Andriy Gapon , Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 14:07:08 -0000 On Thu, Aug 27, 2020 at 9:05 AM Kyle Evans wrote: > > On Thu, Aug 27, 2020 at 9:03 AM Cy Schubert wrote: > > > > What would you suggest in this case, where /etc/zfs/zpool.cache is newer > > than /boot/zfs/zpool.cache? > > > > slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache > > -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache > > -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache > > slippy$ > > > > Something like, for I in $(ls -t /etc/zfs/zpool.cache > > /boot/zfs/zpool.cache) with the break? > > > > /etc/zfs/zpool.cache is the new location and should generally be > favored if it exists, I reckon. I retract the above. :-) ls -t makes sense. From owner-svn-src-head@freebsd.org Thu Aug 27 14:33:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F5E33B45FF; Thu, 27 Aug 2020 14:33:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BclbH2XjQz3Tyr; Thu, 27 Aug 2020 14:33:47 +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 3ABAB25361; Thu, 27 Aug 2020 14:33:47 +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 07REXlHZ058637; Thu, 27 Aug 2020 14:33:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07REXlqu058636; Thu, 27 Aug 2020 14:33:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008271433.07REXlqu058636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Aug 2020 14:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364867 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 364867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 14:33:47 -0000 Author: cy Date: Thu Aug 27 14:33:46 2020 New Revision: 364867 URL: https://svnweb.freebsd.org/changeset/base/364867 Log: /etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache. Check for it first. Only use /boot/zfs/zpool.cache if the /etc/zfs version is not found and good. Reported by: avg Suggested by: avg, kevans Modified: head/libexec/rc/rc.d/zpool Modified: head/libexec/rc/rc.d/zpool ============================================================================== --- head/libexec/rc/rc.d/zpool Thu Aug 27 14:29:06 2020 (r364866) +++ head/libexec/rc/rc.d/zpool Thu Aug 27 14:33:46 2020 (r364867) @@ -20,9 +20,9 @@ zpool_start() { local cachefile - for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do + for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do if [ -r $cachefile ]; then - zpool import -c $cachefile -a -N + zpool import -c $cachefile -a -N && break fi done } From owner-svn-src-head@freebsd.org Thu Aug 27 15:59:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1882B3B7414; Thu, 27 Aug 2020 15:59:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcnV61Bkqz3b4N; Thu, 27 Aug 2020 15:59:25 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pf1-f180.google.com with SMTP id m71so3852591pfd.1; Thu, 27 Aug 2020 08:59:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=U2LKHxB9zKw54pnLLppK08vNoJGjL7POI3Tl/r9k098=; b=cpYo6b4xAa10CsvPcnKAofJcDMkqubcpmqsCNmFlhyS5PayY7PrrArjKpxhfSznl6q 1RMRgb6dbN/BpdHtjSPiS/AH4FZ+ndKDR94F8fz1kmeCUa6BY0zlOofjhEN6C8KG8M2o MNbpEsdYRV2HfiBe1RcpBoVxK5WMmkxtyv6HrSdfrRpuZeulFU7MNsUPM77B6gk+Sh0j Lwiee4KPCUPtUdNxdkgUDohKgoUPUa7UjUDqMwN8WSHIUHdeF2nLkrduX217X7GIZWhD O/CuE0rwXooJAO+H8/9U1Lhb+PD8Zx+I+ihdP3P+EnQfQ+Hvzd+usjnhwmr7KziwTBCE r0xw== X-Gm-Message-State: AOAM5337wHH4yVFuf+Zmh/tc/wnbShaoKCzkbLmsVPUdR9EydjPXCZ6I K44/A0Ib0NzT7pcodBHPdALh1fXJ888= X-Google-Smtp-Source: ABdhPJzX/OHEDMsyPokvOlTgIOvr0+j2i/oyJ7yalbte9tEeHXojs7XKzPZksaBH35Eb3YoC+NMndQ== X-Received: by 2002:a17:902:690a:: with SMTP id j10mr17233224plk.155.1598543964181; Thu, 27 Aug 2020 08:59:24 -0700 (PDT) Received: from [192.168.0.135] ([195.64.148.76]) by smtp.googlemail.com with ESMTPSA id y196sm3261283pfc.202.2020.08.27.08.59.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Aug 2020 08:59:23 -0700 (PDT) Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Kyle Evans Cc: Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> From: Andriy Gapon Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mDMEXxhZ/BYJKwYBBAHaRw8BAQdAcr09MGWggRAy8POEInH6mCbjrO8kgtRyHbst99gQlvy0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEE+nF8afRo79+kdvKg LcuxURQbv/YFAl8YWfwCGwMFCQlmAYAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQLcux URQbv/b/ngD/cTPdaKXZ8O1KzZ6BwqHuoJEL4qIjT3MiiovorL7WisABALU4NV3jAKu9hgSc Wl1QVjQ1NpzbY5gsMxZbuRlHwfAJuDgEXxhZ/BIKKwYBBAGXVQEFAQEHQKws2uTFgRunZ2Ip 1OYj0+cJOObFTfEDDI9hh2Fed7pFAwEIB4h+BBgWCAAmFiEE+nF8afRo79+kdvKgLcuxURQb v/YFAl8YWfwCGwwFCQlmAYAACgkQLcuxURQbv/apxgD/f6ml+zRTb/uB6zO/e4RS2S+V+rGf CTw551MKSZmkp1sA/2QbLsnmeHrsIPvY5Wn97BMmMQsDu+fxMSagSbSMa7YJ Message-ID: <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> Date: Thu, 27 Aug 2020 18:59:20 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BcnV61Bkqz3b4N X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.43 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.180:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.65)[-0.653]; NEURAL_SPAM_LONG(0.15)[0.154]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.180:from]; NEURAL_HAM_MEDIUM(-0.94)[-0.936]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 15:59:27 -0000 On 2020-08-27 17:06, Kyle Evans wrote: > On Thu, Aug 27, 2020 at 9:05 AM Kyle Evans wrote: >> >> On Thu, Aug 27, 2020 at 9:03 AM Cy Schubert wrote: >>> >>> What would you suggest in this case, where /etc/zfs/zpool.cache is newer >>> than /boot/zfs/zpool.cache? >>> >>> slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache >>> -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache >>> -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache >>> slippy$ >>> >>> Something like, for I in $(ls -t /etc/zfs/zpool.cache >>> /boot/zfs/zpool.cache) with the break? >>> >> >> /etc/zfs/zpool.cache is the new location and should generally be >> favored if it exists, I reckon. > > I retract the above. :-) ls -t makes sense. > I actually was about to agree with your first suggestion. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Aug 27 16:04:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5C203B72F7; Thu, 27 Aug 2020 16:04:09 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcnbX4306z3bGS; Thu, 27 Aug 2020 16:04:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-pg1-f171.google.com with SMTP id 67so3665742pgd.12; Thu, 27 Aug 2020 09:04:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=1rSIm+AXrArXxigZp1X+VBLdH6WpfjWS8T4eqHRvCqM=; b=BIJaLXQDm8kbmv/NSuWLe5IYV9tD38T5FHr0uLtTYxM6nDhoMfV2TPsqV0vSD1iknw ZAIm3ChQSmM09fZMMYpPU/OXesnRgw4zKX8bQurwEBNOzweLRkuwgoBrnK4ll2as3AzU QxzxrRUXF6y97Y4+L3U+nnDHqUxIb1AkK27W81x27IyqfaFkvfA5tyEqHd8LQae0daed kv27Fadqcv9cVmemczRtLCKWOeZILQjIsb4LRqUeaTNLuLp1TtMKI+uJrXkW1wNwPXYg GEvfPG11CG36v+IRVQlUWP4RwfptzCjPnhIo3MXrTu8WgNoNKbM4v74aQgpLdUCFvb2V uhSA== X-Gm-Message-State: AOAM533ImL5MRumqOOxzfZA4a3FvBSb99k5Gv/0acHyes4TWU2Am3kgM R/TG88mjTcqjd5zJsA15ModU+XuK3mc= X-Google-Smtp-Source: ABdhPJwQN2/GWSaMlCBWVIKaBBeKR3mfGIyNcdYyJGacrQuaiTngPjs5AjM2G0hM7nVK5rx+ONaPUg== X-Received: by 2002:a17:902:d681:: with SMTP id v1mr3131361ply.34.1598544246290; Thu, 27 Aug 2020 09:04:06 -0700 (PDT) Received: from [192.168.0.135] ([195.64.148.76]) by smtp.googlemail.com with ESMTPSA id w3sm3452519pff.56.2020.08.27.09.04.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Aug 2020 09:04:05 -0700 (PDT) Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Cy Schubert Cc: Cy Schubert , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> From: Andriy Gapon Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mDMEXxhZ/BYJKwYBBAHaRw8BAQdAcr09MGWggRAy8POEInH6mCbjrO8kgtRyHbst99gQlvy0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEE+nF8afRo79+kdvKg LcuxURQbv/YFAl8YWfwCGwMFCQlmAYAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQLcux URQbv/b/ngD/cTPdaKXZ8O1KzZ6BwqHuoJEL4qIjT3MiiovorL7WisABALU4NV3jAKu9hgSc Wl1QVjQ1NpzbY5gsMxZbuRlHwfAJuDgEXxhZ/BIKKwYBBAGXVQEFAQEHQKws2uTFgRunZ2Ip 1OYj0+cJOObFTfEDDI9hh2Fed7pFAwEIB4h+BBgWCAAmFiEE+nF8afRo79+kdvKgLcuxURQb v/YFAl8YWfwCGwwFCQlmAYAACgkQLcuxURQbv/apxgD/f6ml+zRTb/uB6zO/e4RS2S+V+rGf CTw551MKSZmkp1sA/2QbLsnmeHrsIPvY5Wn97BMmMQsDu+fxMSagSbSMa7YJ Message-ID: <66b4c241-a06e-4f91-f979-c87db45d5435@FreeBSD.org> Date: Thu, 27 Aug 2020 19:04:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <202008271354.07RDsTeW084744@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BcnbX4306z3bGS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.215.171 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.870]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.72)[-0.715]; NEURAL_SPAM_LONG(0.02)[0.025]; RCVD_IN_DNSWL_NONE(0.00)[209.85.215.171:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.215.171:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:04:09 -0000 On 2020-08-27 16:54, Cy Schubert wrote: > In message <202008271350.07RDoGqn055838@slippy.cwsent.com>, Cy Schubert > writes: >> In message <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org>, Andriy Gapon >> wri >> tes: >>> On 26/08/2020 16:13, Cy Schubert wrote: >>>> Author: cy >>>> Date: Wed Aug 26 13:13:57 2020 >>>> New Revision: 364817 >>>> URL: https://svnweb.freebsd.org/changeset/base/364817 >>>> >>>> Log: >>>> As of r364746 (OpenZFS import) existing ZPOOLs are not imported >>>> prior to zvol and mountcritlocal resulting in ZVOLs (swap and >>> >>> I probably missed some discussion, so I am curious why that is. >> >> This is because r364746 added the code below to rc.d/zfs and by then it was >> too late. I simply moved it to a new file that allowed rc.d/zvol and >> rc.d/mountcritlocal with legacy mounts to work again. This was copied from >> rc.d/zfs, which was added by r364746. There was no need for a zpool import >> under the previous version of ZFS, whereas it appears that OpenZFS requires >> it. > > Let me add, one could say this is a regression. Yes, I was actually curious about this change in ZFS driver behavior. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Aug 27 16:20:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 160EB3B7A87; Thu, 27 Aug 2020 16:20:12 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcny36tM4z3cLB; Thu, 27 Aug 2020 16:20:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CA6A82C151; Thu, 27 Aug 2020 16:20:11 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id u3so6361718qkd.9; Thu, 27 Aug 2020 09:20:11 -0700 (PDT) X-Gm-Message-State: AOAM531Rw/ultIw0sXu7v8XAFzzp7ZjYWJ83FCLwStBEkt64WO4+CqcL P0LRwVuOxzOC1t78z3xKRbsISNwwXvzpG0lAols= X-Google-Smtp-Source: ABdhPJxNZl1LRUG61OB5qYLtrcwC/M9bYjs+meLMwAqA/Q6ocBmE0dW4m00buISqrw1TY1izOr5902tcBZXPifDXVPg= X-Received: by 2002:a05:620a:24d5:: with SMTP id m21mr2673187qkn.103.1598545211467; Thu, 27 Aug 2020 09:20:11 -0700 (PDT) MIME-Version: 1.0 References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> In-Reply-To: <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> From: Kyle Evans Date: Thu, 27 Aug 2020 11:19:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Andriy Gapon Cc: Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:20:12 -0000 On Thu, Aug 27, 2020 at 10:59 AM Andriy Gapon wrote: > > On 2020-08-27 17:06, Kyle Evans wrote: > > On Thu, Aug 27, 2020 at 9:05 AM Kyle Evans wrote: > >> > >> On Thu, Aug 27, 2020 at 9:03 AM Cy Schubert wrote: > >>> > >>> What would you suggest in this case, where /etc/zfs/zpool.cache is newer > >>> than /boot/zfs/zpool.cache? > >>> > >>> slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache > >>> -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache > >>> -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache > >>> slippy$ > >>> > >>> Something like, for I in $(ls -t /etc/zfs/zpool.cache > >>> /boot/zfs/zpool.cache) with the break? > >>> > >> > >> /etc/zfs/zpool.cache is the new location and should generally be > >> favored if it exists, I reckon. > > > > I retract the above. :-) ls -t makes sense. > > > > I actually was about to agree with your first suggestion. > I think it's the correct long-term solution, but it kind of depends on what we're thinking now- if we expect one might test-boot a disk on an older FreeBSD/ZFS that's still using /boot, there's a chance it will contain the more recent data. From owner-svn-src-head@freebsd.org Thu Aug 27 16:34:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C6F33B7FDE; Thu, 27 Aug 2020 16:34:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcpGP0x95z3df9; Thu, 27 Aug 2020 16:34:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0438826F89; Thu, 27 Aug 2020 16:34:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RGYKFx033320; Thu, 27 Aug 2020 16:34:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RGYKu8033319; Thu, 27 Aug 2020 16:34:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008271634.07RGYKu8033319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 27 Aug 2020 16:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364871 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 364871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:34:21 -0000 Author: markj Date: Thu Aug 27 16:34:20 2020 New Revision: 364871 URL: https://svnweb.freebsd.org/changeset/base/364871 Log: asmc(4): Handle errors from asmc_key_read() properly. asmc_key_read() returns only 0 and 1, some callers were checking incorrectly for failure. PR: 248939 Submitted by: Tong Zhang MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Thu Aug 27 14:51:44 2020 (r364870) +++ head/sys/dev/asmc/asmc.c Thu Aug 27 16:34:20 2020 (r364871) @@ -1073,7 +1073,7 @@ asmc_fan_count(device_t dev) { uint8_t buf[1]; - if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, sizeof buf) < 0) + if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, sizeof buf) != 0) return (-1); return (buf[0]); @@ -1087,7 +1087,7 @@ asmc_fan_getvalue(device_t dev, const char *key, int f char fankey[5]; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) + if (asmc_key_read(dev, fankey, buf, sizeof buf) != 0) return (-1); speed = (buf[0] << 6) | (buf[1] >> 2); @@ -1101,7 +1101,7 @@ asmc_fan_getstring(device_t dev, const char *key, int char* desc; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, buflen) < 0) + if (asmc_key_read(dev, fankey, buf, buflen) != 0) return (NULL); desc = buf+4; @@ -1240,7 +1240,7 @@ asmc_temp_getvalue(device_t dev, const char *key) /* * Check for invalid temperatures. */ - if (asmc_key_read(dev, key, buf, sizeof buf) < 0) + if (asmc_key_read(dev, key, buf, sizeof buf) != 0) return (-1); return (buf[0]); From owner-svn-src-head@freebsd.org Thu Aug 27 16:34:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A88373B7F7A; Thu, 27 Aug 2020 16:34:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcpGf455xz3dlr; Thu, 27 Aug 2020 16:34:34 +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 701D32700A; Thu, 27 Aug 2020 16:34:34 +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 07RGYYUm033391; Thu, 27 Aug 2020 16:34:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RGYYl7033390; Thu, 27 Aug 2020 16:34:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008271634.07RGYYl7033390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 27 Aug 2020 16:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364872 - head/sys/dev/fdc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/fdc X-SVN-Commit-Revision: 364872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:34:34 -0000 Author: markj Date: Thu Aug 27 16:34:33 2020 New Revision: 364872 URL: https://svnweb.freebsd.org/changeset/base/364872 Log: fdc(4): Handle errors from fdc_in() properly. fdc_in() returns only 0 and 1, some callers were checking incorrectly for failure. PR: 248940 Submitted by: Tong Zhang MFC after: 1 week Modified: head/sys/dev/fdc/fdc.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Thu Aug 27 16:34:20 2020 (r364871) +++ head/sys/dev/fdc/fdc.c Thu Aug 27 16:34:33 2020 (r364872) @@ -492,7 +492,7 @@ fdc_cmd(struct fdc_data *fdc, int n_out, ...) n_in = va_arg(ap, int); for (n = 0; n < n_in; n++) { int *ptr = va_arg(ap, int *); - if (fdc_in(fdc, ptr) < 0) { + if (fdc_in(fdc, ptr) != 0) { char msg[50]; snprintf(msg, sizeof(msg), "cmd %02x failed at in byte %d of %d\n", @@ -587,7 +587,7 @@ fdc_sense_int(struct fdc_data *fdc, int *st0p, int *cy return (FD_NOT_VALID); } - if (fdc_in(fdc, &cyl) < 0) + if (fdc_in(fdc, &cyl) != 0) return fdc_err(fdc, "can't get cyl num\n"); if (cylp) From owner-svn-src-head@freebsd.org Thu Aug 27 16:36:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41DFB3B7F9F; Thu, 27 Aug 2020 16:36:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcpJS0Mr5z3dqR; Thu, 27 Aug 2020 16:36:08 +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 E3E9126DB1; Thu, 27 Aug 2020 16:36:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RGa73c033657; Thu, 27 Aug 2020 16:36:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RGa7LT033656; Thu, 27 Aug 2020 16:36:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008271636.07RGa7LT033656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 27 Aug 2020 16:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364873 - head/sys/dev/sound/pci X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/sound/pci X-SVN-Commit-Revision: 364873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:36:08 -0000 Author: markj Date: Thu Aug 27 16:36:07 2020 New Revision: 364873 URL: https://svnweb.freebsd.org/changeset/base/364873 Log: snd_ich(4): Handle errors from ich_init() properly during resume. ich_init() returns an errno value or 0, but ich_pci_resume() was comparing the return value with -1 to determine whether an error had occurred. PR: 248941 Submitted by: Tong Zhang MFC after: 1 week Modified: head/sys/dev/sound/pci/ich.c Modified: head/sys/dev/sound/pci/ich.c ============================================================================== --- head/sys/dev/sound/pci/ich.c Thu Aug 27 16:34:33 2020 (r364872) +++ head/sys/dev/sound/pci/ich.c Thu Aug 27 16:36:07 2020 (r364873) @@ -1190,16 +1190,17 @@ static int ich_pci_resume(device_t dev) { struct sc_info *sc; - int i; + int err, i; sc = pcm_getdevinfo(dev); ICH_LOCK(sc); /* Reinit audio device */ - if (ich_init(sc) == -1) { + err = ich_init(sc); + if (err != 0) { device_printf(dev, "unable to reinitialize the card\n"); ICH_UNLOCK(sc); - return (ENXIO); + return (err); } /* Reinit mixer */ ich_pci_codec_reset(sc); From owner-svn-src-head@freebsd.org Thu Aug 27 16:51:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5359A3B8855; Thu, 27 Aug 2020 16:51:59 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcpfl1Zpwz3g1C; Thu, 27 Aug 2020 16:51:59 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id F40632CB39; Thu, 27 Aug 2020 16:51:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id AC85427C0054; Thu, 27 Aug 2020 12:51:58 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Thu, 27 Aug 2020 12:51:58 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvgedguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculddutddmnecujfgurhepofgfggfkjghffffhvffutgesthdtredt reertdenucfhrhhomhepfdeurhgrnhguohhnuceuvghrghhrvghnfdcuoegsughrrghgoh hnsefhrhgvvgeuufffrdhorhhgqeenucggtffrrghtthgvrhhnpeetteelffduvddttdeu vdfhfeehjedvvdfgvdekvdeftefhgeekvdekleevuedvudenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsug hrrghgohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 42470C200A5; Thu, 27 Aug 2020 12:51:58 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: In-Reply-To: References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> Date: Thu, 27 Aug 2020 11:51:37 -0500 From: "Brandon Bergren" To: "Kyle Evans" , "Andriy Gapon" Cc: "Cy Schubert" , "Cy Schubert" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 16:51:59 -0000 On Thu, Aug 27, 2020, at 11:19 AM, Kyle Evans wrote: > On Thu, Aug 27, 2020 at 10:59 AM Andriy Gapon wrote: > > > > On 2020-08-27 17:06, Kyle Evans wrote: > > > On Thu, Aug 27, 2020 at 9:05 AM Kyle Evans wrote: > > >> > > >> On Thu, Aug 27, 2020 at 9:03 AM Cy Schubert wrote: > > >>> > > >>> What would you suggest in this case, where /etc/zfs/zpool.cache is newer > > >>> than /boot/zfs/zpool.cache? > > >>> > > >>> slippy$ lh /boot/zfs/zpool.cache /etc/zfs/zpool.cache > > >>> -rw-r--r-- 1 root wheel 4.6K Aug 25 07:19 /boot/zfs/zpool.cache > > >>> -rw-r--r-- 1 root wheel 4.7K Aug 27 06:20 /etc/zfs/zpool.cache > > >>> slippy$ > > >>> > > >>> Something like, for I in $(ls -t /etc/zfs/zpool.cache > > >>> /boot/zfs/zpool.cache) with the break? > > >>> > > >> > > >> /etc/zfs/zpool.cache is the new location and should generally be > > >> favored if it exists, I reckon. > > > > > > I retract the above. :-) ls -t makes sense. > > > > > > > I actually was about to agree with your first suggestion. > > > > I think it's the correct long-term solution, but it kind of depends on > what we're thinking now- if we expect one might test-boot a disk on an > older FreeBSD/ZFS that's still using /boot, there's a chance it will > contain the more recent data. > FWIW, on powerpc64, using /etc/zfs/zpool.cache is great because it avoids the problem of having to unmount /boot (which is an msdos filesystem because peitiboot doesn't understand ufs or zfs) to update the copy of zpool.cache that is on the root filesystem in /boot instead of only changing the one in the runtime /boot (which was mounted on top, and is never useful because it's not mounted at the time that zpool.cache is actually needed to import pools.) In any case, the correct way on ZFS to control where the cachefile is written is to set the cachefile property on the zpool to the specific path. The correct behavior regarding boot time auto import of pools is to honor that property as found on the pool the boot filesystem was on, so that other pools sharing the same cachefile path will be imported. Multiple cache files and pools not actually listed in a cachefile are valid scenarios for pools. -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Thu Aug 27 17:04:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8169E3B921A; Thu, 27 Aug 2020 17:04:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcpxh2kWXz3yK6; Thu, 27 Aug 2020 17:04:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42040275D1; Thu, 27 Aug 2020 17:04:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RH4uGQ052771; Thu, 27 Aug 2020 17:04:56 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RH4uiw052770; Thu, 27 Aug 2020 17:04:56 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <202008271704.07RH4uiw052770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 27 Aug 2020 17:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364874 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 364874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 17:04:56 -0000 Author: jamie Date: Thu Aug 27 17:04:55 2020 New Revision: 364874 URL: https://svnweb.freebsd.org/changeset/base/364874 Log: Disregard jails in jail.conf that have bad parameters (parameter/variable clash, or redefining name/jid). The current behvaior, of merely warning and moving on, can lead to unexpected behavior when a jail is created without the offending parameter defined at all. Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 27 16:36:07 2020 (r364873) +++ head/usr.sbin/jail/config.c Thu Aug 27 17:04:55 2020 (r364874) @@ -369,11 +369,13 @@ add_param(struct cfjail *j, const struct cfparam *p, e if ((flags ^ dp->flags) & PF_VAR) { jail_warnx(j, "variable \"$%s\" cannot have the same " "name as a parameter.", name); + j->flags |= JF_FAILED; return; } if (dp->flags & PF_IMMUTABLE) { jail_warnx(j, "cannot redefine parameter \"%s\".", dp->name); + j->flags |= JF_FAILED; return; } if (strcmp(dp->name, name)) { @@ -405,6 +407,7 @@ add_param(struct cfjail *j, const struct cfparam *p, e "cannot have the same " "name as a parameter.", name); + j->flags |= JF_FAILED; return; } j->intparams[ipnum] = np; From owner-svn-src-head@freebsd.org Thu Aug 27 17:30:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CDCF3B9F8A; Thu, 27 Aug 2020 17:30:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcqWk3G7lz40y6; Thu, 27 Aug 2020 17:30:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 539B6277A7; Thu, 27 Aug 2020 17:30:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RHUwWg066038; Thu, 27 Aug 2020 17:30:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RHUwOF066037; Thu, 27 Aug 2020 17:30:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008271730.07RHUwOF066037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2020 17:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364875 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 364875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 17:30:58 -0000 Author: imp Date: Thu Aug 27 17:30:57 2020 New Revision: 364875 URL: https://svnweb.freebsd.org/changeset/base/364875 Log: Add note about NO_CLEAN build. NO_CLEAN doesn't quite work for some scenarios when rebuilding older kernels, but the kernels build w/o NO_CLEAN. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 27 17:04:55 2020 (r364874) +++ head/UPDATING Thu Aug 27 17:30:57 2020 (r364875) @@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 'zpool upgrade' for the next few weeks. The change should be transparent unless you want to use new features. + Not all "NO_CLEAN" build scenarios work across these changes. Many + scenarios have been tested and fixed, but rebuilding kernels without + rebuilding world may fail. + 20200824: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with From owner-svn-src-head@freebsd.org Thu Aug 27 17:36:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 678553B9CFE; Thu, 27 Aug 2020 17:36:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcqdg25rDz4138; Thu, 27 Aug 2020 17:36:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4A927B85; Thu, 27 Aug 2020 17:36:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RHa6kA071950; Thu, 27 Aug 2020 17:36:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RHa6iP071949; Thu, 27 Aug 2020 17:36:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008271736.07RHa6iP071949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 27 Aug 2020 17:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364876 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 17:36:07 -0000 Author: markj Date: Thu Aug 27 17:36:06 2020 New Revision: 364876 URL: https://svnweb.freebsd.org/changeset/base/364876 Log: Fix writing of the final block of encrypted, compressed kernel dumps. Previously any residual data in the final block of a compressed kernel dump would be written unencrypted. Note, such a configuration already does not work properly when using AES-CBC since the compressed data is typically not a multiple of the AES block length in size and EKCD does not implement any padding scheme. However, EKCD more recently gained support for using the ChaCha20 cipher, which being a stream cipher does not have this problem. Submitted by: sigsys@gmail.com Reviewed by: cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26188 Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Aug 27 17:30:57 2020 (r364875) +++ head/sys/kern/kern_shutdown.c Thu Aug 27 17:36:06 2020 (r364876) @@ -1464,6 +1464,7 @@ kerneldumpcomp_write_cb(void *base, size_t length, off } resid = length - rlength; memmove(di->blockbuf, (uint8_t *)base + rlength, resid); + bzero((uint8_t *)di->blockbuf + resid, di->blocksize - resid); di->kdcomp->kdc_resid = resid; return (EAGAIN); } @@ -1680,9 +1681,10 @@ dump_finish(struct dumperinfo *di, struct kerneldumphe error = compressor_flush(di->kdcomp->kdc_stream); if (error == EAGAIN) { /* We have residual data in di->blockbuf. */ - error = dump_write(di, di->blockbuf, 0, di->dumpoff, - di->blocksize); - di->dumpoff += di->kdcomp->kdc_resid; + error = _dump_append(di, di->blockbuf, 0, di->blocksize); + if (error == 0) + /* Compensate for _dump_append()'s adjustment. */ + di->dumpoff -= di->blocksize - di->kdcomp->kdc_resid; di->kdcomp->kdc_resid = 0; } if (error != 0) From owner-svn-src-head@freebsd.org Thu Aug 27 17:44:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE7723BA466; Thu, 27 Aug 2020 17:44:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcqpy5SJgz426l; Thu, 27 Aug 2020 17:44:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 99E6B2D361; Thu, 27 Aug 2020 17:44:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f177.google.com with SMTP id z2so1153141qtv.12; Thu, 27 Aug 2020 10:44:10 -0700 (PDT) X-Gm-Message-State: AOAM533Jak6ot6VlKHaZWf/zq+rSE74WkZwoFEIkYKLjVJ/7kWI0VHAk tBZ4F5vWyci/6/mu+t/YglqPrOAMR2a9chuYpKU= X-Google-Smtp-Source: ABdhPJxYZuH877XCKQeSYl0ZCAVk5WqaUdKNKJ1N536JGdTgJUTXJ+C/to2IMYhnbHveGSUbzdqPo4FvFxE/V09pHxY= X-Received: by 2002:ac8:7443:: with SMTP id h3mr2148988qtr.310.1598550250259; Thu, 27 Aug 2020 10:44:10 -0700 (PDT) MIME-Version: 1.0 References: <202008270017.07R0HHgJ092261@repo.freebsd.org> In-Reply-To: <202008270017.07R0HHgJ092261@repo.freebsd.org> From: Kyle Evans Date: Thu, 27 Aug 2020 12:43:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r364850 - head/usr.sbin/jail To: Jamie Gritton Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 17:44:10 -0000 On Wed, Aug 26, 2020 at 7:17 PM Jamie Gritton wrote: > > Author: jamie > Date: Thu Aug 27 00:17:17 2020 > New Revision: 364850 > URL: https://svnweb.freebsd.org/changeset/base/364850 > > Log: > Don't allow jail.conf variables to have the same names as jail parameters. > It was already not allowed in many cases, but crashed instead of giving an > error. > > PR: 248444 > Thanks for the quick backout and fix! From owner-svn-src-head@freebsd.org Thu Aug 27 17:46:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC9ED3BA36B; Thu, 27 Aug 2020 17:46:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcqsK5X81z42Jb; Thu, 27 Aug 2020 17:46:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A164E27D46; Thu, 27 Aug 2020 17:46:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RHkD6f078435; Thu, 27 Aug 2020 17:46:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RHkD4V078434; Thu, 27 Aug 2020 17:46:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008271746.07RHkD4V078434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 27 Aug 2020 17:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364877 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 364877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 17:46:13 -0000 Author: imp Date: Thu Aug 27 17:46:13 2020 New Revision: 364877 URL: https://svnweb.freebsd.org/changeset/base/364877 Log: Fix tiny style nit. Modified: head/sys/cam/cam_xpt_internal.h Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Thu Aug 27 17:36:06 2020 (r364876) +++ head/sys/cam/cam_xpt_internal.h Thu Aug 27 17:46:13 2020 (r364877) @@ -107,7 +107,7 @@ struct cam_ed { struct cam_ccbq ccbq; /* Queue of pending ccbs */ struct async_list asyncs; /* Async callback info for this B/T/L */ struct periph_list periphs; /* All attached devices */ - u_int generation; /* Generation number */ + u_int generation; /* Generation number */ void *quirk; /* Oddities about this device */ u_int maxtags; u_int mintags; From owner-svn-src-head@freebsd.org Thu Aug 27 18:38:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF2283BC403; Thu, 27 Aug 2020 18:38:33 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcs1j0W2Fz46rg; Thu, 27 Aug 2020 18:38:32 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id m22so7568435ljj.5; Thu, 27 Aug 2020 11:38:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=tN/Pb3/V8XqYsEMnW4ma0cHyp9flSb00KF+eoxQLPkE=; b=ktoM3VTkVkRAhFWcKtWFXpyRb88H9FrLHpVxxDLGR9nvAuzhD0VDEfUU+YrDhvYr27 BuTe3fO9ty6AwFPJld65P3dgYwBL2VMtO5t3ptgziHtsQMkvNKpcsSALHylJ7I1ko/bW OIU8pt3MzVOzYtnX98ZeBMgbtn/hJ1/Q1Bh2jvlg/HDc7RlthecrI8dAl1FlxsWS8O0U 4yD+XDg/STI3pFhLRI0oh2gsXOVY0OYBrZflc6uiT6dLtv6El55BmMUaZ4OWcX2l4SpN xOZ2N86hKwiqUoOlEP6DPNpJL0ZVzkzdlxTDwCmoBsB4ZK8Ws9nnv15BuQluOdkO1dXl RNwQ== X-Gm-Message-State: AOAM533KD2iMcyJvz51KdVxiEhXUIcibfBvucmt3P+4fZTTYOa9tf2zl sNw52WECFEqpLfhftPg/U0R/n1h274S/Cg== X-Google-Smtp-Source: ABdhPJzTbPRxbfPQPXRHUn4qB5fzzUPZOXTVjvH7iFRDTaMkN0kThSJOkyOQENW2clYIuiLRshS3xw== X-Received: by 2002:a2e:9f4e:: with SMTP id v14mr10945850ljk.72.1598553511053; Thu, 27 Aug 2020 11:38:31 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id q14sm176916lfo.82.2020.08.27.11.38.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Aug 2020 11:38:30 -0700 (PDT) Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d To: Brandon Bergren , Kyle Evans Cc: Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Thu, 27 Aug 2020 21:38:29 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bcs1j0W2Fz46rg X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.176 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-0.56 / 15.00]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.33)[-0.328]; NEURAL_SPAM_LONG(0.68)[0.679]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.176:from]; NEURAL_HAM_MEDIUM(-0.91)[-0.907]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.176:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 18:38:33 -0000 On 27/08/2020 19:51, Brandon Bergren wrote: > FWIW, on powerpc64, using /etc/zfs/zpool.cache is great because it avoids the problem of having to unmount /boot (which is an msdos filesystem because peitiboot doesn't understand ufs or zfs) to update the copy of zpool.cache that is on the root filesystem in /boot instead of only changing the one in the runtime /boot (which was mounted on top, and is never useful because it's not mounted at the time that zpool.cache is actually needed to import pools.) > > In any case, the correct way on ZFS to control where the cachefile is written is to set the cachefile property on the zpool to the specific path. The correct behavior regarding boot time auto import of pools is to honor that property as found on the pool the boot filesystem was on, so that other pools sharing the same cachefile path will be imported. Multiple cache files and pools not actually listed in a cachefile are valid scenarios for pools. Just want to express my complete agreement. -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Aug 27 18:45:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59D363BCB6F; Thu, 27 Aug 2020 18:45:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcsB63d3Hz49yX; Thu, 27 Aug 2020 18:45:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id BMu7kyczjng7KBMu8k6J27; Thu, 27 Aug 2020 12:45:45 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=y4yBn9ojGxQA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=0lLUxovU0v1GWiWp7KwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id CEB04689; Thu, 27 Aug 2020 11:45:41 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 07RIjfK6011041; Thu, 27 Aug 2020 11:45:41 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202008271845.07RIjfK6011041@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andriy Gapon cc: Brandon Bergren , Kyle Evans , Cy Schubert , Cy Schubert , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364817 - head/libexec/rc/rc.d In-reply-to: References: <202008261313.07QDDwRm040119@repo.freebsd.org> <7e55d429-482b-2277-b340-2b85c687440e@FreeBSD.org> <202008271350.07RDoGqn055838@slippy.cwsent.com> <202008271354.07RDsTeW084744@slippy.cwsent.com> <202008271403.07RE3U56090900@slippy.cwsent.com> <5e96ff14-1d81-c42f-21f6-1ae55aa9ce76@FreeBSD.org> Comments: In-reply-to Andriy Gapon message dated "Thu, 27 Aug 2020 21:38:29 +0300." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Aug 2020 11:45:41 -0700 X-CMAE-Envelope: MS4wfDC8VQwO7z4YlBCNZWk9ZvD5TgGE6wQ7ylPjSxkOtqPYrBSNatQwuGrX6q2JL8TqR6XFJPKLwgvdwbZO2m0086oSWcvOSARurn0r0Q5X7gy67al0iJtc xw9wG78ppJWFs7TFshZXnop5V/848bW2UiBdDSXQHum5cYh/z2R7+ZbUtnF09lJqExMCYyuiISMCDTG5QNPuyUXuigOlrTxHItuVGleeyhSfazMesQqwEeY4 LiiNqdnym1po6rTHxvezWz6pEEkEzc9uZ+HohP8BDaNrQ25Cfq11twFCDSzVaW2ej4KqbHYnD1auSwnx3dzQllWTJ+nZQq851AMx5ZGF5zn4jg6pX9FBNwyN x8goj2sKTcUODwB9kwQmPdmP8K+ybA== X-Rspamd-Queue-Id: 4BcsB63d3Hz49yX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 18:45:53 -0000 In message , Andriy Gapon wri tes: > On 27/08/2020 19:51, Brandon Bergren wrote: > > FWIW, on powerpc64, using /etc/zfs/zpool.cache is great because it avoids t > he problem of having to unmount /boot (which is an msdos filesystem because p > eitiboot doesn't understand ufs or zfs) to update the copy of zpool.cache tha > t is on the root filesystem in /boot instead of only changing the one in the > runtime /boot (which was mounted on top, and is never useful because it's not > mounted at the time that zpool.cache is actually needed to import pools.) > > > > In any case, the correct way on ZFS to control where the cachefile is writt > en is to set the cachefile property on the zpool to the specific path. The co > rrect behavior regarding boot time auto import of pools is to honor that prop > erty as found on the pool the boot filesystem was on, so that other pools sha > ring the same cachefile path will be imported. Multiple cache files and pools > not actually listed in a cachefile are valid scenarios for pools. > > > Just want to express my complete agreement. Agreed with the above, however: I still think that using a zpool import in rc.d is a regression. I understand why the OpenZFS folks did what they did. Linux with it's filesystem agnostic grub and initramfs monstrosity requires that they externalize this. I'm not happy about the regression but understand why they did it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Aug 27 20:25:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED1A73C27D8; Thu, 27 Aug 2020 20:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcvNj621vz4kF8; Thu, 27 Aug 2020 20:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:5020:a607:a136:c9b6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 31C352E4F3; Thu, 27 Aug 2020 20:25:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm To: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008261655.07QGtSZx096979@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <75f5b8e6-7c3f-00cb-5830-6b329e58213f@FreeBSD.org> Date: Thu, 27 Aug 2020 13:25:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202008261655.07QGtSZx096979@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 20:25:10 -0000 On 8/26/20 9:55 AM, Jung-uk Kim wrote: > Author: jkim > Date: Wed Aug 26 16:55:28 2020 > New Revision: 364822 > URL: https://svnweb.freebsd.org/changeset/base/364822 > > Log: > Fix Clang version detection. > > We prepend "FreeBSD" to Clang version string. This broke compiler test for > AVX instruction support. Have you opened a PR upstream to fix this? They should be willing to accept it since it probably affects clang on OS X as well? -- John Baldwin From owner-svn-src-head@freebsd.org Thu Aug 27 20:28:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A62C3C2C2B; Thu, 27 Aug 2020 20:28:25 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcvSS6mZzz4kk2; Thu, 27 Aug 2020 20:28:24 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x331.google.com with SMTP id a65so5521779otc.8; Thu, 27 Aug 2020 13:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vvf3+UzW+BRFfhw3z/wJ8qlEIyabez2nZ5iUrt1bNRw=; b=Z53+Ztto63L97ZBkF0Q3xZkaohc4lFKc9zI5AR7pOC/SngZRvJYi0gySYnHHiEqoIF t8nDdrs/MP3Mrr6Txy0huj5wqG/i1cfLaT/2AahHUhRinUSxgmffNk6m4+yH3DnGoZRV VttrhvpeLvXIW/mdcv4H4qi7w4NRmMG6/jpzFqqOy8Dw+1j5XyTEQ1eycvtURl+iQnPE dErjixgnb7TSlElQjh0XI1/SL03IQDaEMx+MnwCtK9QSjvMpokfI0zYmV4C9gS04GuTJ sChYpO6+tau245xK3IKOq0G1JK+SnNWjKyoqux5fIRZh6Gr2cRmifQivlCZiHTPy/KjA z4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vvf3+UzW+BRFfhw3z/wJ8qlEIyabez2nZ5iUrt1bNRw=; b=bkgp6rEZtz04WjioHIhrHln8ldIoEPV00CFKfUHeMRAiNXvTKghD0rQ0w5lOrEyDJV uzGYPLmbBgWUA3qvs3Te/Votrt5EOWhTJq2sPRor6BPN2f/jU3cSRmbp064ZPKnLiins +MHeTejhX4VN4cGbXwn9I5eIhm0mz6I4Ux9KKRifnr/4Ux7Dina6kPaBdOX9zwgNpT04 9oeYTFzd06AeDfl2PCYO95tHvKXDV1RyR2/OPwxAY21XCCfNV/ekzh1nnBKy8+LjChob Zk92HeL18vMO98JHtwQBiEJGpxRep9IzEyaT2diWrkQw+JlhKFh6owgN0pNHIE25a4Gk wGug== X-Gm-Message-State: AOAM532roK4+ueztUmYb1E+LEr8rBEWXB5XndQvMG+ot/IOa7MfpYw5o t6emUt3kjh1xNdyWV5UCQrYnQEIjXdbJh0xyVTSAuLJQTdGfyw== X-Google-Smtp-Source: ABdhPJwpajlgho8gKUgEBJzR/HDuoKJA8OeI9UQh8jh+HjyxyRfg8KPjFVP8QQKqOBjM1TtsfiWZ3gYqLjKx8YfGuY8= X-Received: by 2002:a9d:3984:: with SMTP id y4mr1853085otb.117.1598560103116; Thu, 27 Aug 2020 13:28:23 -0700 (PDT) MIME-Version: 1.0 References: <202008261655.07QGtSZx096979@repo.freebsd.org> <75f5b8e6-7c3f-00cb-5830-6b329e58213f@FreeBSD.org> In-Reply-To: <75f5b8e6-7c3f-00cb-5830-6b329e58213f@FreeBSD.org> From: Benjamin Kaduk Date: Thu, 27 Aug 2020 13:28:12 -0700 Message-ID: Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm To: John Baldwin Cc: Jung-uk Kim , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4BcvSS6mZzz4kk2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 20:28:25 -0000 On Thu, Aug 27, 2020 at 1:25 PM John Baldwin wrote: > On 8/26/20 9:55 AM, Jung-uk Kim wrote: > > Author: jkim > > Date: Wed Aug 26 16:55:28 2020 > > New Revision: 364822 > > URL: https://svnweb.freebsd.org/changeset/base/364822 > > > > Log: > > Fix Clang version detection. > > > > We prepend "FreeBSD" to Clang version string. This broke compiler > test for > > AVX instruction support. > > Have you opened a PR upstream to fix this? They should be willing to > accept it since it probably affects clang on OS X as well? > > https://github.com/openssl/openssl/pull/12725 should land in a few hours. -Ben From owner-svn-src-head@freebsd.org Thu Aug 27 20:30:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1A133C2CD0; Thu, 27 Aug 2020 20:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcvW946FDz4l1F; Thu, 27 Aug 2020 20:30:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:5020:a607:a136:c9b6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id CAC712E90D; Thu, 27 Aug 2020 20:30:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r364822 - in head/crypto/openssl/crypto: aes/asm bn/asm chacha/asm ec/asm modes/asm poly1305/asm sha/asm To: Benjamin Kaduk Cc: Jung-uk Kim , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008261655.07QGtSZx096979@repo.freebsd.org> <75f5b8e6-7c3f-00cb-5830-6b329e58213f@FreeBSD.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 27 Aug 2020 13:30:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 20:30:45 -0000 On 8/27/20 1:28 PM, Benjamin Kaduk wrote: > On Thu, Aug 27, 2020 at 1:25 PM John Baldwin wrote: > >> On 8/26/20 9:55 AM, Jung-uk Kim wrote: >>> Author: jkim >>> Date: Wed Aug 26 16:55:28 2020 >>> New Revision: 364822 >>> URL: https://svnweb.freebsd.org/changeset/base/364822 >>> >>> Log: >>> Fix Clang version detection. >>> >>> We prepend "FreeBSD" to Clang version string. This broke compiler >> test for >>> AVX instruction support. >> >> Have you opened a PR upstream to fix this? They should be willing to >> accept it since it probably affects clang on OS X as well? >> >> > https://github.com/openssl/openssl/pull/12725 should land in a few hours. Yes, mail failure on my part as I missed another place where I'd already asked this (and subsequently forgot :( ). -- John Baldwin From owner-svn-src-head@freebsd.org Thu Aug 27 21:19:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C52AD3C3DCD; Thu, 27 Aug 2020 21:19:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcwbB5Hv1z4njX; Thu, 27 Aug 2020 21:19:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EFEFA34B; Thu, 27 Aug 2020 21:19:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RLJI0d043898; Thu, 27 Aug 2020 21:19:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RLJGgb043888; Thu, 27 Aug 2020 21:19:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008272119.07RLJGgb043888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 27 Aug 2020 21:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364891 - in head: . release release/scripts X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head: . release release/scripts X-SVN-Commit-Revision: 364891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 21:19:18 -0000 Author: gjb Date: Thu Aug 27 21:19:16 2020 New Revision: 364891 URL: https://svnweb.freebsd.org/changeset/base/364891 Log: Merge the projects/release-git branch to head. This allows building 13.x from Git instead of Subversion. No MFC to stable branches is planned at this time. [1] Discussed with: git working group [1] Sponsored by: Rubicon Communications, LLC (netgate.com) Added: head/release/Makefile.inc1 - copied unchanged from r364890, projects/release-git/release/Makefile.inc1 Deleted: head/release/scripts/relnotes-search.sh Modified: head/Makefile.inc1 head/release/Makefile head/release/Makefile.azure head/release/Makefile.ec2 head/release/Makefile.gce head/release/Makefile.mirrors head/release/Makefile.vagrant head/release/release.conf.sample head/release/release.sh Directory Properties: head/ (props changed) head/cddl/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/contrib/bc/ (props changed) head/contrib/byacc/ (props changed) head/contrib/elftoolchain/ (props changed) head/contrib/ipfilter/ (props changed) head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/libcxx/ (props changed) head/contrib/llvm-project/libunwind/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/lldb/ (props changed) head/contrib/llvm-project/llvm/ (props changed) head/contrib/llvm-project/openmp/ (props changed) head/contrib/lua/ (props changed) head/contrib/mtree/ (props changed) head/contrib/netbsd-tests/ (props changed) head/contrib/openbsm/ (props changed) head/contrib/sendmail/ (props changed) head/contrib/sqlite3/ (props changed) head/contrib/unbound/ (props changed) head/crypto/openssh/ (props changed) head/crypto/openssl/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/ipfilter/ (props changed) head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/riscv/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 27 21:09:17 2020 (r364890) +++ head/Makefile.inc1 Thu Aug 27 21:19:16 2020 (r364891) @@ -510,6 +510,15 @@ VCS_REVISION= $$(echo r${_VCS_REVISION}) .export VCS_REVISION .endif +.if !defined(GIT_CMD) || empty(GIT_CMD) +. for _P in /usr/bin /usr/local/bin +. if exists(${_P}/git) +GIT_CMD= ${_P}/git +. endif +. endfor +.export GIT_CMD +.endif + .if !defined(OSRELDATE) .if exists(/usr/include/osreldate.h) OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile Thu Aug 27 21:19:16 2020 (r364891) @@ -90,15 +90,6 @@ EXTRA_PACKAGES+= src.txz .endif .if !defined(NODOC) EXTRA_PACKAGES+= reldoc -. if !defined(SVN) || empty(SVN) -. for S in svn svnlite -. for D in /usr/local/bin /usr/bin -. if(exists(${D}/${S})) -SVN?= ${D}/${S} -. endif -. endfor -. endfor -. endif .endif RELEASE_TARGETS= ftp @@ -173,7 +164,6 @@ ports.txz: reldoc: cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ env MAN4DIR=${WORLDDIR}/share/man/man4 \ - SVN=${SVN} \ _BRANCH=${BRANCH} \ ${MAKE} all install clean "FORMATS=html txt" \ INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ @@ -336,4 +326,5 @@ release-install: cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512 cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 +.include "${.CURDIR}/Makefile.inc1" .include "${.CURDIR}/Makefile.vm" Modified: head/release/Makefile.azure ============================================================================== --- head/release/Makefile.azure Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile.azure Thu Aug 27 21:19:16 2020 (r364891) @@ -17,7 +17,7 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y-%m-%d +SNAPSHOT_DATE!= date +-${BUILDDATE} .endif AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile.ec2 Thu Aug 27 21:19:16 2020 (r364891) @@ -5,32 +5,8 @@ # Makefile for creating an EC2 AMI from a disk image. # -# Figure out where SVN is -.if !defined(SVN_CMD) || empty(SVN_CMD) -. for _P in /usr/bin /usr/local/bin -. for _S in svn svnlite -. if exists(${_P}/${_S}) -SVN_CMD= ${_P}/${_S} -. endif -. endfor -. endfor -.endif -.if exists(${SRCTOP}/.svn) -. if empty(EC2_SVNBRANCH) - EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} 2>/dev/null | sed -e 's/\^\///' -. export EC2_SVNBRANCH -. endif -. if empty(EC2_SVNREV) - EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} 2>/dev/null || true -. export EC2_SVNREV -. endif -.else -EC2_SVNBRANCH= unknown -EC2_SVNREV= unknown -.endif - .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" -AMINAMESUFFIX!= date +-%Y-%m-%d +AMINAMESUFFIX!= date +-${BUILDDATE} .endif .if defined(EC2PUBLIC) && !empty(EC2PUBLIC) PUBLISH= --public @@ -40,7 +16,7 @@ PUBLICSNAP= --publicsnap .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} -EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} +EC2SNSVERS= ${GITBRANCH}@${GITREV} .endif .if ${TARGET_ARCH} != "amd64" EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} @@ -89,7 +65,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} ${EC2ARCH} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ - "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ + "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} @touch ${.TARGET} Modified: head/release/Makefile.gce ============================================================================== --- head/release/Makefile.gce Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile.gce Thu Aug 27 21:19:16 2020 (r364891) @@ -24,8 +24,7 @@ GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -_SNAPSHOT_DATE!= date +%Y%m%d -SNAPSHOT_DATE= -v${_SNAPSHOT_DATE} +SNAPSHOT_DATE= -v${BUILDDATE} GCE_FAMILY_SUFX= -snap .endif Copied: head/release/Makefile.inc1 (from r364890, projects/release-git/release/Makefile.inc1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/Makefile.inc1 Thu Aug 27 21:19:16 2020 (r364891, copy of r364890, projects/release-git/release/Makefile.inc1) @@ -0,0 +1,31 @@ +# +# $FreeBSD$ +# + +# Figure out where the git binary is. +.for _P in /usr/bin /usr/local/bin +. if !defined(GIT_CMD) || empty(GIT_CMD) +. if exists(${_P}/git) +GIT_CMD= ${_P}/git +. endif +. endif +.endfor +.if !defined(GIT_CMD) && empty(GIT_CMD) +. error "Git binary not found. Set GIT_CMD appropriately." +.endif + +# Set the git branch and hash to export where needed. +.if !defined(GITBRANCH) || empty(GITBRANCH) +GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' +.export GITBRANCH +.endif +.if !defined(GITREV) || empty(GITREV) +GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true +.export GITREV +.endif + +# Set the build date, primarily for snapshot builds. +.if !defined(BUILDDATE) || empty(BUILDDATE) +BUILDDATE!= date +%Y%m%d +.export BUILDDATE +.endif Modified: head/release/Makefile.mirrors ============================================================================== --- head/release/Makefile.mirrors Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile.mirrors Thu Aug 27 21:19:16 2020 (r364891) @@ -19,7 +19,6 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage .if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage .endif -SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" @@ -31,26 +30,10 @@ EMBEDDED= 1 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != "" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots -. if !defined(SVNREVISION) || empty(SVNREVISION) -. for _D in /usr/bin /usr/local/bin -. for _S in svnversion svnliteversion -. if exists(${_D}/${_S}) -SVNVERSION?= ${_D}/${_S} -. endif -. endfor -. endfor -. if exists(${SVNVERSION}) && !empty(SVNVERSION) -SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile -. endif -. endif # !defined(SVNREVISION) -. if !defined(BUILDDATE) || empty(BUILDDATE) -. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) -BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d -. else +.if !defined(BUILDDATE) || empty(BUILDDATE) BUILDDATE!= date +%Y%m%d -. endif -. endif -_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION} +.endif +_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV} .else # release SNAPSHOT= @@ -187,8 +170,8 @@ iso-images-stage: mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE - echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH - echo r${SVNREVISION} > ${FTP_DIR}/REVISION + echo ${GITBRANCH} > ${FTP_DIR}/GITBRANCH + echo ${GITREV} > ${FTP_DIR}/REVISION cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH} Modified: head/release/Makefile.vagrant ============================================================================== --- head/release/Makefile.vagrant Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/Makefile.vagrant Thu Aug 27 21:19:16 2020 (r364891) @@ -29,7 +29,7 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} .endif .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" -SNAPSHOT_DATE!= date +-%Y%m%d +SNAPSHOT_DATE!= date +-${BUILDDATE} .endif VAGRANT_VERSION!= date +%Y.%m.%d Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/release.conf.sample Thu Aug 27 21:19:16 2020 (r364891) @@ -12,23 +12,19 @@ ## Set the directory within which the release will be built. CHROOTDIR="/scratch" -## Set the svn host. -SVNROOT="svn://svn.FreeBSD.org/" +## Set the version control system host. +GITROOT="https://cgit-beta.freebsd.org/" +GITSRC="src.git" +GITPORTS="ports.git" +GITDOC="doc.git" ## Set the src/, ports/, and doc/ branches or tags. -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" +SRCBRANCH="main" +DOCBRANCH="main" +PORTBRANCH="main" -## Run svn co --force for src checkout. -#SRC_FORCE_CHECKOUT=yes - -## Sample configuration for using git instead of svn. -#VCSCMD="/usr/local/bin/git clone --branch master" -#SVNROOT="" -#SRCBRANCH="https://github.com/freebsd/freebsd" -#DOCBRANCH="https://github.com/freebsd/freebsd-doc" -#PORTBRANCH="https://github.com/freebsd/freebsd-ports" +## Sample configuration for using git from ports. +#GITCMD="/usr/local/bin/git clone -q --branch main" ## Set to override the default target architecture. #TARGET="amd64" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Thu Aug 27 21:09:17 2020 (r364890) +++ head/release/release.sh Thu Aug 27 21:19:16 2020 (r364891) @@ -1,6 +1,7 @@ #!/bin/sh #- -# Copyright (c) 2013-2018 The FreeBSD Foundation +# Copyright (c) 2020 Rubicon Communications, LLC (netgate.com) +# Copyright (c) 2013-2019 The FreeBSD Foundation # Copyright (c) 2013 Glen Barber # Copyright (c) 2011 Nathan Whitehorn # All rights reserved. @@ -38,7 +39,7 @@ export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" -VERSION=2 +VERSION=3 # Prototypes that can be redefined per-chroot or per-target. load_chroot_env() { } @@ -51,7 +52,7 @@ usage() { } # env_setup(): Set up the default build environment variables, such as the -# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf +# CHROOTDIR, VCSCMD, GITROOT, etc. This is called before the release.conf # file is sourced, if '-c ' is specified. env_setup() { # The directory within which the release will be built. @@ -60,27 +61,29 @@ env_setup() { # The default version control system command to obtain the sources. for _dir in /usr/bin /usr/local/bin; do - for _svn in svn svnlite; do - [ -x "${_dir}/${_svn}" ] && VCSCMD="${_dir}/${_svn}" - [ ! -z "${VCSCMD}" ] && break 2 - done + [ -x "${_dir}/git" ] && VCSCMD="/${_dir}/git" + [ ! -z "${VCSCMD}" ] && break 2 done - VCSCMD="${VCSCMD} checkout" - # The default svn checkout server, and svn branches for src/, doc/, + if [ -z "${VCSCMD}" ]; then + echo "*** The devel/git port/package is required." + exit 1 + fi + VCSCMD="/usr/local/bin/git clone -q" + + # The default git checkout server, and branches for src/, doc/, # and ports/. - SVNROOT="svn://svn.FreeBSD.org/" - SRCBRANCH="base/head@rHEAD" - DOCBRANCH="doc/head@rHEAD" - PORTBRANCH="ports/head@rHEAD" + GITROOT="https://cgit-beta.FreeBSD.org/" + SRCBRANCH="main" + DOCBRANCH="main" + PORTBRANCH="main" + GITSRC="src.git" + GITPORTS="ports.git" + GITDOC="doc.git" # Set for embedded device builds. EMBEDDEDBUILD= - # Sometimes one needs to checkout src with --force svn option. - # If custom kernel configs copied to src tree before checkout, e.g. - SRC_FORCE_CHECKOUT= - # The default make.conf and src.conf to use. Set to /dev/null # by default to avoid polluting the chroot(8) environment with # non-default settings. @@ -128,20 +131,11 @@ env_setup() { # in env_setup() if '-c ' is specified. env_check() { chroot_build_release_cmd="chroot_build_release" - # Fix for backwards-compatibility with release.conf that does not have - # the trailing '/'. - case ${SVNROOT} in - *svn*) - SVNROOT="${SVNROOT}/" - ;; - *) - ;; - esac - # Prefix the branches with the SVNROOT for the full checkout URL. - SRCBRANCH="${SVNROOT}${SRCBRANCH}" - DOCBRANCH="${SVNROOT}${DOCBRANCH}" - PORTBRANCH="${SVNROOT}${PORTBRANCH}" + # Prefix the branches with the GITROOT for the full checkout URL. + SRC="${GITROOT}${GITSRC}" + DOC="${GITROOT}${GITDOC}" + PORT="${GITROOT}${GITPORTS}" if [ -n "${EMBEDDEDBUILD}" ]; then WITH_DVD= @@ -187,11 +181,6 @@ env_check() { else ARCH_FLAGS= fi - # Force src checkout if configured - FORCE_SRC_KEY= - if [ -n "${SRC_FORCE_CHECKOUT}" ]; then - FORCE_SRC_KEY="--force" - fi if [ -z "${CHROOTDIR}" ]; then echo "Please set CHROOTDIR." @@ -231,13 +220,13 @@ chroot_setup() { mkdir -p ${CHROOTDIR}/usr if [ -z "${SRC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src + ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc + ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports + ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi if [ -z "${CHROOTBUILD_SKIP}" ]; then @@ -274,6 +263,26 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi + # Install git from ports or packages if the ports tree is + # available and VCSCMD is unset. + _gitcmd="$(which git)" + if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} + GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" + GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" + GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" + GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" + eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \ + make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \ + WRKDIRPREFIX=/tmp/ports \ + DISTDIR=/tmp/distfiles \ + install clean distclean + fi if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. From owner-svn-src-head@freebsd.org Thu Aug 27 21:37:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EB733C4061; Thu, 27 Aug 2020 21:37:24 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcx041hF3z4pl2; Thu, 27 Aug 2020 21:37:24 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3a495.dip0.t-ipconnect.de [79.211.164.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id D1FAC2EED9; Thu, 27 Aug 2020 21:37:23 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Thu, 27 Aug 2020 23:37:26 +0200 From: Gordon Bergling To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364891 - in head: . release release/scripts Message-ID: <20200827213726.GA74980@lion.0xfce3.net> References: <202008272119.07RLJGgb043888@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <202008272119.07RLJGgb043888@repo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 11:29PM up 16 days, 57 mins, 1 user, load averages: 0.07, 0.27, 0.31 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 21:37:24 -0000 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 27, 2020 at 09:19:16PM +0000, Glen Barber wrote: > Author: gjb > Date: Thu Aug 27 21:19:16 2020 > New Revision: 364891 > URL: https://svnweb.freebsd.org/changeset/base/364891 >=20 > Log: > Merge the projects/release-git branch to head. > This allows building 13.x from Git instead of Subversion. > =20 > No MFC to stable branches is planned at this time. [1] > =20 > Discussed with: git working group [1] > Sponsored by: Rubicon Communications, LLC (netgate.com) Thanks for accomplishing this! Is there any difference on building -CURRENT using the github.com mirror compared to FreeBSD's own git sources? --Gordon --envbJBWh7q8WU6mo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEYbWI0KY5X7yH/Fy4OQX2V8rP09wFAl9IJ5VfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYx QjU4OEQwQTYzOTVGQkM4N0ZDNUNCODM5MDVGNjU3Q0FDRkQzREMACgkQOQX2V8rP 09wHmwgAgKSHgnV+cgelJlFYbcoD5BQzpnj0srUsy5lbshQvuGzcx0Tefu9wbYtY XJYP+L1hTU6BSPGaCDOe0THMWDN6/zZ9raJnPrTiYSlCW786Cd9fxoMnBeKagbDj sGMfztasd17jeEmvgrf5P6bSo+2l84Cq9Nn15rmZrAa9979rCIijA1M+EK+yM8uY KQLASHlnp9A8KJ5zyOuuj3LpHnb54JIFmWDM4YAHufldm63zBnpTelwAfaew8yGn 1zUUtyeBDPIT9E5A3zwuN0sOUJcxR8XgSkBsd2wHtaLT1im7SjySGdVi0b8rgjln XWAkIK8pp1jqJN/dJK1P21G6cSRbYg== =8HWN -----END PGP SIGNATURE----- --envbJBWh7q8WU6mo-- From owner-svn-src-head@freebsd.org Thu Aug 27 21:37:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADA2C3C43FE; Thu, 27 Aug 2020 21:37:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcx0J4F2Lz4pZV; Thu, 27 Aug 2020 21:37:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70D83AA94; Thu, 27 Aug 2020 21:37:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RLbamb056313; Thu, 27 Aug 2020 21:37:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RLbaCF056312; Thu, 27 Aug 2020 21:37:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008272137.07RLbaCF056312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 27 Aug 2020 21:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364893 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 364893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 21:37:36 -0000 Author: mmacy Date: Thu Aug 27 21:37:35 2020 New Revision: 364893 URL: https://svnweb.freebsd.org/changeset/base/364893 Log: ZFS: remove duplicate "com.datto:encryption" from loader Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Thu Aug 27 21:25:21 2020 (r364892) +++ head/stand/libsa/zfs/zfsimpl.c Thu Aug 27 21:37:35 2020 (r364893) @@ -128,7 +128,6 @@ static const char *features_for_read[] = { "com.delphix:obsolete_counts", "com.intel:allocation_classes", "org.freebsd:zstd_compress", - "com.datto:encryption", NULL }; From owner-svn-src-head@freebsd.org Thu Aug 27 21:43:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E59FA3C47B6; Thu, 27 Aug 2020 21:43:18 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bcx6t5RWHz4qTZ; Thu, 27 Aug 2020 21:43:18 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1598564598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vWb3rHG+//Leo6X9Zm3YloqoLILC7zNezK4xHlYc7Lw=; b=FEaTEby5591Vb6kB9OvGw6yMuPJNfWxqkqa/26nSQ6XhBdb/KXbKxz36rIyV7ajNkkwS8A v9x1cesedJ74/HMFTNWUuR9pmBf/l0yf/Q9b1W0RPZ6jC3NiS1dcCt8Hf4xlPisP7ds7k0 h4Yd8C7nnZ3NIP9uC6qCfmNXNDdTBVxmWifVaPbsx1v+mkownl3S7jAIbbLeS/ndakffQa 8y1RJbEdXUvUT4ZlwSR1J1GaUe+PzqHSYLxKWZ0F+danO6ejB45bduOlgx/3u6y6zgtKnV YRz0Y+LLie/OKSF3V3gzNk2UdaMglRzLAfo5wBzfQREiQvRK+hnrGgld56BlRg== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 4596E1D8D1; Thu, 27 Aug 2020 21:43:18 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Thu, 27 Aug 2020 21:43:16 +0000 From: Glen Barber To: Gordon Bergling Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364891 - in head: . release release/scripts Message-ID: <20200827214316.GZ61041@FreeBSD.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> <20200827213726.GA74980@lion.0xfce3.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qRu+kOci6Aaql5G6" Content-Disposition: inline In-Reply-To: <20200827213726.GA74980@lion.0xfce3.net> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1598564598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vWb3rHG+//Leo6X9Zm3YloqoLILC7zNezK4xHlYc7Lw=; b=rvgjbSGF8XSzLiPue5KdULFZaXlP6pD694Jjcf6Sz0+d+w2Xq0utLAmKo4VfzXYAn2/waT 7OM6wc/071JKj5BNh0Ur5OiFWvVbnsY5Kr/kQmQbWTAEt8uox/CpPbS0AuqC7diqd8mLPU gQLNBcLAw53WUf8efkaIDJ0lhPKx7mpPGWexkpmjLsXzs0L3cyEX1+oFeKVWydh9l4oL+o Bc0SqXey4P/B+hT28Z6iO1HhLk+PHczNNgWXUCyR4ByiOJBp/ln1lH0apxP4Xv7YJUdLGy i8eQgBQ2HI9GHTFNFPwBSIx/V2E751lxGG63cjlfsf3lGwVeyl5GxDCP1ScptQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1598564598; a=rsa-sha256; cv=none; b=xFZvJoL7YQeUHO7cegdCKNqPP1h6vI6e48jtt0USZwP6ElfXgEkRggT7TwArLr1lxllai7 cbzfrlvEHHJx0u/8hHlMEGVeqCMtoNHv1E8DAfLHR7X/75QVkzJYNUSYNqGQquWmNxkT0J QC3HbDMpRzzm1dFGKufdWvHYf4V9zBK33isq2EMCQJp6q9pkj+zFhO0SCsWweLGJufUQKs 7VZwbALwSLkeMrt1+GtC+gNRhQbHSwczNXN9q2TdJL/Q8zsIlZqeWLqvKDK4Uv+uoZihak b1obHgOKdLEkrwc4+8l4vwKRMcBpzWPoVZpM3R1dmTrsyR9oz7mCR+SjvPS0rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 21:43:19 -0000 --qRu+kOci6Aaql5G6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 27, 2020 at 11:37:26PM +0200, Gordon Bergling wrote: > On Thu, Aug 27, 2020 at 09:19:16PM +0000, Glen Barber wrote: > > Author: gjb > > Date: Thu Aug 27 21:19:16 2020 > > New Revision: 364891 > > URL: https://svnweb.freebsd.org/changeset/base/364891 > >=20 > > Log: > > Merge the projects/release-git branch to head. > > This allows building 13.x from Git instead of Subversion. > > =20 > > No MFC to stable branches is planned at this time. [1] > > =20 > > Discussed with: git working group [1] > > Sponsored by: Rubicon Communications, LLC (netgate.com) >=20 > Thanks for accomplishing this! >=20 Thank you. > Is there any difference on building -CURRENT using the github.com > mirror compared to FreeBSD's own git sources? >=20 The only difference is the project branches are not in the FreeBSD git repository (as far as I know, that is the only thing). Otherwise, head builds just fine(tm) using either. Oh, and the github mirror still uses the 'master' branch, whereas the FreeBSD repo uses 'main'. I think that's the only noticeable thing. Glen --qRu+kOci6Aaql5G6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl9IKPQACgkQAxRYpUeP 4pMsMw//eIt/fpi8VClAJ2vBOhklO1yKn5zQKH11ZuEb4PkxTI7qyTL3Ps9hoTSO rgVoyiGylIlJBBhbLNWzYQpvYophzVTrPlfK1q+Y2PatwUcJzPvP1JMVKHFwNlN0 e6j3Wp0SwzJnjnGdW9YChXBWWMuriZuQ2tP/fSez5P+gBQdlOUfMsUO8deuNQiuO ewwMJgbyeAUsuiPokqIwmMJqk/pJsPNQb0/klBBGLmfHe22j2jSN6RyfAsCqxS+m L5UXgBEowcP7Ca55Fo9cOF/u8nVim1klMm/RNLFgC8YrCYkiFsWuhW0GqEsBiQm+ 4brCJHJfhchyonMUG+Qn2V8FvuBzKqdGxZtwbyp5J/yLAWCsXj8shlBX9VFNnTjP pl3Fl6j3aZ3Xvq7+3hopezS6JMFusi/02JDNM23FHLMs85eeNCWV1saSkBNdpmyV x+LlM+dkSFOau54vPqs7U/Jijx4h9GBNhSlXFpLSiZO53vxJxJ8dgFCwk121xXrc ntmgpA9f4VmesOR81//iy4HQwvbwSnuonyEw0Nbmnnn1jWFyu8c5QVbZldI9lLZ5 ame8dElKtrxOJE/BftS+Y4N6tFOx4sy2mQG42cK+EKExkJlNf1HcoUNyvoObLreG jbZXXgfOma1PmjEUgsDAwNtBbsnYBaYHxG1Gl0YcEKTVqpkCIBc= =R+Hn -----END PGP SIGNATURE----- --qRu+kOci6Aaql5G6-- From owner-svn-src-head@freebsd.org Thu Aug 27 22:14:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EE033C5480; Thu, 27 Aug 2020 22:14:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BcxqR2m7Sz4ryS; Thu, 27 Aug 2020 22:14:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DDABB201; Thu, 27 Aug 2020 22:14:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RMExgt080415; Thu, 27 Aug 2020 22:14:59 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RMExfE080414; Thu, 27 Aug 2020 22:14:59 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202008272214.07RMExfE080414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 27 Aug 2020 22:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364895 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 22:14:59 -0000 Author: mckusick Date: Thu Aug 27 22:14:58 2020 New Revision: 364895 URL: https://svnweb.freebsd.org/changeset/base/364895 Log: Add a comment to clarify when and why cached names are deleted during pathname lookup. Reviewed by: kib MFC after: 3 days Sponsored by: Netflix Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Aug 27 21:47:43 2020 (r364894) +++ head/sys/kern/vfs_lookup.c Thu Aug 27 22:14:58 2020 (r364895) @@ -785,6 +785,16 @@ lookup(struct nameidata *ndp) wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, ("CREATE, DELETE, RENAME require LOCKPARENT or WANTPARENT.")); + /* + * When set to zero, docache causes the last component of the + * pathname to be deleted from the cache and the full lookup + * of the name to be done (via VOP_CACHEDLOOKUP()). Often + * filesystems need some pre-computed values that are made + * during the full lookup, for instance UFS sets dp->i_offset. + * + * The docache variable is set to zero when requested by the + * NOCACHE flag and for all modifying operations except CREATE. + */ docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; if (cnp->cn_nameiop == DELETE || (wantparent && cnp->cn_nameiop != CREATE && From owner-svn-src-head@freebsd.org Thu Aug 27 23:57:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3322D3C6DD2; Thu, 27 Aug 2020 23:57:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bd05n0wQwz3SSj; Thu, 27 Aug 2020 23:57:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD85DBDF9; Thu, 27 Aug 2020 23:57:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07RNvWeh042137; Thu, 27 Aug 2020 23:57:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07RNvVRf042127; Thu, 27 Aug 2020 23:57:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202008272357.07RNvVRf042127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 27 Aug 2020 23:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364896 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 364896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2020 23:57:33 -0000 Author: rmacklem Date: Thu Aug 27 23:57:30 2020 New Revision: 364896 URL: https://svnweb.freebsd.org/changeset/base/364896 Log: Add flags to enable NFS over TLS to the NFS client and server. An Internet Draft titled "Towards Remote Procedure Call Encryption By Default" (soon to be an RFC I think) describes how Sun RPC is to use TLS with NFS as a specific application case. Various commits prepared the NFS code to use KERN_TLS, mainly enabling use of ext_pgs mbufs for large RPC messages. r364475 added TLS support to the kernel RPC. This commit (which is the final one for kernel changes required to do NFS over TLS) adds support for three export flags: MNT_EXTLS - Requires a TLS connection. MNT_EXTLSCERT - Requires a TLS connection where the client presents a valid X.509 certificate during TLS handshake. MNT_EXTLSCERTUSER - Requires a TLS connection where the client presents a valid X.509 certificate with "user@domain" in the otherName field of the SubjectAltName during TLS handshake. Without these export options, clients are permitted, but not required, to use TLS. For the client, a new nmount(2) option called "tls" makes the client do a STARTTLS Null RPC and TLS handshake for all TCP connections used for the mount. The CLSET_TLS client control option is used to indicate to the kernel RPC that this should be done. Unless the above export flags or "tls" option is used, semantics should not change for the NFS client nor server. For NFS over TLS to work, the userspace daemons rpctlscd(8) { for client } or rpctlssd(8) daemon { for server } must be running. Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfsmount.h head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfs/nfs_commonkrpc.c Thu Aug 27 23:57:30 2020 (r364896) @@ -281,6 +281,8 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if ((nmp->nm_flag & NFSMNT_RESVPORT)) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); + if (NFSHASTLS(nmp)) + CLNT_CONTROL(client, CLSET_TLS, &one); if (NFSHASSOFT(nmp)) { if (nmp->nm_sotype == SOCK_DGRAM) /* Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfs/nfsdport.h Thu Aug 27 23:57:30 2020 (r364896) @@ -81,6 +81,9 @@ struct nfsexstuff { #define NFSVNO_EXPORTANON(e) ((e)->nes_exflag & MNT_EXPORTANON) #define NFSVNO_EXSTRICTACCESS(e) ((e)->nes_exflag & MNT_EXSTRICTACCESS) #define NFSVNO_EXV4ONLY(e) ((e)->nes_exflag & MNT_EXV4ONLY) +#define NFSVNO_EXTLS(e) ((e)->nes_exflag & MNT_EXTLS) +#define NFSVNO_EXTLSCERT(e) ((e)->nes_exflag & MNT_EXTLSCERT) +#define NFSVNO_EXTLSCERTUSER(e) ((e)->nes_exflag & MNT_EXTLSCERTUSER) #define NFSVNO_SETEXRDONLY(e) ((e)->nes_exflag = (MNT_EXPORTED|MNT_EXRDONLY)) Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfs/nfsport.h Thu Aug 27 23:57:30 2020 (r364896) @@ -1055,6 +1055,7 @@ bool ncl_pager_setsize(struct vnode *vp, u_quad_t *nsi #define NFSHASOPENMODE(n) ((n)->nm_state & NFSSTA_OPENMODE) #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ (n)->nm_minorvers > 0) +#define NFSHASTLS(n) (((n)->nm_newflag & NFSMNT_TLS) != 0) /* * Set boottime. Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Thu Aug 27 23:57:30 2020 (r364896) @@ -37,12 +37,14 @@ __FBSDID("$FreeBSD$"); #include "opt_kgssapi.h" +#include "opt_kern_tls.h" #include #include -#include #include +#include +#include NFSDLOCKMUTEX; @@ -67,6 +69,9 @@ nfscb_program(struct svc_req *rqst, SVCXPRT *xprt) { struct nfsrv_descript nd; int cacherep, credflavor; +#ifdef KERN_TLS + u_int maxlen; +#endif memset(&nd, 0, sizeof(nd)); if (rqst->rq_proc != NFSPROC_NULL && @@ -107,6 +112,13 @@ nfscb_program(struct svc_req *rqst, SVCXPRT *xprt) #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif +#endif +#ifdef KERN_TLS + if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0 && + rpctls_getinfo(&maxlen, false, false)) { + nd.nd_flag |= ND_EXTPG; + nd.nd_maxextsiz = maxlen; + } #endif cacherep = nfs_cbproc(&nd, rqst->rq_xid); } else { Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Aug 27 23:57:30 2020 (r364896) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bootp.h" #include "opt_nfsroot.h" +#include "opt_kern_tls.h" #include #include @@ -77,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + FEATURE(nfscl, "NFSv4 client"); extern int nfscl_ticks; @@ -117,7 +120,7 @@ static void nfs_decode_args(struct mount *mp, struct n static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, int, u_char *, int, u_char *, int, struct vnode **, struct ucred *, - struct thread *, int, int, int); + struct thread *, int, int, int, uint32_t); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -544,7 +547,7 @@ nfs_mountdiskless(char *path, nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NAMETIMEO, - NFS_DEFAULT_NEGNAMETIMEO, 0)) != 0) { + NFS_DEFAULT_NEGNAMETIMEO, 0, 0)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -746,7 +749,7 @@ static const char *nfs_opts[] = { "from", "nfs_args", "resvport", "readahead", "hostname", "timeo", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", "minorversion", "nametimeo", "negnametimeo", "nocto", "noncontigwr", - "pnfs", "wcommitsize", "oneopenown", + "pnfs", "wcommitsize", "oneopenown", "tls", NULL }; /* @@ -897,9 +900,11 @@ nfs_mount(struct mount *mp) int dirlen, has_nfs_args_opt, has_nfs_from_opt, krbnamelen, srvkrbnamelen; size_t hstlen; + uint32_t newflag; has_nfs_args_opt = 0; has_nfs_from_opt = 0; + newflag = 0; hst = malloc(MNAMELEN, M_TEMP, M_WAITOK); if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; @@ -983,6 +988,8 @@ nfs_mount(struct mount *mp) args.flags |= NFSMNT_PNFS; if (vfs_getopt(mp->mnt_optnew, "oneopenown", NULL, NULL) == 0) args.flags |= NFSMNT_ONEOPENOWN; + if (vfs_getopt(mp->mnt_optnew, "tls", NULL, NULL) == 0) + newflag |= NFSMNT_TLS; if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) { if (opt == NULL) { vfs_mount_error(mp, "illegal readdirsize"); @@ -1337,7 +1344,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, - nametimeo, negnametimeo, minvers); + nametimeo, negnametimeo, minvers, newflag); out: if (!error) { MNT_ILOCK(mp); @@ -1386,7 +1393,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, stru char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, struct ucred *cred, struct thread *td, int nametimeo, int negnametimeo, - int minvers) + int minvers, uint32_t newflag) { struct nfsmount *nmp; struct nfsnode *np; @@ -1396,6 +1403,9 @@ mountnfs(struct nfs_args *argp, struct mount *mp, stru struct nfsclds *dsp, *tdsp; uint32_t lease; static u_int64_t clval = 0; +#ifdef KERN_TLS + u_int maxlen; +#endif NFSCL_DEBUG(3, "in mnt\n"); clp = NULL; @@ -1405,9 +1415,22 @@ mountnfs(struct nfs_args *argp, struct mount *mp, stru free(nam, M_SONAME); return (0); } else { + /* NFS-over-TLS requires that rpctls be functioning. */ + if ((newflag & NFSMNT_TLS) != 0) { + error = EINVAL; +#ifdef KERN_TLS + if (rpctls_getinfo(&maxlen, true, false)) + error = 0; +#endif + if (error != 0) { + free(nam, M_SONAME); + return (error); + } + } nmp = malloc(sizeof (struct nfsmount) + krbnamelen + dirlen + srvkrbnamelen + 2, M_NEWNFSMNT, M_WAITOK | M_ZERO); + nmp->nm_newflag = newflag; TAILQ_INIT(&nmp->nm_bufq); TAILQ_INIT(&nmp->nm_sess); if (clval == 0) @@ -2011,6 +2034,8 @@ void nfscl_retopts(struct nfsmount *nmp, char *buffer, nfscl_printopt(nmp, nmp->nm_sotype != SOCK_STREAM, ",udp", &buf, &blen); nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_RESVPORT) != 0, ",resvport", &buf, &blen); + nfscl_printopt(nmp, (nmp->nm_newflag & NFSMNT_TLS) != 0, ",tls", &buf, + &blen); nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NOCONN) != 0, ",noconn", &buf, &blen); nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_SOFT) == 0, ",hard", &buf, Modified: head/sys/fs/nfsclient/nfsmount.h ============================================================================== --- head/sys/fs/nfsclient/nfsmount.h Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsclient/nfsmount.h Thu Aug 27 23:57:30 2020 (r364896) @@ -47,6 +47,7 @@ struct nfsmount { struct nfsmount_common nm_com; /* Common fields for nlm */ uint32_t nm_privflag; /* Private flags */ + uint32_t nm_newflag; /* New mount flags */ int nm_numgrps; /* Max. size of groupslist */ u_char nm_fh[NFSX_FHMAX]; /* File handle of root dir */ int nm_fhsize; /* Size of root file handle */ @@ -113,6 +114,9 @@ struct nfsmount { #define NFSMNTP_NOXATTR 0x00000080 #define NFSMNTP_NOADVISE 0x00000100 #define NFSMNTP_NOALLOCATE 0x00000200 + +/* New mount flags only used by the kernel via nmount(2). */ +#define NFSMNT_TLS 0x00000001 #define NFSMNT_DIRPATH(m) (&((m)->nm_name[(m)->nm_krbnamelen + 1])) #define NFSMNT_SRVKRBNAME(m) \ Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Aug 27 23:57:30 2020 (r364896) @@ -38,11 +38,13 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_kgssapi.h" +#include "opt_kern_tls.h" #include #include #include +#include #include @@ -120,6 +122,9 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) struct nfsrv_descript nd; struct nfsrvcache *rp = NULL; int cacherep, credflavor; +#ifdef KERN_TLS + u_int maxlen; +#endif memset(&nd, 0, sizeof(nd)); if (rqst->rq_vers == NFS_VER2) { @@ -234,6 +239,14 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) goto out; } + if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0) { + nd.nd_flag |= ND_TLS; + if ((xprt->xp_tls & RPCTLS_FLAGS_VERIFIED) != 0) + nd.nd_flag |= ND_TLSCERT; + if ((xprt->xp_tls & RPCTLS_FLAGS_CERTUSER) != 0) + nd.nd_flag |= ND_TLSCERTUSER; + } + nd.nd_maxextsiz = 16384; #ifdef MAC mac_cred_associate_nfsd(nd.nd_cred); #endif @@ -268,6 +281,11 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) } } +#ifdef KERN_TLS + if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0 && + rpctls_getinfo(&maxlen, false, false)) + nd.nd_maxextsiz = maxlen; +#endif cacherep = nfs_proc(&nd, rqst->rq_xid, xprt, &rp); NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsd_suspend_lock); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Aug 27 23:57:30 2020 (r364896) @@ -3284,6 +3284,19 @@ nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh } /* + * If TLS is required by the export, check the flags in nd_flag. + */ + if (nd->nd_repstat == 0 && ((NFSVNO_EXTLS(exp) && + (nd->nd_flag & ND_TLS) == 0) || + (NFSVNO_EXTLSCERT(exp) && + (nd->nd_flag & ND_TLSCERT) == 0) || + (NFSVNO_EXTLSCERTUSER(exp) && + (nd->nd_flag & ND_TLSCERTUSER) == 0))) { + vput(*vpp); + nd->nd_repstat = NFSERR_ACCES; + } + + /* * Personally, I've never seen any point in requiring a * reserved port#, since only in the rare case where the * clients are all boxes with secure system privileges, @@ -3545,6 +3558,15 @@ nfsvno_v4rootexport(struct nfsrv_descript *nd) nd->nd_flag |= ND_EXGSSINTEGRITY; else if (secflavors[i] == RPCSEC_GSS_KRB5P) nd->nd_flag |= ND_EXGSSPRIVACY; + } + + /* And set ND_EXxx flags for TLS. */ + if ((exflags & MNT_EXTLS) != 0) { + nd->nd_flag |= ND_EXTLS; + if ((exflags & MNT_EXTLSCERT) != 0) + nd->nd_flag |= ND_EXTLSCERT; + if ((exflags & MNT_EXTLSCERTUSER) != 0) + nd->nd_flag |= ND_EXTLSCERTUSER; } out: Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu Aug 27 23:57:30 2020 (r364896) @@ -3816,6 +3816,11 @@ nfsrvd_setclientid(struct nfsrv_descript *nd, __unused clp->lc_uid = nd->nd_cred->cr_uid; clp->lc_gid = nd->nd_cred->cr_gid; } + + /* If the client is using TLS, do so for the callback connection. */ + if (nd->nd_flag & ND_TLS) + clp->lc_flags |= LCL_TLSCB; + NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); clp->lc_program = fxdr_unsigned(u_int32_t, *tl); error = nfsrv_getclientipaddr(nd, clp); Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Aug 27 22:14:58 2020 (r364895) +++ head/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Aug 27 23:57:30 2020 (r364896) @@ -2114,15 +2114,28 @@ nfsd_checkrootexp(struct nfsrv_descript *nd) { if ((nd->nd_flag & (ND_GSS | ND_EXAUTHSYS)) == ND_EXAUTHSYS) - return (0); + goto checktls; if ((nd->nd_flag & (ND_GSSINTEGRITY | ND_EXGSSINTEGRITY)) == (ND_GSSINTEGRITY | ND_EXGSSINTEGRITY)) - return (0); + goto checktls; if ((nd->nd_flag & (ND_GSSPRIVACY | ND_EXGSSPRIVACY)) == (ND_GSSPRIVACY | ND_EXGSSPRIVACY)) - return (0); + goto checktls; if ((nd->nd_flag & (ND_GSS | ND_GSSINTEGRITY | ND_GSSPRIVACY | ND_EXGSS)) == (ND_GSS | ND_EXGSS)) + goto checktls; + return (1); +checktls: + if ((nd->nd_flag & ND_EXTLS) == 0) + return (0); + if ((nd->nd_flag & (ND_TLSCERTUSER | ND_EXTLSCERTUSER)) == + (ND_TLSCERTUSER | ND_EXTLSCERTUSER)) + return (0); + if ((nd->nd_flag & (ND_TLSCERT | ND_EXTLSCERT | ND_EXTLSCERTUSER)) == + (ND_TLSCERT | ND_EXTLSCERT)) + return (0); + if ((nd->nd_flag & (ND_TLS | ND_EXTLSCERTUSER | ND_EXTLSCERT)) == + ND_TLS) return (0); return (1); } From owner-svn-src-head@freebsd.org Fri Aug 28 00:28:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E60C73C7EED; Fri, 28 Aug 2020 00:28:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bd0nF1srjz3Txx; Fri, 28 Aug 2020 00:28:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qt1-x835.google.com with SMTP id e5so6184180qth.5; Thu, 27 Aug 2020 17:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jE9HewZlAoa9RxhNBEUf73wnjVWpvK14yYF3Xmq/q/U=; b=sknQwUbGP/QsPZZaczeOE/fcjZfywYk+pJDSj+QOWfhzUiWr65uqCJPIQWmHqykJ2+ YDFDTAQoCL3TM9b7KorPfrsUP5NjNKmhf4L/BRFTgKNsZ+iq0SKt24TwjlN3YHsxe91m ATrMV7ICOFLKlRO63je52voL3lExrlqGyQX2naEmeXkMFmJVbqzj4lIwMlEBIXrui8uK qkJVQ51MIed1P6rihwLknkbr2l3qojZpgAAp8q4RJZ/6yJG3lwrHA5Po4SzPOsxYLvwW 8pH/82Rr7m9FW3CiysWTFVMTM4CXCe/JWlTevuPmdsPK9+86lH29VmgcGYjb0P+yoB3W rdWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jE9HewZlAoa9RxhNBEUf73wnjVWpvK14yYF3Xmq/q/U=; b=rEkBsIwhx/rakJ+Ri9l+YOxW8upkP0th+FSTGbTci6aB8tv3ZakrIBwKJAjaZGEY48 5h6pqk/PiUMCM2RdAz8zi60Q9tYcoWX4PEXwLXg3+7jsShpRwrYaB5ph+NdK5KzdLJa9 l+rEtQpVxAS7SyiQALCeSWxU6E0BY6xZYa6HicnsLKibDxkrbkcnFzeIPmZKwxirvL6Q +rXGjjOVHsIu7K3zTFj/1a1B4FhuQIMWxZzp0L4/a+zg+Wm6agyYfY68s/SO/jDnBdqf JR+o4mKx9tzplenBBRQGJ4t1jp8YlgyRb5VigQ6sNc22IINyLkSDA6+NiaQLdpP7fbaO Uzeg== X-Gm-Message-State: AOAM532ziUdy6kPTiOqsCO0xzDq+0p/VMAY6Jpr4YfGsKOhxLBb2OAbH quEIM0Zomu+VVKUdKjQSf8UYeh9PhjhM5/stm+VHcMusLRRpLA== X-Google-Smtp-Source: ABdhPJwtxVIkSO4RjINX/QPltmWALKT4l2NMYrB1+pkTjiRCCi3S16lwRQj5b4v8H1eOPA5XsJXZpr+OpuiPZkqd7mk= X-Received: by 2002:ac8:31c7:: with SMTP id i7mr19724801qte.223.1598574495409; Thu, 27 Aug 2020 17:28:15 -0700 (PDT) MIME-Version: 1.0 References: <202008102141.07ALfnDj009838@repo.freebsd.org> In-Reply-To: <202008102141.07ALfnDj009838@repo.freebsd.org> From: Adrian Chadd Date: Thu, 27 Aug 2020 17:28:03 -0700 Message-ID: Subject: Re: svn commit: r364091 - head/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Bd0nF1srjz3Txx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=sknQwUbG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::835 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-3.06 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.035]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.963]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::835:from]; NEURAL_HAM_SHORT(-0.07)[-0.065]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 00:28:18 -0000 Hi! This breaks when compiling FreeBSD-mips on GCC-9. :( In file included from /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:50, from /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir_b.c:29: /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/include/block_abi.h:45:2: error: anonymous struct declared inside parameter list will not be visible outside of this definition or declarati 45 | struct {\ | ^~~~~~ /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:67:5: note: in expansion of macro 'DECLARE_BLOCK' 67 | DECLARE_BLOCK(int, dcomp, const struct dirent **, const struct dirent **)) | ^~~~~~~~~~~~~ /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/include/block_abi.h:45:2: error: anonymous struct declared inside parameter list will not be visible outside of this definition or declarati 45 | struct {\ | ^~~~~~ /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:66:5: note: in expansion of macro 'DECLARE_BLOCK' 66 | DECLARE_BLOCK(int, select, const struct dirent *), | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors --- scandir_b.o --- *** [scandir_b.o] Error code 1 -adrian From owner-svn-src-head@freebsd.org Fri Aug 28 00:32:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 164013C8203; Fri, 28 Aug 2020 00:32:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bd0t00q6Sz3VTX; Fri, 28 Aug 2020 00:32:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qv1-xf2e.google.com with SMTP id l13so3603123qvt.10; Thu, 27 Aug 2020 17:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jq4SUwLieMk8RW06gNDKGyIITJPPOUBXdf1sC2TOHa4=; b=XGvQKAMJ2gqUYpgzWtLamC0gQKKg9mJLnH4Ixpso7lOqydKoLew0TrqPWO6e8d8fT6 YuMbNMp9aPPvkTzuk3/XQdwSOWyFtfp7Lg/6CPzDIf2VdW8zGnhQKrrEio/oVqrqR+zx huk9JrtGVYs1cX3SyDDLQ5xefDtNIbdsnmNHwKN0KOk8wdPFPZzYa9XdynqSleZkQrg0 9El2bCW+QhMfWkGGJ72Wcs+BPT7v1P/D7flK7l7cRGHNB+mX5Ip6b2rkfSMmU/AYp8Fz vYm3Y8VJIGiYavSOZGeog9E53FjYNiGXvnzogwjJATG4pUkizr08oqZZAx3aVtN39SKT st4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jq4SUwLieMk8RW06gNDKGyIITJPPOUBXdf1sC2TOHa4=; b=fMjWnEn3pgeW8uvBTL5+FyNH73jtvINE++aLztRan3CnRXtfsclmwygfQStn/nhzHy 4ZVuHH9YZB8xsqSLoScs2Ii7NTyJVUbKeoThHn4T/c5sZgNbMK8E3nAOhPRouqa8cwyV FIKjS1usfsnEVBvYTcB8u98Gsz0/CSqmIh7RbgeKe1Gh3QqYHJQRAShq+3FpfbZFOqaU +PKraqlrioS+DiOcctItK2K5krc6VarE7pG34XjhcuX6Oc/3ueOWx3srOktn/NoExS1c PYztxFnymYetp/gqhceLH1+wtcZpVZtHeMujAFzZAAdpWsPHko9SsfKeXNiXARsgqxjZ VcnA== X-Gm-Message-State: AOAM532WATbAFZldEqcEP/rp9teg3nzmHTYf5FSW3NIGlIqXhfs0+wfd MHCm1D7vzBxAqKAQfJnw+Jx7JhUX52gFnTDTjaiFSWeIE/U= X-Google-Smtp-Source: ABdhPJy7H2m0hg9uh2wIJAKk+rWExHBZfRF5saXfnspxPBer03/xCMnKcfgDc7eq2A96LEb/+FFKWyUv1SxL8q0lC0Y= X-Received: by 2002:ad4:5345:: with SMTP id v5mr21811453qvs.28.1598574742716; Thu, 27 Aug 2020 17:32:22 -0700 (PDT) MIME-Version: 1.0 References: <202008102141.07ALfnDj009838@repo.freebsd.org> In-Reply-To: From: Adrian Chadd Date: Thu, 27 Aug 2020 17:32:10 -0700 Message-ID: Subject: Re: svn commit: r364091 - head/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Bd0t00q6Sz3VTX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XGvQKAMJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::f2e as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-3.07 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.03)[-1.034]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; NEURAL_HAM_LONG(-0.96)[-0.964]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2e:from]; NEURAL_HAM_SHORT(-0.07)[-0.073]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 00:32:25 -0000 {snip} and for completeness sake, bsearch_b.c has the same issue but isn't included in lib/Makefile; thus why it's not tripping the compiler error. -adrian From owner-svn-src-head@freebsd.org Fri Aug 28 02:09:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B62E3C9DE5; Fri, 28 Aug 2020 02:09:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bd31g39wtz3ZKp; Fri, 28 Aug 2020 02:09:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B67DA40; Fri, 28 Aug 2020 02:09:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07S29B7b021393; Fri, 28 Aug 2020 02:09:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07S29BLS021392; Fri, 28 Aug 2020 02:09:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008280209.07S29BLS021392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 28 Aug 2020 02:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364899 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 02:09:11 -0000 Author: gjb Date: Fri Aug 28 02:09:10 2020 New Revision: 364899 URL: https://svnweb.freebsd.org/changeset/base/364899 Log: Add a new line to force a commit to verify if lwhsu did indeed fix the jenkins build by adding git to the dependency list. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/Makefile.inc1 Modified: head/release/Makefile.inc1 ============================================================================== --- head/release/Makefile.inc1 Fri Aug 28 01:55:35 2020 (r364898) +++ head/release/Makefile.inc1 Fri Aug 28 02:09:10 2020 (r364899) @@ -29,3 +29,4 @@ GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify - BUILDDATE!= date +%Y%m%d .export BUILDDATE .endif + From owner-svn-src-head@freebsd.org Fri Aug 28 05:40:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 452643CEAA0; Fri, 28 Aug 2020 05:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bd7hz17tfz42pS; Fri, 28 Aug 2020 05:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B5E3102C1; Fri, 28 Aug 2020 05:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07S5e2mA051279; Fri, 28 Aug 2020 05:40:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07S5e2pI051278; Fri, 28 Aug 2020 05:40:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008280540.07S5e2pI051278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 05:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364901 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 364901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 05:40:03 -0000 Author: imp Date: Fri Aug 28 05:40:02 2020 New Revision: 364901 URL: https://svnweb.freebsd.org/changeset/base/364901 Log: Declare time() Time is used and was accidentally brought in through header pollution. Declare it in stand.h directly instead. Modified: head/stand/libsa/stand.h Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Fri Aug 28 02:20:25 2020 (r364900) +++ head/stand/libsa/stand.h Fri Aug 28 05:40:02 2020 (r364901) @@ -409,6 +409,11 @@ extern struct fs_ops *exclusive_file_system; extern struct devsw *devsw[]; /* + * Time routines + */ +time_t time(time_t *); + +/* * Expose byteorder(3) functions. */ #ifndef _BYTEORDER_PROTOTYPED From owner-svn-src-head@freebsd.org Fri Aug 28 12:09:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74D003D78D2; Fri, 28 Aug 2020 12:09:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdJLk3bRTz4TQb; Fri, 28 Aug 2020 12:09:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 07SC9ahH055466 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 28 Aug 2020 15:09:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 07SC9ahH055466 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 07SC9aVc055465; Fri, 28 Aug 2020 15:09:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 28 Aug 2020 15:09:36 +0300 From: Konstantin Belousov To: Adrian Chadd Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364091 - head/lib/libc/gen Message-ID: <20200828120936.GC2713@kib.kiev.ua> References: <202008102141.07ALfnDj009838@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4BdJLk3bRTz4TQb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [0.70 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-0.16)[-0.163]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.35)[0.350]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.51)[0.512]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 12:09:51 -0000 On Thu, Aug 27, 2020 at 05:28:03PM -0700, Adrian Chadd wrote: > Hi! > > This breaks when compiling FreeBSD-mips on GCC-9. :( > > In file included from > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:50, > from > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir_b.c:29: > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/include/block_abi.h:45:2: > error: anonymous struct declared inside parameter list will not be visible > outside of this definition or declarati > 45 | struct {\ > | ^~~~~~ > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:67:5: > note: in expansion of macro 'DECLARE_BLOCK' > 67 | DECLARE_BLOCK(int, dcomp, const struct dirent **, const struct > dirent **)) > | ^~~~~~~~~~~~~ > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/include/block_abi.h:45:2: > error: anonymous struct declared inside parameter list will not be visible > outside of this definition or declarati > 45 | struct {\ > | ^~~~~~ > /usr/home/adrian/work/freebsd/head-embedded/src/lib/libc/gen/scandir.c:66:5: > note: in expansion of macro 'DECLARE_BLOCK' > 66 | DECLARE_BLOCK(int, select, const struct dirent *), > | ^~~~~~~~~~~~~ > cc1: all warnings being treated as errors > --- scandir_b.o --- > *** [scandir_b.o] Error code 1 You did not show the exact command line for your compilation failure. Since gcc does not support blocks, I think the best route is to add something like the following to lib/libc/gen/Makefile.inc: CWARNFLAGS.gcc.scandir_b.c= -Wno-error (I did not even tried to test it). From owner-svn-src-head@freebsd.org Fri Aug 28 12:51:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C794C3B0449; Fri, 28 Aug 2020 12:51:31 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdKGp754dz4X4G; Fri, 28 Aug 2020 12:51:30 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id 07SCpLId016019; Fri, 28 Aug 2020 14:51:21 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id ADA8EF52; Fri, 28 Aug 2020 14:51:20 +0200 (CEST) Subject: Re: svn commit: r364863 - head To: Ryan Moeller , Kyle Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008271326.07RDQbGd016044@repo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: Date: Fri, 28 Aug 2020 14:51:20 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <202008271326.07RDQbGd016044@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: ACL 136 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 28 Aug 2020 14:51:21 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 4BdKGp754dz4X4G X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-2.55 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[omnilan.de]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.94)[-0.940]; NEURAL_HAM_LONG(-0.96)[-0.965]; NEURAL_HAM_SHORT(-0.35)[-0.347]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:61157, ipnet:2a00:e10:2800::/38, country:DE]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 12:51:31 -0000 Am 27.08.2020 um 15:26 schrieb Ryan Moeller: > Author: freqlabs > Date: Thu Aug 27 13:26:36 2020 > New Revision: 364863 > URL: https://svnweb.freebsd.org/changeset/base/364863 > > Log: > libzfs: Also add the crypto dependency to Makefile.inc1 > > Reported by: kevans > Discussed with: kevans > Sponsored by: iXsystems, Inc. > > Modified: > head/Makefile.inc1 Hello, this still doesn't allwo me to compile ZFS into the kernel: linking kernel.full ld: error: undefined symbol: zfs_zstd_compress >>> referenced by zio_compress.c >>>               zio_compress.o:(zio_compress_table) ld: error: undefined symbol: zfs_zstd_decompress >>> referenced by zio_compress.c >>>               zio_compress.o:(zio_compress_table) ld: error: undefined symbol: zfs_zstd_decompress_level >>> referenced by zio_compress.c >>>               zio_compress.o:(zio_compress_table) *** Error code 1 According to src/sys/amd64/conf/NOTES, "options ZFS" should still be supported. Unfortunately I have no adhoc idea how to fix. Anybody else? Thanks, -harry From owner-svn-src-head@freebsd.org Fri Aug 28 15:09:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD4D83B4551; Fri, 28 Aug 2020 15:09:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdNLH51Hmz3SvB; Fri, 28 Aug 2020 15:09:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0C616C1F; Fri, 28 Aug 2020 15:09:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SF9hGP002269; Fri, 28 Aug 2020 15:09:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SF9h8C002268; Fri, 28 Aug 2020 15:09:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281509.07SF9h8C002268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 15:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364918 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 15:09:43 -0000 Author: imp Date: Fri Aug 28 15:09:43 2020 New Revision: 364918 URL: https://svnweb.freebsd.org/changeset/base/364918 Log: remove splbio and splcam splbio and splcan have been completely removed from the tree. We can now remove their definitions here. They've been nops for a long time and were only preserved to give hints on how to lock drivers. All drivers have been deleted or converted, so they can be deleted now. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Aug 28 13:15:13 2020 (r364917) +++ head/sys/sys/systm.h Fri Aug 28 15:09:43 2020 (r364918) @@ -497,8 +497,6 @@ void kern_reboot(int) __dead2; void shutdown_nice(int); /* Stubs for obsolete functions that used to be for interrupt management */ -static __inline intrmask_t splbio(void) { return 0; } -static __inline intrmask_t splcam(void) { return 0; } static __inline intrmask_t splclock(void) { return 0; } static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } From owner-svn-src-head@freebsd.org Fri Aug 28 15:35:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C8B33B518E; Fri, 28 Aug 2020 15:35:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdNwM0xLhz3VCb; Fri, 28 Aug 2020 15:35:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F31B516ED9; Fri, 28 Aug 2020 15:35:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SFZkJW020312; Fri, 28 Aug 2020 15:35:46 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SFZjKb020308; Fri, 28 Aug 2020 15:35:45 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202008281535.07SFZjKb020308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 28 Aug 2020 15:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364919 - in head/bin/sh: . tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/execution X-SVN-Commit-Revision: 364919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 15:35:47 -0000 Author: jilles Date: Fri Aug 28 15:35:45 2020 New Revision: 364919 URL: https://svnweb.freebsd.org/changeset/base/364919 Log: sh: Keep ignored SIGINT/SIGQUIT after set in a background job If job control is not enabled, a background job (... &) ignores SIGINT and SIGQUIT, but this can be reverted using the trap builtin in the same shell environment. Using the set builtin to change options would also revert SIGINT and SIGQUIT to their previous dispositions. This broke due to r317298. Calling setsignal() reverts the effect of ignoresig(). Reported by: bdrewery MFC after: 1 week Added: head/bin/sh/tests/execution/bg13.0 (contents, props changed) Modified: head/bin/sh/main.c head/bin/sh/tests/execution/Makefile head/bin/sh/trap.c head/bin/sh/trap.h Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Fri Aug 28 15:09:43 2020 (r364918) +++ head/bin/sh/main.c Fri Aug 28 15:35:45 2020 (r364919) @@ -134,6 +134,7 @@ main(int argc, char *argv[]) setstackmark(&smark); setstackmark(&smark2); procargs(argc, argv); + trap_init(); pwd_init(iflag); INTON; if (iflag) Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Fri Aug 28 15:09:43 2020 (r364918) +++ head/bin/sh/tests/execution/Makefile Fri Aug 28 15:35:45 2020 (r364919) @@ -19,6 +19,7 @@ ${PACKAGE}FILES+= bg9.0 ${PACKAGE}FILES+= bg10.0 bg10.0.stdout ${PACKAGE}FILES+= bg11.0 ${PACKAGE}FILES+= bg12.0 +${PACKAGE}FILES+= bg13.0 ${PACKAGE}FILES+= env1.0 ${PACKAGE}FILES+= fork1.0 ${PACKAGE}FILES+= fork2.0 Added: head/bin/sh/tests/execution/bg13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/bg13.0 Fri Aug 28 15:35:45 2020 (r364919) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +# Use a trap, not the default action, since the shell may catch SIGINT and +# therefore its processing may be delayed. +{ set -C; trap 'exit 5' TERM; read dummy fifo1 +kill -INT "$!" +kill -TERM "$!" +exec 3>&- +wait "$!" +r=$? +[ "$r" = 5 ] Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Fri Aug 28 15:09:43 2020 (r364918) +++ head/bin/sh/trap.c Fri Aug 28 15:35:45 2020 (r364919) @@ -474,14 +474,20 @@ dotrap(void) } +void +trap_init(void) +{ + setsignal(SIGINT); + setsignal(SIGQUIT); +} + + /* * Controls whether the shell is interactive or not based on iflag. */ void setinteractive(void) { - setsignal(SIGINT); - setsignal(SIGQUIT); setsignal(SIGTERM); } Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Fri Aug 28 15:09:43 2020 (r364918) +++ head/bin/sh/trap.h Fri Aug 28 15:35:45 2020 (r364919) @@ -45,6 +45,7 @@ void ignoresig(int); int issigchldtrapped(void); void onsig(int); void dotrap(void); +void trap_init(void); void setinteractive(void); void exitshell(int) __dead2; void exitshell_savedstatus(void) __dead2; From owner-svn-src-head@freebsd.org Fri Aug 28 15:43:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85C153B51B5; Fri, 28 Aug 2020 15:43:33 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdP5K2wwpz3VrH; Fri, 28 Aug 2020 15:43:33 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:44b0:df85:5e43:f180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0FCED36E92; Fri, 28 Aug 2020 15:43:33 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r364863 - head To: Harry Schmalzbauer , Ryan Moeller , Kyle Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008271326.07RDQbGd016044@repo.freebsd.org> From: Ryan Moeller Message-ID: <1e71689e-5dca-f5cc-bc3a-177b45621431@FreeBSD.org> Date: Fri, 28 Aug 2020 11:43:32 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 15:43:33 -0000 On 8/28/20 8:51 AM, Harry Schmalzbauer wrote: > Am 27.08.2020 um 15:26 schrieb Ryan Moeller: >> Author: freqlabs >> Date: Thu Aug 27 13:26:36 2020 >> New Revision: 364863 >> URL: https://svnweb.freebsd.org/changeset/base/364863 >> >> Log: >>    libzfs: Also add the crypto dependency to Makefile.inc1 >>       Reported by:    kevans >>    Discussed with:    kevans >>    Sponsored by:    iXsystems, Inc. >> >> Modified: >>    head/Makefile.inc1 > > > Hello, > > this still doesn't allwo me to compile ZFS into the kernel: > linking kernel.full > ld: error: undefined symbol: zfs_zstd_compress > >>> referenced by zio_compress.c > >>>               zio_compress.o:(zio_compress_table) > > ld: error: undefined symbol: zfs_zstd_decompress > >>> referenced by zio_compress.c > >>>               zio_compress.o:(zio_compress_table) > > ld: error: undefined symbol: zfs_zstd_decompress_level > >>> referenced by zio_compress.c > >>>               zio_compress.o:(zio_compress_table) > *** Error code 1 > > According to src/sys/amd64/conf/NOTES, "options ZFS" should still be > supported. > Unfortunately I have no adhoc idea how to fix. Anybody else? You need options ZSTDIO, too. NOTES needs to be updated. -Ryan > > Thanks, > -harry From owner-svn-src-head@freebsd.org Fri Aug 28 16:26:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD7B13B673C; Fri, 28 Aug 2020 16:26:04 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdQ2M02hjz3YvQ; Fri, 28 Aug 2020 16:26:02 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id 07SGPwED018368; Fri, 28 Aug 2020 18:25:58 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id F0DE5F9E; Fri, 28 Aug 2020 18:25:57 +0200 (CEST) Subject: Re: svn commit: r364863 - head To: Ryan Moeller , Kyle Evans , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <202008271326.07RDQbGd016044@repo.freebsd.org> <1e71689e-5dca-f5cc-bc3a-177b45621431@FreeBSD.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <1003ad68-5339-789c-1451-f26ff2a31606@omnilan.de> Date: Fri, 28 Aug 2020 18:25:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1e71689e-5dca-f5cc-bc3a-177b45621431@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: ACL 136 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 28 Aug 2020 18:25:58 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 4BdQ2M02hjz3YvQ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-2.19 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[omnilan.de]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.92)[-0.920]; NEURAL_HAM_LONG(-0.97)[-0.966]; NEURAL_HAM_SHORT(-0.00)[-0.005]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:61157, ipnet:2a00:e10:2800::/38, country:DE]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 16:26:05 -0000 Am 28.08.2020 um 17:43 schrieb Ryan Moeller: … >> ld: error: undefined symbol: zfs_zstd_decompress_level >> >>> referenced by zio_compress.c >> >>>               zio_compress.o:(zio_compress_table) >> *** Error code 1 >> >> According to src/sys/amd64/conf/NOTES, "options ZFS" should still be >> supported. >> Unfortunately I have no adhoc idea how to fix. Anybody else? > > > You need options ZSTDIO, too. NOTES needs to be updated. Thanks a lot! May I suggest the following change: Index: sys/contrib/openzfs/man/man8/zfsprops.8 =================================================================== --- sys/contrib/openzfs/man/man8/zfsprops.8 (Revision 364900) +++ sys/contrib/openzfs/man/man8/zfsprops.8 (Arbeitskopie) @@ -1049,8 +1049,9 @@ dataset creation time and it cannot be changed afterwards. .Pp For more details and caveats about encryption see the -.Sy Encryption -section. +.Em Encryption +section of +.Xr zfs-load-key 8 . .It Sy keyformat Ns = Ns Sy raw Ns | Ns Sy hex Ns | Ns Sy passphrase Controls what format the user's encryption key will be provided as. This property is only set when the dataset is encrypted. Curious about the new OpenZFS bells and whistles, I promptly struggeld over finding "the Encryption section". Some lines above, the man page already mentiones explicitly zfs-load-key.8 while referencing the Encryption section, so I just copied the macros used there - not much clue about man here… Thanks, -harry From owner-svn-src-head@freebsd.org Fri Aug 28 16:40:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 845033B73B3; Fri, 28 Aug 2020 16:40:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdQM631W1z3bLV; Fri, 28 Aug 2020 16:40:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6B7175DE; Fri, 28 Aug 2020 16:40:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SGeYr0058101; Fri, 28 Aug 2020 16:40:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SGeXTb058099; Fri, 28 Aug 2020 16:40:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281640.07SGeXTb058099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 16:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364920 - in head/sys: dev/speaker sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/speaker sys X-SVN-Commit-Revision: 364920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 16:40:34 -0000 Author: imp Date: Fri Aug 28 16:40:33 2020 New Revision: 364920 URL: https://svnweb.freebsd.org/changeset/base/364920 Log: Remove splclock(). It's not useful to keep. splclock is used in one driver (spkr) to control access to timer_spkr_* routines. However, nothing else does. So it shows no useful locking info to someone that would want to lock spkr. NOTE: I think there's races with timer_spkr_{acquire,release} since there's no interlock in those routines, despite there being a spin lock to protect the clock. Current other users appear to use no extra locking protocol, though they themselves appear to be at least attempting to make sure that only a single thread calls these routines. I suspect the right answer is to update these routines to take/release the clock spin lock since they are short and to the point, but that's beyond the scope of this commit. Modified: head/sys/dev/speaker/spkr.c head/sys/sys/systm.h Modified: head/sys/dev/speaker/spkr.c ============================================================================== --- head/sys/dev/speaker/spkr.c Fri Aug 28 15:35:45 2020 (r364919) +++ head/sys/dev/speaker/spkr.c Fri Aug 28 16:40:33 2020 (r364920) @@ -65,7 +65,7 @@ static void playstring(char *cp, size_t slen); static void tone(unsigned int thz, unsigned int centisecs) { - int sps, timo; + int timo; if (thz <= 0) return; @@ -75,14 +75,10 @@ tone(unsigned int thz, unsigned int centisecs) #endif /* DEBUG */ /* set timer to generate clicks at given frequency in Hertz */ - sps = splclock(); - if (timer_spkr_acquire()) { /* enter list of waiting procs ??? */ - splx(sps); return; } - splx(sps); disable_intr(); timer_spkr_setfreq(thz); enable_intr(); @@ -95,9 +91,7 @@ tone(unsigned int thz, unsigned int centisecs) timo = centisecs * hz / 100; if (timo > 0) tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", timo); - sps = splclock(); timer_spkr_release(); - splx(sps); } /* Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Aug 28 15:35:45 2020 (r364919) +++ head/sys/sys/systm.h Fri Aug 28 16:40:33 2020 (r364920) @@ -497,7 +497,6 @@ void kern_reboot(int) __dead2; void shutdown_nice(int); /* Stubs for obsolete functions that used to be for interrupt management */ -static __inline intrmask_t splclock(void) { return 0; } static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } static __inline intrmask_t splnet(void) { return 0; } From owner-svn-src-head@freebsd.org Fri Aug 28 17:05:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B40F3B85E1; Fri, 28 Aug 2020 17:05:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdQvR5BCHz3fHb; Fri, 28 Aug 2020 17:05:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B97017E7E; Fri, 28 Aug 2020 17:05:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SH57D3076801; Fri, 28 Aug 2020 17:05:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SH57Jj076800; Fri, 28 Aug 2020 17:05:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281705.07SH57Jj076800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 17:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364922 - head/sys/dev/mn X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/mn X-SVN-Commit-Revision: 364922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 17:05:08 -0000 Author: imp Date: Fri Aug 28 17:05:06 2020 New Revision: 364922 URL: https://svnweb.freebsd.org/changeset/base/364922 Log: Update outdated comment There is no splnet anymore, so update the comment to drop references to it. Modified: head/sys/dev/mn/if_mn.c Modified: head/sys/dev/mn/if_mn.c ============================================================================== --- head/sys/dev/mn/if_mn.c Fri Aug 28 16:40:38 2020 (r364921) +++ head/sys/dev/mn/if_mn.c Fri Aug 28 17:05:06 2020 (r364922) @@ -743,7 +743,7 @@ ngmn_connect(hook_p hook) if (!(u & 1)) printf("%s: init chan %d stat %08x\n", sc->name, chan, u); sc->m32x->stat = 1; - /* probably not at splnet, force outward queueing */ + /* force outward queueing */ NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); return (0); From owner-svn-src-head@freebsd.org Fri Aug 28 17:06:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 909813B8673; Fri, 28 Aug 2020 17:06:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdQx82txvz3fDm; Fri, 28 Aug 2020 17:06:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4690E18481; Fri, 28 Aug 2020 17:06:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SH6agd076963; Fri, 28 Aug 2020 17:06:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SH6Zo3076962; Fri, 28 Aug 2020 17:06:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008281706.07SH6Zo3076962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 28 Aug 2020 17:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364923 - in head/sys: amd64/conf conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: amd64/conf conf X-SVN-Commit-Revision: 364923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 17:06:36 -0000 Author: mmacy Date: Fri Aug 28 17:06:35 2020 New Revision: 364923 URL: https://svnweb.freebsd.org/changeset/base/364923 Log: ZFS: clarify dependencies for static linking Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Aug 28 17:05:06 2020 (r364922) +++ head/sys/amd64/conf/NOTES Fri Aug 28 17:06:35 2020 (r364923) @@ -635,6 +635,7 @@ options LINSYSFS ##################################################################### # ZFS support +# NB: This depends on crypto, cryptodev and ZSTDIO options ZFS ##################################################################### Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 28 17:05:06 2020 (r364922) +++ head/sys/conf/NOTES Fri Aug 28 17:06:35 2020 (r364923) @@ -2807,7 +2807,8 @@ options IMAGACT_BINMISC options GZIO # zstd support -# This enables support for Zstd compressed core dumps and GEOM_UZIP images. +# This enables support for Zstd compressed core dumps, GEOM_UZIP images, +# and is required by zfs if statically linked. options ZSTDIO # BHND(4) drivers From owner-svn-src-head@freebsd.org Fri Aug 28 17:36:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E6A73B94C8; Fri, 28 Aug 2020 17:36:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdRbL6d5vz3ynJ; Fri, 28 Aug 2020 17:36:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6D8F1864E; Fri, 28 Aug 2020 17:36:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SHaEHC096076; Fri, 28 Aug 2020 17:36:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SHaEqE096075; Fri, 28 Aug 2020 17:36:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281736.07SHaEqE096075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 17:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364924 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 364924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 17:36:15 -0000 Author: imp Date: Fri Aug 28 17:36:14 2020 New Revision: 364924 URL: https://svnweb.freebsd.org/changeset/base/364924 Log: Create CFLAGS_EARLY.file for boot loader. Some external code requires a specific set of include paths to work properly since it emulates the typical environment the code is used in. Enable this by creating a CFLAGS_EARLY.file variable that can be used to build this stack. Otherwise the include stack we build for stand programs may get in the way. Code that uses this feature has to tolerate the normal stack of inclues being last on the list (and presumably unused), though. Generally, it it should only be used for the specific include directories. Defines and that sort of thing should be done in the normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for everything in a Makefile. Modified: head/stand/defs.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Fri Aug 28 17:06:35 2020 (r364923) +++ head/stand/defs.mk Fri Aug 28 17:36:14 2020 (r364924) @@ -55,6 +55,11 @@ LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a # Standard options: CFLAGS+= -nostdinc +# Allow CFLAGS_EARLY.file/target so that code that needs specific stack +# of include paths can set them up before our include paths. Normally +# the only thing that should be there are -I directives, and as few of +# those as possible. +CFLAGS+= ${CFLAGS_EARLY} ${CFLAGS_EARLY.${.IMPSRC:T}} ${CFLAGS_EARLY.${.TARGET:T}} .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 CFLAGS+= -I${BOOTOBJ}/libsa32 .else From owner-svn-src-head@freebsd.org Fri Aug 28 17:49:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D33B93B9F2F; Fri, 28 Aug 2020 17:49:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdRv86x2xz41sJ; Fri, 28 Aug 2020 17:49:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A786D18A20; Fri, 28 Aug 2020 17:49:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SHnuql002978; Fri, 28 Aug 2020 17:49:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SHnujY002977; Fri, 28 Aug 2020 17:49:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281749.07SHnujY002977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 17:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364925 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 17:50:01 -0000 Author: imp Date: Fri Aug 28 17:49:56 2020 New Revision: 364925 URL: https://svnweb.freebsd.org/changeset/base/364925 Log: Allow the pseudo-errnos to be returned as well in boot loader Expose the pseudo-errno values in _STANDALONE is defined so that code in the boot loader can make use of them. Nothing uses them today, but the zstd support that's coming will need them. Modified: head/sys/sys/errno.h Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Fri Aug 28 17:36:14 2020 (r364924) +++ head/sys/sys/errno.h Fri Aug 28 17:49:56 2020 (r364925) @@ -187,7 +187,7 @@ __END_DECLS #define ELAST 97 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) || defined(_STANDALONE) /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ From owner-svn-src-head@freebsd.org Fri Aug 28 17:55:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D5CB3BA41C; Fri, 28 Aug 2020 17:55:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdS233jLGz42VZ; Fri, 28 Aug 2020 17:55:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6384D1867B; Fri, 28 Aug 2020 17:55:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SHttkx008965; Fri, 28 Aug 2020 17:55:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SHttMO008964; Fri, 28 Aug 2020 17:55:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008281755.07SHttMO008964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 28 Aug 2020 17:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364926 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 17:55:55 -0000 Author: imp Date: Fri Aug 28 17:55:54 2020 New Revision: 364926 URL: https://svnweb.freebsd.org/changeset/base/364926 Log: Treat the boot loader as the same as the kernel for what's visible The boot loader will be growing some (limited) support for some kernel interfaces for some of the timekeeping routines to support zstd code. Allow the declarations for them to be visible when compiling for the boot loader, rather than treating it like a user-space environment (which stand.h already provides to a limited degree). Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Fri Aug 28 17:49:56 2020 (r364925) +++ head/sys/sys/time.h Fri Aug 28 17:55:54 2020 (r364926) @@ -492,7 +492,7 @@ struct clockinfo { #define CPUCLOCK_WHICH_TID 1 #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_STANDALONE) /* * Kernel to clock driver interface. @@ -600,7 +600,7 @@ int tvtohz(struct timeval *tv); (((sbt2) >= sbt_timethreshold) ? \ ((*(sbt) = getsbinuptime()), 1) : ((*(sbt) = sbinuptime()), 0)) -#else /* !_KERNEL */ +#else /* !_KERNEL && !_STANDALONE */ #include #include From owner-svn-src-head@freebsd.org Fri Aug 28 18:25:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FEA03BB154; Fri, 28 Aug 2020 18:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdShV2QtGz45sS; Fri, 28 Aug 2020 18:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3703A18ED5; Fri, 28 Aug 2020 18:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SIPktB029647; Fri, 28 Aug 2020 18:25:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SIPkBa029646; Fri, 28 Aug 2020 18:25:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008281825.07SIPkBa029646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 28 Aug 2020 18:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364927 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 364927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 18:25:46 -0000 Author: manu Date: Fri Aug 28 18:25:45 2020 New Revision: 364927 URL: https://svnweb.freebsd.org/changeset/base/364927 Log: arm: allwinner: clk: Add printfs when we cannot set the correct freq For some unknown reason this seems to fix this function when we printf the best variable. This isn't a delay problem as doing a printf without it doesn't solve this problem. This is way above my pay grade so add some printf that shouldn't be printed in 99% of the case anyway. Fix booting on most Allwinner boards as the mmc IP uses a NM clock. Reported by: Alexander Mishin MFC after: 3 days X-MFC-With: 363887 Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Aug 28 17:55:54 2020 (r364926) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Aug 28 18:25:45 2020 (r364927) @@ -221,11 +221,15 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare if ((best < *fout) && ((flags & CLK_SET_ROUND_DOWN) == 0)) { *stop = 1; + printf("best freq (%llu) < requested freq(%llu)\n", + best, *fout); return (ERANGE); } if ((best > *fout) && ((flags & CLK_SET_ROUND_UP) == 0)) { *stop = 1; + printf("best freq (%llu) > requested freq(%llu)\n", + best, *fout); return (ERANGE); } From owner-svn-src-head@freebsd.org Fri Aug 28 18:53:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 041843BC2BA; Fri, 28 Aug 2020 18:53:54 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdTJx6gVqz48lj; Fri, 28 Aug 2020 18:53:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C95D7193D3; Fri, 28 Aug 2020 18:53:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SIrrlx049032; Fri, 28 Aug 2020 18:53:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SIrjDK048986; Fri, 28 Aug 2020 18:53:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008281853.07SIrjDK048986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 28 Aug 2020 18:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364930 - in head/sys/contrib/openzfs: . cmd/zpool include include/sys/fs lib/libspl/include/os/freebsd/sys lib/libzfs man/man1 man/man5 man/man8 module module/lua/setjmp module/os/linu... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/contrib/openzfs: . cmd/zpool include include/sys/fs lib/libspl/include/os/freebsd/sys lib/libzfs man/man1 man/man5 man/man8 module module/lua/setjmp module/os/linux/zfs module/zcommon modu... X-SVN-Commit-Revision: 364930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 18:53:54 -0000 Author: mmacy Date: Fri Aug 28 18:53:45 2020 New Revision: 364930 URL: https://svnweb.freebsd.org/changeset/base/364930 Log: ZFS: MFV 2.0-rc1-ga00c61 Added: head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh - copied unchanged from r364929, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh Modified: head/sys/contrib/openzfs/META head/sys/contrib/openzfs/NEWS head/sys/contrib/openzfs/cmd/zpool/zpool_main.c head/sys/contrib/openzfs/include/libzfs_impl.h head/sys/contrib/openzfs/include/sys/fs/zfs.h head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c head/sys/contrib/openzfs/man/man1/arcstat.1 head/sys/contrib/openzfs/man/man1/cstyle.1 head/sys/contrib/openzfs/man/man1/raidz_test.1 head/sys/contrib/openzfs/man/man1/zhack.1 head/sys/contrib/openzfs/man/man1/ztest.1 head/sys/contrib/openzfs/man/man5/spl-module-parameters.5 head/sys/contrib/openzfs/man/man5/vdev_id.conf.5 head/sys/contrib/openzfs/man/man5/zfs-events.5 head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 head/sys/contrib/openzfs/man/man5/zpool-features.5 head/sys/contrib/openzfs/man/man8/fsck.zfs.8 head/sys/contrib/openzfs/man/man8/mount.zfs.8 head/sys/contrib/openzfs/man/man8/vdev_id.8 head/sys/contrib/openzfs/man/man8/zed.8.in head/sys/contrib/openzfs/man/man8/zfs-mount-generator.8.in head/sys/contrib/openzfs/man/man8/zfs.8 head/sys/contrib/openzfs/man/man8/zinject.8 head/sys/contrib/openzfs/man/man8/zpool-iostat.8 head/sys/contrib/openzfs/man/man8/zpool.8 head/sys/contrib/openzfs/man/man8/zstreamdump.8 head/sys/contrib/openzfs/module/Makefile.bsd head/sys/contrib/openzfs/module/lua/setjmp/setjmp_ppc.S head/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c head/sys/contrib/openzfs/module/zcommon/zfs_fletcher.c head/sys/contrib/openzfs/module/zfs/arc.c head/sys/contrib/openzfs/module/zfs/dmu.c head/sys/contrib/openzfs/module/zfs/dnode_sync.c head/sys/contrib/openzfs/module/zfs/dsl_dir.c head/sys/contrib/openzfs/module/zfs/sa.c head/sys/contrib/openzfs/module/zfs/spa.c head/sys/contrib/openzfs/module/zfs/vdev_raidz_math.c head/sys/contrib/openzfs/module/zstd/Makefile.in head/sys/contrib/openzfs/tests/runfiles/common.run head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am Directory Properties: head/sys/contrib/openzfs/ (props changed) Modified: head/sys/contrib/openzfs/META ============================================================================== --- head/sys/contrib/openzfs/META Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/META Fri Aug 28 18:53:45 2020 (r364930) @@ -1,10 +1,10 @@ Meta: 1 Name: zfs Branch: 1.0 -Version: 0.8.0 -Release: 1 +Version: 2.0.0 +Release: rc1 Release-Tags: relext License: CDDL -Author: OpenZFS on Linux -Linux-Maximum: 5.6 +Author: OpenZFS +Linux-Maximum: 5.8 Linux-Minimum: 3.10 Modified: head/sys/contrib/openzfs/NEWS ============================================================================== --- head/sys/contrib/openzfs/NEWS Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/NEWS Fri Aug 28 18:53:45 2020 (r364930) @@ -1,3 +1,3 @@ Descriptions of all releases can be found on github: -https://github.com/zfsonlinux/zfs/releases +https://github.com/openzfs/zfs/releases Modified: head/sys/contrib/openzfs/cmd/zpool/zpool_main.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zpool/zpool_main.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/cmd/zpool/zpool_main.c Fri Aug 28 18:53:45 2020 (r364930) @@ -2816,7 +2816,8 @@ show_import(nvlist_t *config) if (msgid != NULL) { (void) printf(gettext( - " see: https://zfsonlinux.org/msg/%s\n"), msgid); + " see: https://openzfs.github.io/openzfs-docs/msg/%s\n"), + msgid); } (void) printf(gettext(" config:\n\n")); @@ -7804,7 +7805,7 @@ print_dedup_stats(nvlist_t *config) * pool: tank * status: DEGRADED * reason: One or more devices ... - * see: https://zfsonlinux.org/msg/ZFS-xxxx-01 + * see: https://openzfs.github.io/openzfs-docs/msg/ZFS-xxxx-01 * config: * mirror DEGRADED * c1t0d0 OK @@ -8193,7 +8194,9 @@ status_callback(zpool_handle_t *zhp, void *data) if (msgid != NULL) { printf(" "); printf_color(ANSI_BOLD, gettext("see:")); - printf(gettext(" https://zfsonlinux.org/msg/%s\n"), msgid); + printf(gettext( + " https://openzfs.github.io/openzfs-docs/msg/%s\n"), + msgid); } if (config != NULL) { Modified: head/sys/contrib/openzfs/include/libzfs_impl.h ============================================================================== --- head/sys/contrib/openzfs/include/libzfs_impl.h Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/include/libzfs_impl.h Fri Aug 28 18:53:45 2020 (r364930) @@ -71,6 +71,7 @@ struct libzfs_handle { char libzfs_chassis_id[256]; boolean_t libzfs_prop_debug; regex_t libzfs_urire; + uint64_t libzfs_max_nvlist; }; struct zfs_handle { Modified: head/sys/contrib/openzfs/include/sys/fs/zfs.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/fs/zfs.h Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/include/sys/fs/zfs.h Fri Aug 28 18:53:45 2020 (r364930) @@ -1013,10 +1013,10 @@ typedef struct vdev_rebuild_stat { } vdev_rebuild_stat_t; /* - * Errata described by https://zfsonlinux.org/msg/ZFS-8000-ER. The ordering - * of this enum must be maintained to ensure the errata identifiers map to - * the correct documentation. New errata may only be appended to the list - * and must contain corresponding documentation at the above link. + * Errata described by https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-ER. + * The ordering of this enum must be maintained to ensure the errata identifiers + * map to the correct documentation. New errata may only be appended to the + * list and must contain corresponding documentation at the above link. */ typedef enum zpool_errata { ZPOOL_ERRATA_NONE, Modified: head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h ============================================================================== --- head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h Fri Aug 28 18:53:45 2020 (r364930) @@ -35,12 +35,8 @@ #include #include -/* - * Some old glibc headers don't define BLKGETSIZE64 - * and we don't want to require the kernel headers - */ #if !defined(BLKGETSIZE64) -#define BLKGETSIZE64 _IOR(0x12, 114, size_t) +#define BLKGETSIZE64 DIOCGMEDIASIZE #endif /* Modified: head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c ============================================================================== --- head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c Fri Aug 28 18:53:45 2020 (r364930) @@ -610,6 +610,18 @@ send_iterate_fs(zfs_handle_t *zhp, void *arg) fnvlist_free(sd->snapprops); fnvlist_free(sd->snapholds); + /* Do not allow the size of the properties list to exceed the limit */ + if ((fnvlist_size(nvfs) + fnvlist_size(sd->fss)) > + zhp->zfs_hdl->libzfs_max_nvlist) { + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "warning: cannot send %s@%s: the size of the list of " + "snapshots and properties is too large to be received " + "successfully.\n" + "Select a smaller number of snapshots to send.\n"), + zhp->zfs_name, sd->tosnap); + rv = EZFS_NOSPC; + goto out; + } /* add this fs to nvlist */ (void) snprintf(guidstring, sizeof (guidstring), "0x%llx", (longlong_t)guid); @@ -2015,6 +2027,21 @@ send_prelim_records(zfs_handle_t *zhp, const char *fro return (zfs_error(zhp->zfs_hdl, EZFS_BADBACKUP, errbuf)); } + /* + * Do not allow the size of the properties list to exceed + * the limit + */ + if ((fnvlist_size(fss) + fnvlist_size(hdrnv)) > + zhp->zfs_hdl->libzfs_max_nvlist) { + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, "warning: cannot send '%s': " + "the size of the list of snapshots and properties " + "is too large to be received successfully.\n" + "Select a smaller number of snapshots to send.\n"), + zhp->zfs_name); + return (zfs_error(zhp->zfs_hdl, EZFS_NOSPC, + errbuf)); + } fnvlist_add_nvlist(hdrnv, "fss", fss); VERIFY0(nvlist_pack(hdrnv, &packbuf, &buflen, NV_ENCODE_XDR, 0)); @@ -2578,8 +2605,6 @@ recv_read(libzfs_handle_t *hdl, int fd, void *buf, int int rv; int len = ilen; - assert(ilen <= SPA_MAXBLOCKSIZE); - do { rv = read(fd, cp, len); cp += rv; @@ -2613,6 +2638,11 @@ recv_read_nvlist(libzfs_handle_t *hdl, int fd, int len if (buf == NULL) return (ENOMEM); + if (len > hdl->libzfs_max_nvlist) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "nvlist too large")); + return (ENOMEM); + } + err = recv_read(hdl, fd, buf, len, byteswap, zc); if (err != 0) { free(buf); @@ -3783,6 +3813,7 @@ recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byte } payload_size = DRR_WRITE_PAYLOAD_SIZE(&drr->drr_u.drr_write); + assert(payload_size <= SPA_MAXBLOCKSIZE); (void) recv_read(hdl, fd, buf, payload_size, B_FALSE, NULL); break; @@ -4819,7 +4850,8 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const case ZFS_ERR_FROM_IVSET_GUID_MISSING: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "IV set guid missing. See errata %u at " - "https://zfsonlinux.org/msg/ZFS-8000-ER."), + "https://openzfs.github.io/openzfs-docs/msg/" + "ZFS-8000-ER."), ZPOOL_ERRATA_ZOL_8308_ENCRYPTION); (void) zfs_error(hdl, EZFS_BADSTREAM, errbuf); break; Modified: head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c ============================================================================== --- head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c Fri Aug 28 18:53:45 2020 (r364930) @@ -1008,6 +1008,7 @@ libzfs_init(void) { libzfs_handle_t *hdl; int error; + char *env; error = libzfs_load_module(); if (error) { @@ -1054,6 +1055,15 @@ libzfs_init(void) if (getenv("ZFS_PROP_DEBUG") != NULL) { hdl->libzfs_prop_debug = B_TRUE; + } + if ((env = getenv("ZFS_SENDRECV_MAX_NVLIST")) != NULL) { + if ((error = zfs_nicestrtonum(hdl, env, + &hdl->libzfs_max_nvlist))) { + errno = error; + return (NULL); + } + } else { + hdl->libzfs_max_nvlist = (SPA_MAXBLOCKSIZE * 4); } /* Modified: head/sys/contrib/openzfs/man/man1/arcstat.1 ============================================================================== --- head/sys/contrib/openzfs/man/man1/arcstat.1 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man1/arcstat.1 Fri Aug 28 18:53:45 2020 (r364930) @@ -13,7 +13,7 @@ .\" Copyright (c) 2015 by Delphix. All rights reserved. .\" Copyright (c) 2020 by AJ Jordan. All rights reserved. .\" -.TH ARCSTAT 1 "May 7, 2020" +.TH ARCSTAT 1 "Aug 24, 2020" OpenZFS .SH NAME arcstat \- report ZFS ARC and L2ARC statistics .SH SYNOPSIS Modified: head/sys/contrib/openzfs/man/man1/cstyle.1 ============================================================================== --- head/sys/contrib/openzfs/man/man1/cstyle.1 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man1/cstyle.1 Fri Aug 28 18:53:45 2020 (r364930) @@ -20,7 +20,7 @@ .\" .\" CDDL HEADER END .\" -.TH cstyle 1 "28 March 2005" +.TH CSTYLE 1 "Aug 24, 2020" OpenZFS .SH NAME .I cstyle \- check for some common stylistic errors in C source files Modified: head/sys/contrib/openzfs/man/man1/raidz_test.1 ============================================================================== --- head/sys/contrib/openzfs/man/man1/raidz_test.1 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man1/raidz_test.1 Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" .\" Copyright (c) 2016 Gvozden Nešković. All rights reserved. .\" -.TH raidz_test 1 "2016" "ZFS on Linux" "User Commands" +.TH RAIDZ_TEST 1 "Aug 24, 2020" OpenZFS .SH NAME \fBraidz_test\fR \- raidz implementation verification and benchmarking tool Modified: head/sys/contrib/openzfs/man/man1/zhack.1 ============================================================================== --- head/sys/contrib/openzfs/man/man1/zhack.1 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man1/zhack.1 Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" .\" Copyright 2013 Darik Horn . All rights reserved. .\" -.TH zhack 1 "2013 MAR 16" "ZFS on Linux" "User Commands" +.TH ZHACK 1 "Aug 24, 2020" OpenZFS .SH NAME zhack \- libzpool debugging tool Modified: head/sys/contrib/openzfs/man/man1/ztest.1 ============================================================================== --- head/sys/contrib/openzfs/man/man1/ztest.1 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man1/ztest.1 Fri Aug 28 18:53:45 2020 (r364930) @@ -24,7 +24,7 @@ .\" Copyright (c) 2009 Michael Gebetsroither . All rights .\" reserved. .\" -.TH ztest 1 "2009 NOV 01" "ZFS on Linux" "User Commands" +.TH ZTEST 1 "Aug 24, 2020" OpenZFS .SH NAME \fBztest\fR \- was written by the ZFS Developers as a ZFS unit test. Modified: head/sys/contrib/openzfs/man/man5/spl-module-parameters.5 ============================================================================== --- head/sys/contrib/openzfs/man/man5/spl-module-parameters.5 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man5/spl-module-parameters.5 Fri Aug 28 18:53:45 2020 (r364930) @@ -2,7 +2,7 @@ .\" .\" Copyright 2013 Turbo Fredriksson . All rights reserved. .\" -.TH SPL-MODULE-PARAMETERS 5 "Oct 28, 2017" +.TH SPL-MODULE-PARAMETERS 5 "Aug 24, 2020" OpenZFS .SH NAME spl\-module\-parameters \- SPL module parameters .SH DESCRIPTION @@ -225,7 +225,7 @@ Default value: \fB/etc/hostid\fR \fBspl_panic_halt\fR (uint) .ad .RS 12n -Cause a kernel panic on assertion failures. When not enabled, the thread is +Cause a kernel panic on assertion failures. When not enabled, the thread is halted to facilitate further debugging. .sp Set to a non-zero value to enable. Modified: head/sys/contrib/openzfs/man/man5/vdev_id.conf.5 ============================================================================== --- head/sys/contrib/openzfs/man/man5/vdev_id.conf.5 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man5/vdev_id.conf.5 Fri Aug 28 18:53:45 2020 (r364930) @@ -1,4 +1,4 @@ -.TH vdev_id.conf 5 +.TH VDEV_ID.CONF 5 "Aug 24, 2020" OpenZFS .SH NAME vdev_id.conf \- Configuration file for vdev_id .SH DESCRIPTION Modified: head/sys/contrib/openzfs/man/man5/zfs-events.5 ============================================================================== --- head/sys/contrib/openzfs/man/man5/zfs-events.5 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man5/zfs-events.5 Fri Aug 28 18:53:45 2020 (r364930) @@ -13,7 +13,7 @@ .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your .\" own identifying information: .\" Portions Copyright [yyyy] [name of copyright owner] -.TH ZFS-EVENTS 5 "Oct 24, 2018" +.TH ZFS-EVENTS 5 "Aug 24, 2020" OpenZFS .SH NAME zfs\-events \- Events created by the ZFS filesystem. .SH DESCRIPTION Modified: head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 ============================================================================== --- head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 Fri Aug 28 18:53:45 2020 (r364930) @@ -14,7 +14,7 @@ .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your .\" own identifying information: .\" Portions Copyright [yyyy] [name of copyright owner] -.TH ZFS-MODULE-PARAMETERS 5 "Feb 15, 2019" +.TH ZFS-MODULE-PARAMETERS 5 "Aug 24, 2020" OpenZFS .SH NAME zfs\-module\-parameters \- ZFS module parameters .SH DESCRIPTION @@ -201,6 +201,20 @@ Default value: \fB200\fR%. .sp .ne 2 .na +\fBl2arc_meta_percent\fR (int) +.ad +.RS 12n +Percent of ARC size allowed for L2ARC-only headers. +Since L2ARC buffers are not evicted on memory pressure, too large amount of +headers on system with irrationaly large L2ARC can render it slow or unusable. +This parameter limits L2ARC writes and rebuild to achieve it. +.sp +Default value: \fB33\fR%. +.RE + +.sp +.ne 2 +.na \fBl2arc_trim_ahead\fR (ulong) .ad .RS 12n @@ -426,7 +440,7 @@ Default value: \fB16,777,216\fR (16MB) .RS 12n If we are not searching forward (due to metaslab_df_max_search, metaslab_df_free_pct, or metaslab_df_alloc_threshold), this tunable controls -what segment is used. If it is set, we will use the largest free segment. +what segment is used. If it is set, we will use the largest free segment. If it is not set, we will use a segment of exactly the requested size (or larger). .sp @@ -3256,7 +3270,7 @@ Default value: \fB25\fR. \fBzfs_sync_pass_dont_compress\fR (int) .ad .RS 12n -Starting in this sync pass, we disable compression (including of metadata). +Starting in this sync pass, we disable compression (including of metadata). With the default setting, in practice, we don't have this many sync passes, so this has no effect. .sp Modified: head/sys/contrib/openzfs/man/man5/zpool-features.5 ============================================================================== --- head/sys/contrib/openzfs/man/man5/zpool-features.5 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man5/zpool-features.5 Fri Aug 28 18:53:45 2020 (r364930) @@ -16,7 +16,7 @@ .\" Portions Copyright [yyyy] [name of copyright owner] .\" Copyright (c) 2019, Klara Inc. .\" Copyright (c) 2019, Allan Jude -.TH ZPOOL-FEATURES 5 "Jun 8, 2018" +.TH ZPOOL-FEATURES 5 "Aug 24, 2020" OpenZFS .SH NAME zpool\-features \- ZFS pool feature descriptions .SH DESCRIPTION Modified: head/sys/contrib/openzfs/man/man8/fsck.zfs.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/fsck.zfs.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/fsck.zfs.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" .\" Copyright 2013 Darik Horn . All rights reserved. .\" -.TH fsck.zfs 8 "2013 MAR 16" "ZFS on Linux" "System Administration Commands" +.TH FSCK.ZFS 8 "Aug 24, 2020" OpenZFS .SH NAME fsck.zfs \- Dummy ZFS filesystem checker. Modified: head/sys/contrib/openzfs/man/man8/mount.zfs.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/mount.zfs.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/mount.zfs.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" .\" Copyright 2013 Darik Horn . All rights reserved. .\" -.TH mount.zfs 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands" +.TH MOUNT.ZFS 8 "Aug 24, 2020" OpenZFS .SH NAME mount.zfs \- mount a ZFS filesystem Modified: head/sys/contrib/openzfs/man/man8/vdev_id.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/vdev_id.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/vdev_id.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -1,4 +1,4 @@ -.TH vdev_id 8 +.TH VDEV_ID 8 "Aug 24, 2020" OpenZFS .SH NAME vdev_id \- generate user-friendly names for JBOD disks .SH SYNOPSIS Modified: head/sys/contrib/openzfs/man/man8/zed.8.in ============================================================================== --- head/sys/contrib/openzfs/man/man8/zed.8.in Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zed.8.in Fri Aug 28 18:53:45 2020 (r364930) @@ -11,7 +11,7 @@ .\" "OPENSOLARIS.LICENSE" or at . .\" You may not use this file except in compliance with the license. .\" -.TH ZED 8 "Octember 1, 2013" "ZFS on Linux" "System Administration Commands" +.TH ZED 8 "Aug 24, 2020" OpenZFS .SH NAME ZED \- ZFS Event Daemon Modified: head/sys/contrib/openzfs/man/man8/zfs-mount-generator.8.in ============================================================================== --- head/sys/contrib/openzfs/man/man8/zfs-mount-generator.8.in Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zfs-mount-generator.8.in Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION .\" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -.TH "ZFS\-MOUNT\-GENERATOR" "8" "2020-01-19" "ZFS" "zfs-mount-generator" "\"" +.TH ZFS-MOUNT-GENERATOR 8 "Aug 24, 2020" OpenZFS .SH "NAME" zfs\-mount\-generator \- generates systemd mount units for ZFS Modified: head/sys/contrib/openzfs/man/man8/zfs.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zfs.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zfs.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -736,6 +736,42 @@ to mount zfs datasets. This option is provided for bac .Xr mount 8 , .Xr net 8 , .Xr selinux 8 , +.Xr zfs-allow 8 , +.Xr zfs-bookmark 8 , +.Xr zfs-change-key 8 , +.Xr zfs-clone 8 , +.Xr zfs-create 8 , +.Xr zfs-destroy 8 , +.Xr zfs-diff 8 , +.Xr zfs-get 8 , +.Xr zfs-groupspace 8 , +.Xr zfs-hold 8 , +.Xr zfs-inherit 8 , +.Xr zfs-jail 8 , +.Xr zfs-list 8 , +.Xr zfs-load-key 8 , +.Xr zfs-mount 8 , +.Xr zfs-program 8 , +.Xr zfs-project 8 , +.Xr zfs-projectspace 8 , +.Xr zfs-promote 8 , +.Xr zfs-receive 8 , +.Xr zfs-redact 8 , +.Xr zfs-release 8 , +.Xr zfs-rename 8 , +.Xr zfs-rollback 8 , +.Xr zfs-send 8 , +.Xr zfs-set 8 , +.Xr zfs-share 8 , +.Xr zfs-snapshot 8 , +.Xr zfs-unallow 8 , +.Xr zfs-unjail 8 , +.Xr zfs-unload-key 8 , +.Xr zfs-unmount 8 , +.Xr zfs-unshare 8 , +.Xr zfs-upgrade 8 , +.Xr zfs-userspace 8 , +.Xr zfs-wait 8 , .Xr zfsconcepts 8 , .Xr zfsprops 8 , .Xr zpool 8 Modified: head/sys/contrib/openzfs/man/man8/zinject.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zinject.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zinject.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -22,7 +22,7 @@ .\" .\" Copyright 2013 Darik Horn . All rights reserved. .\" -.TH zinject 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands" +.TH ZINJECT 8 "Aug 24, 2020" OpenZFS .SH NAME zinject \- ZFS Fault Injector Modified: head/sys/contrib/openzfs/man/man8/zpool-iostat.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zpool-iostat.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zpool-iostat.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -65,9 +65,9 @@ When given an .Ar interval , the statistics are printed every .Ar interval -seconds until ^C is pressed. If +seconds until ^C is pressed. If .Fl n -flag is specified the headers are displayed only once, otherwise they are +flag is specified the headers are displayed only once, otherwise they are displayed periodically. If count is specified, the command exits after count reports are printed. The first report printed is always the statistics since boot regardless of whether Modified: head/sys/contrib/openzfs/man/man8/zpool.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zpool.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zpool.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -559,10 +559,41 @@ is not set, it is assumed that the user is allowed to .Sh INTERFACE STABILITY .Sy Evolving .Sh SEE ALSO -.Xr zpoolconcepts 8 , -.Xr zpoolprops 8 , .Xr zfs-events 5 , .Xr zfs-module-parameters 5 , .Xr zpool-features 5 , .Xr zed 8 , -.Xr zfs 8 +.Xr zfs 8 , +.Xr zpool-add 8 , +.Xr zpool-attach 8 , +.Xr zpool-checkpoint 8 , +.Xr zpool-clear 8 , +.Xr zpool-create 8 , +.Xr zpool-destroy 8 , +.Xr zpool-detach 8 , +.Xr zpool-events 8 , +.Xr zpool-export 8 , +.Xr zpool-get 8 , +.Xr zpool-history 8 , +.Xr zpool-import 8 , +.Xr zpool-initialize 8 , +.Xr zpool-iostat 8 , +.Xr zpool-labelclear 8 , +.Xr zpool-list 8 , +.Xr zpool-offline 8 , +.Xr zpool-online 8 , +.Xr zpool-reguid 8 , +.Xr zpool-remove 8 , +.Xr zpool-reopen 8 , +.Xr zpool-replace 8 , +.Xr zpool-resilver 8 , +.Xr zpool-scrub 8 , +.Xr zpool-set 8 , +.Xr zpool-split 8 , +.Xr zpool-status 8 , +.Xr zpool-sync 8 , +.Xr zpool-trim 8 , +.Xr zpool-upgrade 8 , +.Xr zpool-wait 8 , +.Xr zpoolconcepts 8 , +.Xr zpoolprops 8 Modified: head/sys/contrib/openzfs/man/man8/zstreamdump.8 ============================================================================== --- head/sys/contrib/openzfs/man/man8/zstreamdump.8 Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/man/man8/zstreamdump.8 Fri Aug 28 18:53:45 2020 (r364930) @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH zstreamdump 8 "29 Aug 2012" "ZFS pool 28, filesystem 5" "System Administration Commands" +.TH ZSTREAMDUMP 8 "Aug 24, 2020" OpenZFS .SH NAME zstreamdump \- filter data in zfs send stream .SH SYNOPSIS Modified: head/sys/contrib/openzfs/module/Makefile.bsd ============================================================================== --- head/sys/contrib/openzfs/module/Makefile.bsd Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/Makefile.bsd Fri Aug 28 18:53:45 2020 (r364930) @@ -356,4 +356,4 @@ CFLAGS.zil.c= -Wno-cast-qual CFLAGS.zio.c= -Wno-cast-qual CFLAGS.zrlock.c= -Wno-cast-qual CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith -CFLAGS.zstd.c= -fno-tree-vectorize +CFLAGS.zstd.c= -fno-tree-vectorize -U__BMI__ Modified: head/sys/contrib/openzfs/module/lua/setjmp/setjmp_ppc.S ============================================================================== --- head/sys/contrib/openzfs/module/lua/setjmp/setjmp_ppc.S Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/lua/setjmp/setjmp_ppc.S Fri Aug 28 18:53:45 2020 (r364930) @@ -56,7 +56,7 @@ #define ENTRY(name) \ .align 2 ; \ .type name,@function; \ - .globl name; \ + .weak name; \ name: #else /* PPC64_ELF_ABI_v1 */ @@ -65,8 +65,8 @@ name: #define GLUE(a,b) XGLUE(a,b) #define ENTRY(name) \ .align 2 ; \ - .globl name; \ - .globl GLUE(.,name); \ + .weak name; \ + .weak GLUE(.,name); \ .pushsection ".opd","aw"; \ name: \ .quad GLUE(.,name); \ @@ -83,8 +83,8 @@ GLUE(.,name): #define ENTRY(name) \ .text; \ .p2align 4; \ - .globl name; \ - .type name,@function; \ + .weak name; \ + .type name,@function; \ name: #endif /* __powerpc64__ */ Modified: head/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c ============================================================================== --- head/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c Fri Aug 28 18:53:45 2020 (r364930) @@ -31,6 +31,7 @@ * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright (c) 2018 George Melikov. All Rights Reserved. * Copyright (c) 2019 Datto, Inc. All rights reserved. + * Copyright (c) 2020 The MathWorks, Inc. All rights reserved. */ /* @@ -978,6 +979,22 @@ out: } /* + * Flush everything out of the kernel's export table and such. + * This is needed as once the snapshot is used over NFS, its + * entries in svc_export and svc_expkey caches hold reference + * to the snapshot mount point. There is no known way of flushing + * only the entries related to the snapshot. + */ +static void +exportfs_flush(void) +{ + char *argv[] = { "/usr/sbin/exportfs", "-f", NULL }; + char *envp[] = { NULL }; + + (void) call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC); +} + +/* * Attempt to unmount a snapshot by making a call to user space. * There is no assurance that this can or will succeed, is just a * best effort. In the case where it does fail, perhaps because @@ -998,6 +1015,8 @@ zfsctl_snapshot_unmount(char *snapname, int flags) return (SET_ERROR(ENOENT)); } rw_exit(&zfs_snapshot_lock); + + exportfs_flush(); if (flags & MNT_FORCE) argv[4] = "-fn"; Modified: head/sys/contrib/openzfs/module/zcommon/zfs_fletcher.c ============================================================================== --- head/sys/contrib/openzfs/module/zcommon/zfs_fletcher.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zcommon/zfs_fletcher.c Fri Aug 28 18:53:45 2020 (r364930) @@ -187,7 +187,7 @@ static const fletcher_4_ops_t *fletcher_4_impls[] = { #if defined(__x86_64) && defined(HAVE_AVX512BW) &fletcher_4_avx512bw_ops, #endif -#if defined(__aarch64__) +#if defined(__aarch64__) && !defined(__FreeBSD__) &fletcher_4_aarch64_neon_ops, #endif }; Modified: head/sys/contrib/openzfs/module/zfs/arc.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/arc.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/arc.c Fri Aug 28 18:53:45 2020 (r364930) @@ -823,6 +823,7 @@ unsigned long l2arc_feed_min_ms = L2ARC_FEED_MIN_MS; / int l2arc_noprefetch = B_TRUE; /* don't cache prefetch bufs */ int l2arc_feed_again = B_TRUE; /* turbo warmup */ int l2arc_norw = B_FALSE; /* no reads during writes */ +int l2arc_meta_percent = 33; /* limit on headers size */ /* * L2ARC Internals @@ -4988,9 +4989,6 @@ arc_adapt(int bytes, arc_state_t *state) int64_t mrug_size = zfs_refcount_count(&arc_mru_ghost->arcs_size); int64_t mfug_size = zfs_refcount_count(&arc_mfu_ghost->arcs_size); - if (state == arc_l2c_only) - return; - ASSERT(bytes > 0); /* * Adapt the target size of the MRU list: @@ -9144,6 +9142,15 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint return (write_asize); } +static boolean_t +l2arc_hdr_limit_reached(void) +{ + int64_t s = aggsum_upper_bound(&astat_l2_hdr_size); + + return (arc_reclaim_needed() || (s > arc_meta_limit * 3 / 4) || + (s > (arc_warm ? arc_c : arc_c_max) * l2arc_meta_percent / 100)); +} + /* * This thread feeds the L2ARC at regular intervals. This is the beating * heart of the L2ARC. @@ -9211,7 +9218,7 @@ l2arc_feed_thread(void *unused) /* * Avoid contributing to memory pressure. */ - if (arc_reclaim_needed()) { + if (l2arc_hdr_limit_reached()) { ARCSTAT_BUMP(arcstat_l2_abort_lowmem); spa_config_exit(spa, SCL_L2ARC, dev); continue; @@ -9662,7 +9669,7 @@ l2arc_rebuild(l2arc_dev_t *dev) * online the L2ARC dev at a later time (or re-import the pool) * to reconstruct it (when there's less memory pressure). */ - if (arc_reclaim_needed()) { + if (l2arc_hdr_limit_reached()) { ARCSTAT_BUMP(arcstat_l2_rebuild_abort_lowmem); cmn_err(CE_NOTE, "System running low on memory, " "aborting L2ARC rebuild."); @@ -10002,6 +10009,13 @@ l2arc_log_blk_restore(l2arc_dev_t *dev, const l2arc_lo uint64_t size = 0, asize = 0; uint64_t log_entries = dev->l2ad_log_entries; + /* + * Usually arc_adapt() is called only for data, not headers, but + * since we may allocate significant amount of memory here, let ARC + * grow its arc_c. + */ + arc_adapt(log_entries * HDR_L2ONLY_SIZE, arc_l2c_only); + for (int i = log_entries - 1; i >= 0; i--) { /* * Restore goes in the reverse temporal direction to preserve @@ -10537,6 +10551,9 @@ ZFS_MODULE_PARAM(zfs_l2arc, l2arc_, feed_again, INT, Z ZFS_MODULE_PARAM(zfs_l2arc, l2arc_, norw, INT, ZMOD_RW, "No reads during writes"); + +ZFS_MODULE_PARAM(zfs_l2arc, l2arc_, meta_percent, INT, ZMOD_RW, + "Percent of ARC size allowed for L2ARC-only headers"); ZFS_MODULE_PARAM(zfs_l2arc, l2arc_, rebuild_enabled, INT, ZMOD_RW, "Rebuild the L2ARC when importing a pool"); Modified: head/sys/contrib/openzfs/module/zfs/dmu.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/dmu.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/dmu.c Fri Aug 28 18:53:45 2020 (r364930) @@ -2458,6 +2458,7 @@ EXPORT_SYMBOL(dmu_object_set_blocksize); EXPORT_SYMBOL(dmu_object_set_maxblkid); EXPORT_SYMBOL(dmu_object_set_checksum); EXPORT_SYMBOL(dmu_object_set_compress); +EXPORT_SYMBOL(dmu_offset_next); EXPORT_SYMBOL(dmu_write_policy); EXPORT_SYMBOL(dmu_sync); EXPORT_SYMBOL(dmu_request_arcbuf); Modified: head/sys/contrib/openzfs/module/zfs/dnode_sync.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/dnode_sync.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/dnode_sync.c Fri Aug 28 18:53:45 2020 (r364930) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright 2020 Oxide Computer Company */ #include @@ -762,13 +763,22 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dsfra.dsfra_dnode = dn; dsfra.dsfra_tx = tx; dsfra.dsfra_free_indirects = freeing_dnode; + mutex_enter(&dn->dn_mtx); if (freeing_dnode) { ASSERT(range_tree_contains(dn->dn_free_ranges[txgoff], 0, dn->dn_maxblkid + 1)); } - mutex_enter(&dn->dn_mtx); - range_tree_vacate(dn->dn_free_ranges[txgoff], + /* + * Because dnode_sync_free_range() must drop dn_mtx during its + * processing, using it as a callback to range_tree_vacate() is + * not safe. No other operations (besides destroy) are allowed + * once range_tree_vacate() has begun, and dropping dn_mtx + * would leave a window open for another thread to observe that + * invalid (and unsafe) state. + */ + range_tree_walk(dn->dn_free_ranges[txgoff], dnode_sync_free_range, &dsfra); + range_tree_vacate(dn->dn_free_ranges[txgoff], NULL, NULL); range_tree_destroy(dn->dn_free_ranges[txgoff]); dn->dn_free_ranges[txgoff] = NULL; mutex_exit(&dn->dn_mtx); Modified: head/sys/contrib/openzfs/module/zfs/dsl_dir.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/dsl_dir.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/dsl_dir.c Fri Aug 28 18:53:45 2020 (r364930) @@ -121,13 +121,6 @@ * and updated by dsl_fs_ss_count_adjust(). A new limit value is setup in * dsl_dir_activate_fs_ss_limit() and the counts are adjusted, if necessary, by * dsl_dir_init_fs_ss_count(). - * - * There is a special case when we receive a filesystem that already exists. In - * this case a temporary clone name of %X is created (see dmu_recv_begin). We - * never update the filesystem counts for temporary clones. - * - * Likewise, we do not update the snapshot counts for temporary snapshots, - * such as those created by zfs diff. */ extern inline dsl_dir_phys_t *dsl_dir_phys(dsl_dir_t *dd); @@ -593,11 +586,9 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx) &chld_dd)); /* - * Ignore hidden ($FREE, $MOS & $ORIGIN) objsets and - * temporary datasets. + * Ignore hidden ($FREE, $MOS & $ORIGIN) objsets. */ - if (chld_dd->dd_myname[0] == '$' || - chld_dd->dd_myname[0] == '%') { + if (chld_dd->dd_myname[0] == '$') { dsl_dir_rele(chld_dd, FTAG); continue; } @@ -910,14 +901,12 @@ dsl_fs_ss_count_adjust(dsl_dir_t *dd, int64_t delta, c strcmp(prop, DD_FIELD_SNAPSHOT_COUNT) == 0); /* - * When we receive an incremental stream into a filesystem that already - * exists, a temporary clone is created. We don't count this temporary - * clone, whose name begins with a '%'. We also ignore hidden ($FREE, - * $MOS & $ORIGIN) objsets. + * We don't do accounting for hidden ($FREE, $MOS & $ORIGIN) objsets. */ - if ((dd->dd_myname[0] == '%' || dd->dd_myname[0] == '$') && - strcmp(prop, DD_FIELD_FILESYSTEM_COUNT) == 0) + if (dd->dd_myname[0] == '$' && strcmp(prop, + DD_FIELD_FILESYSTEM_COUNT) == 0) { return; + } /* * e.g. if renaming a dataset with no snapshots, count adjustment is 0 Modified: head/sys/contrib/openzfs/module/zfs/sa.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/sa.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/sa.c Fri Aug 28 18:53:45 2020 (r364930) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include Modified: head/sys/contrib/openzfs/module/zfs/spa.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/spa.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/spa.c Fri Aug 28 18:53:45 2020 (r364930) @@ -3201,7 +3201,8 @@ spa_verify_host(spa_t *spa, nvlist_t *mos_config) cmn_err(CE_WARN, "pool '%s' could not be " "loaded as it was last accessed by " "another system (host: %s hostid: 0x%llx). " - "See: http://illumos.org/msg/ZFS-8000-EY", + "See: https://openzfs.github.io/openzfs-docs/msg/" + "ZFS-8000-EY", spa_name(spa), hostname, (u_longlong_t)hostid); spa_load_failed(spa, "hostid verification failed: pool " "last accessed by host: %s (hostid: 0x%llx)", Modified: head/sys/contrib/openzfs/module/zfs/vdev_raidz_math.c ============================================================================== --- head/sys/contrib/openzfs/module/zfs/vdev_raidz_math.c Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zfs/vdev_raidz_math.c Fri Aug 28 18:53:45 2020 (r364930) @@ -61,7 +61,7 @@ const raidz_impl_ops_t *raidz_all_maths[] = { #if defined(__x86_64) && defined(HAVE_AVX512BW) /* only x86_64 for now */ &vdev_raidz_avx512bw_impl, #endif -#if defined(__aarch64__) +#if defined(__aarch64__) && !defined(__FreeBSD__) &vdev_raidz_aarch64_neon_impl, &vdev_raidz_aarch64_neonx2_impl, #endif Modified: head/sys/contrib/openzfs/module/zstd/Makefile.in ============================================================================== --- head/sys/contrib/openzfs/module/zstd/Makefile.in Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/module/zstd/Makefile.in Fri Aug 28 18:53:45 2020 (r364930) @@ -20,6 +20,9 @@ ccflags-y += -O3 # Set it for other compilers, too. $(obj)/lib/zstd.o: c_flags += -fno-tree-vectorize +# SSE register return with SSE disabled if -march=znverX is passed +$(obj)/lib/zstd.o: c_flags += -U__BMI__ + # Quiet warnings about frame size due to unused code in unmodified zstd lib $(obj)/lib/zstd.o: c_flags += -Wframe-larger-than=20480 Modified: head/sys/contrib/openzfs/tests/runfiles/common.run ============================================================================== --- head/sys/contrib/openzfs/tests/runfiles/common.run Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/tests/runfiles/common.run Fri Aug 28 18:53:45 2020 (r364930) @@ -216,7 +216,7 @@ tests = ['zfs_receive_001_pos', 'zfs_receive_002_pos', 'zfs_receive_016_pos', 'receive-o-x_props_override', 'zfs_receive_from_encrypted', 'zfs_receive_to_encrypted', 'zfs_receive_raw', 'zfs_receive_raw_incremental', 'zfs_receive_-e', - 'zfs_receive_raw_-d', 'zfs_receive_from_zstd'] + 'zfs_receive_raw_-d', 'zfs_receive_from_zstd', 'zfs_receive_new_props'] tags = ['functional', 'cli_root', 'zfs_receive'] [tests/functional/cli_root/zfs_rename] Modified: head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am Fri Aug 28 18:45:14 2020 (r364929) +++ head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/Makefile.am Fri Aug 28 18:53:45 2020 (r364930) @@ -21,6 +21,7 @@ dist_pkgdata_SCRIPTS = \ receive-o-x_props_override.ksh \ zfs_receive_from_encrypted.ksh \ zfs_receive_from_zstd.ksh \ + zfs_receive_new_props.ksh \ zfs_receive_to_encrypted.ksh \ zfs_receive_raw.ksh \ zfs_receive_raw_incremental.ksh \ Copied: head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh (from r364929, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh Fri Aug 28 18:53:45 2020 (r364930, copy of r364929, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh) @@ -0,0 +1,77 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2020 by Delphix. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib + +# +# DESCRIPTION: +# ZFS receive test to handle Issue #10698 +# +# STRATEGY: +# 1. Create a pool with filesystem_limits disabled +# 2. Create a filesystem on that pool +# 3. Enable filesystem limits on that pool +# 4. On a pool with filesystem limits enabled, create a filesystem and set a +# limit +# 5. Snapshot limited filesystem +# 6. send -R limited filesystem and receive over filesystem with limits disabled +# + +verify_runnable "both" + +function cleanup +{ + destroy_pool "$poolname" + destroy_pool "$rpoolname" + log_must rm -f "$vdevfile" + log_must rm -f "$rvdevfile" + log_must rm -f "$streamfile" +} + +log_onexit cleanup + +log_assert "ZFS should handle receiving streams with filesystem limits on \ + pools where the feature was recently enabled" + +poolname=sendpool +rpoolname=recvpool +vdevfile="$TEST_BASE_DIR/vdevfile.$$" +rvdevfile="$TEST_BASE_DIR/rvdevfile.$$" +sendfs="$poolname/fs" +recvfs="$rpoolname/rfs" +streamfile="$TEST_BASE_DIR/streamfile.$$" + +log_must truncate -s $MINVDEVSIZE "$rvdevfile" +log_must truncate -s $MINVDEVSIZE "$vdevfile" +log_must zpool create -O mountpoint=none -o feature@filesystem_limits=disabled \ + "$rpoolname" "$rvdevfile" +log_must zpool create -O mountpoint=none "$poolname" "$vdevfile" + +log_must zfs create "$recvfs" +log_must zpool set feature@filesystem_limits=enabled "$rpoolname" + +log_must zfs create -o filesystem_limit=100 "$sendfs" +log_must zfs snapshot "$sendfs@a" + +log_must zfs send -R "$sendfs@a" >"$streamfile" +log_must eval "zfs recv -svuF $recvfs <$streamfile" + +log_pass "ZFS can handle receiving streams with filesystem limits on \ + pools where the feature was recently enabled" From owner-svn-src-head@freebsd.org Fri Aug 28 19:02:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6FFB3BC914; Fri, 28 Aug 2020 19:02:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdTVP5PN8z49rs; Fri, 28 Aug 2020 19:02:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DE3319A3F; Fri, 28 Aug 2020 19:02:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SJ25rW054315; Fri, 28 Aug 2020 19:02:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SJ25VK054314; Fri, 28 Aug 2020 19:02:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202008281902.07SJ25VK054314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 28 Aug 2020 19:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364931 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 364931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 19:02:05 -0000 Author: mmacy Date: Fri Aug 28 19:02:05 2020 New Revision: 364931 URL: https://svnweb.freebsd.org/changeset/base/364931 Log: ZFS: add to arm64 NOTES to minimize potential for missing symbols Modified: head/sys/arm64/conf/NOTES Modified: head/sys/arm64/conf/NOTES ============================================================================== --- head/sys/arm64/conf/NOTES Fri Aug 28 18:53:45 2020 (r364930) +++ head/sys/arm64/conf/NOTES Fri Aug 28 19:02:05 2020 (r364931) @@ -231,3 +231,8 @@ nooptions COMPAT_FREEBSD10 # arm64 supports 32-bit FreeBSD/arm binaries (armv[67] ABIs) options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm + +##################################################################### +# ZFS support + +options ZFS From owner-svn-src-head@freebsd.org Fri Aug 28 19:21:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B01A3BD484; Fri, 28 Aug 2020 19:21:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdTwR73bYz4DQ7; Fri, 28 Aug 2020 19:21: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 D6C8E19AC4; Fri, 28 Aug 2020 19:21: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 07SJLBfv066270; Fri, 28 Aug 2020 19:21:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SJLBE2066269; Fri, 28 Aug 2020 19:21:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008281921.07SJLBE2066269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Aug 2020 19:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364932 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 364932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 19:21:12 -0000 Author: hselasky Date: Fri Aug 28 19:21:11 2020 New Revision: 364932 URL: https://svnweb.freebsd.org/changeset/base/364932 Log: Allow slow USB devices to be given more time to return their USB descriptors, like Logitech HD Pro Webcam C920. PR: 248926 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri Aug 28 19:02:05 2020 (r364931) +++ head/sys/dev/usb/usb_request.c Fri Aug 28 19:21:11 2020 (r364932) @@ -721,7 +721,8 @@ done: case USB_ERR_CANCELLED: break; default: - DPRINTF("I/O error - waiting a bit for TT cleanup\n"); + DPRINTF("error=%s - waiting a bit for TT cleanup\n", + usbd_errstr(err)); usb_pause_mtx(mtx, hz / 16); break; } @@ -1010,7 +1011,7 @@ usbd_req_get_desc(struct usb_device *udev, USETW(req.wLength, min_len); err = usbd_do_request_flags(udev, mtx, &req, - desc, 0, NULL, 500 /* ms */); + desc, 0, NULL, 1000 /* ms */); if (err != 0 && err != USB_ERR_TIMEOUT && min_len != max_len) { @@ -1021,7 +1022,7 @@ usbd_req_get_desc(struct usb_device *udev, USETW(req.wLength, max_len); err = usbd_do_request_flags(udev, mtx, &req, - desc, USB_SHORT_XFER_OK, NULL, 500 /* ms */); + desc, USB_SHORT_XFER_OK, NULL, 1000 /* ms */); if (err == 0) { /* verify length */ From owner-svn-src-head@freebsd.org Fri Aug 28 19:50:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0AAB3BE89E; Fri, 28 Aug 2020 19:50:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdVZS5gK2z4GwG; Fri, 28 Aug 2020 19:50:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A63841A283; Fri, 28 Aug 2020 19:50:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SJoe49081487; Fri, 28 Aug 2020 19:50:40 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SJoepc081486; Fri, 28 Aug 2020 19:50:40 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008281950.07SJoepc081486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 28 Aug 2020 19:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364933 - in head: lib/libmemstat sys/vm X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: lib/libmemstat sys/vm X-SVN-Commit-Revision: 364933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 19:50:40 -0000 Author: vangyzen Date: Fri Aug 28 19:50:40 2020 New Revision: 364933 URL: https://svnweb.freebsd.org/changeset/base/364933 Log: memstat_kvm_uma: fix reading of uma_zone_domain structures Coverity flagged the scaling by sizeof(uzd). That is the type of the pointer, so the scaling was already done by pointer arithmetic. However, this was also passing a stack frame pointer to kvm_read, so it was doubly wrong. Move ZDOM_GET into the !_KERNEL section and use it in libmemstat. Reported by: Coverity Reviewed by: markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26213 Modified: head/lib/libmemstat/memstat_uma.c head/sys/vm/uma_int.h Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Fri Aug 28 19:21:11 2020 (r364932) +++ head/lib/libmemstat/memstat_uma.c Fri Aug 28 19:50:40 2020 (r364933) @@ -455,9 +455,8 @@ skip_percpu: mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size; mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; for (i = 0; i < ndomains; i++) { - ret = kread(kvm, - &uz.uz_cpu[mp_maxid + 1] + i * sizeof(uzd), - &uzd, sizeof(uzd), 0); + ret = kread(kvm, ZDOM_GET(uzp, i), &uzd, + sizeof(uzd), 0); if (ret != 0) continue; for (ubp = Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Fri Aug 28 19:21:11 2020 (r364932) +++ head/sys/vm/uma_int.h Fri Aug 28 19:50:40 2020 (r364933) @@ -526,6 +526,10 @@ struct uma_zone { KASSERT(uma_zone_get_allocs((z)) == 0, \ ("zone %s initialization after use.", (z)->uz_name)) +/* Domains are contiguous after the last CPU */ +#define ZDOM_GET(z, n) \ + (&((uma_zone_domain_t)&(z)->uz_cpu[mp_maxid + 1])[n]) + #undef UMA_ALIGN #ifdef _KERNEL @@ -560,10 +564,6 @@ static __inline uma_slab_t hash_sfind(struct uma_hash #define KEG_ASSERT_COLD(k) \ KASSERT(uma_keg_get_allocs((k)) == 0, \ ("keg %s initialization after use.", (k)->uk_name)) - -/* Domains are contiguous after the last CPU */ -#define ZDOM_GET(z, n) \ - (&((uma_zone_domain_t)&(z)->uz_cpu[mp_maxid + 1])[n]) #define ZDOM_LOCK_INIT(z, zdom, lc) \ do { \ From owner-svn-src-head@freebsd.org Fri Aug 28 19:59:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F4A13BECC7; Fri, 28 Aug 2020 19:59:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdVm72PtTz4J0D; Fri, 28 Aug 2020 19:59:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367711A40C; Fri, 28 Aug 2020 19:59:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SJx2VW087622; Fri, 28 Aug 2020 19:59:02 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SJx2bV087621; Fri, 28 Aug 2020 19:59:02 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008281959.07SJx2bV087621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 28 Aug 2020 19:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364935 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 364935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 19:59:03 -0000 Author: vangyzen Date: Fri Aug 28 19:59:02 2020 New Revision: 364935 URL: https://svnweb.freebsd.org/changeset/base/364935 Log: vm_pageout_scan_active: ensure ps_delta is initialized Reported by: Coverity Reviewed by: markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26212 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Aug 28 19:52:16 2020 (r364934) +++ head/sys/vm/vm_pageout.c Fri Aug 28 19:59:02 2020 (r364935) @@ -1287,8 +1287,10 @@ act_scan: * so, discarding any references collected by * pmap_ts_referenced(). */ - if (__predict_false(_vm_page_queue(old) == PQ_NONE)) + if (__predict_false(_vm_page_queue(old) == PQ_NONE)) { + ps_delta = 0; break; + } /* * Advance or decay the act_count based on recent usage. From owner-svn-src-head@freebsd.org Fri Aug 28 20:03:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D8AC3BF2D4; Fri, 28 Aug 2020 20:03:56 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdVsm2CP9z4JRl; Fri, 28 Aug 2020 20:03:56 +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 302431A3E0; Fri, 28 Aug 2020 20:03:56 +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 07SK3uja093530; Fri, 28 Aug 2020 20:03:56 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SK3tuD093523; Fri, 28 Aug 2020 20:03:55 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202008282003.07SK3tuD093523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 28 Aug 2020 20:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364936 - in head: lib lib/libnetmap share/mk X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: lib lib/libnetmap share/mk X-SVN-Commit-Revision: 364936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 20:03:56 -0000 Author: vmaffione Date: Fri Aug 28 20:03:54 2020 New Revision: 364936 URL: https://svnweb.freebsd.org/changeset/base/364936 Log: lib: add libnetmap This changeset introduces the new libnetmap library for writing netmap applications. Before libnetmap, applications could either use the kernel API directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.) The new library offers more functionalities than netmap_user.h: - Support for complex netmap options, such as external memory allocators or per-buffer offsets. This opens the way to future extensions. - More flexibility in the netmap port bind options, such as non-numeric names for pipes, or the ability to specify the netmap allocator that must be used for a given port. - Automatic tracking of the netmap memory regions in use across the open ports. At the moment there is no man page, but the libnetmap.h header file has in-depth documentation. Reviewed by: hrs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26171 Added: head/lib/libnetmap/ head/lib/libnetmap/Makefile (contents, props changed) head/lib/libnetmap/libnetmap.h (contents, props changed) head/lib/libnetmap/nmctx-pthreads.c (contents, props changed) head/lib/libnetmap/nmctx.c (contents, props changed) head/lib/libnetmap/nmport.c (contents, props changed) head/lib/libnetmap/nmreq.c (contents, props changed) Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Aug 28 19:59:02 2020 (r364935) +++ head/lib/Makefile Fri Aug 28 20:03:54 2020 (r364936) @@ -71,6 +71,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libmt \ lib80211 \ libnetbsd \ + libnetmap \ libnv \ libopenbsd \ libopie \ Added: head/lib/libnetmap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetmap/Makefile Fri Aug 28 20:03:54 2020 (r364936) @@ -0,0 +1,16 @@ +# +# $FreeBSD$ +# + +.include + +PACKAGE= lib${LIB} +LIB= netmap +SRCS= nmctx.c nmport.c \ + nmctx-pthreads.c nmreq.c +INCS= libnetmap.h +#MAN= libnetmap.3 +CFLAGS+= -I${SRCTOP}/sys/net -I${.CURDIR} +WARNS?= 2 + +.include Added: head/lib/libnetmap/libnetmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetmap/libnetmap.h Fri Aug 28 20:03:54 2020 (r364936) @@ -0,0 +1,660 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Universita` di Pisa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * $FreeBSD$ + */ + +#ifndef LIBNETMAP_H_ +#define LIBNETMAP_H_ +/* if thread-safety is not needed, define LIBNETMAP_NOTHREADSAFE before including + * this file. + */ + +/* NOTE: we include net/netmap_user.h without defining NETMAP_WITH_LIBS, which + * is deprecated. If you still need it, please define NETMAP_WITH_LIBS and + * include net/netmap_user.h before including this file. + */ +#include + +struct nmctx; +struct nmport_d; +struct nmem_d; + +/* + * A port open specification (portspec for brevity) has the following syntax + * (square brackets delimit optional parts): + * + * subsystem:vpname[mode][options] + * + * The "subsystem" is denoted by a prefix, possibly followed by an identifier. + * There can be several kinds of subsystems, each one selected by a unique + * prefix. Currently defined subsystems are: + * + * netmap (no id allowed) + * the standard subsystem + * + * vale (followed by a possibly empty id) + * the vpname is connected to a VALE switch identified by + * the id (an empty id selects the default switch) + * + * The "vpname" has the following syntax: + * + * identifier or + * identifier1{identifier2 or + * identifier1}identifier2 + * + * Identifiers are sequences of alphanumeric characters. The part that begins + * with either '{' or '}', when present, denotes a netmap pipe opened in the + * same memory region as the subsystem:indentifier1 port. + * + * The "mode" can be one of the following: + * + * ^ bind all host (sw) ring pairs + * ^NN bind individual host ring pair + * * bind host and NIC ring pairs + * -NN bind individual NIC ring pair + * @NN open the port in the NN memory region + * a suffix starting with / and the following flags, + * in any order: + * x exclusive access + * z zero copy monitor (both tx and rx) + * t monitor tx side (copy monitor) + * r monitor rx side (copy monitor) + * R bind only RX ring(s) + * T bind only TX ring(s) + * + * The "options" start at the first '@' character not followed by a number. + * Each option starts with '@' and has the following syntax: + * + * option (flag option) + * option=value (single key option) + * option:key1=value1,key2=value2,... (multi-key option) + * + * For multi-key options, the keys can be assigned in any order, but they + * cannot be assigned more than once. It is not necessary to assign all the + * option keys: unmentioned keys will receive default values. Some multi-key + * options define a default key and also accept the single-key syntax, by + * assigning the value to this key. + * + * NOTE: Options may be silently ignored if the port is already open by some + * other process. + * + * The currently available options are (default keys, when defined, are marked + * with '*'): + * + * share (single-key) + * open the port in the same memory region used by the + * given port name (the port name must be given in + * subsystem:vpname form) + * + * conf (multi-key) + * specify the rings/slots numbers (effective only on + * ports that are created by the open operation itself, + * and ignored otherwise). + * + * The keys are: + * + * *rings number of tx and rx rings + * tx-rings number of tx rings + * rx-rings number of rx rings + * host-rings number of tx and rx host rings + * host-tx-rings number of host tx rings + * host-rx-rings number of host rx rings + * slots number of slots in each tx and rx + * ring + * tx-slots number of slots in each tx ring + * rx-slots number of slots in each rx ring + * + * (more specific keys override the less specific ones) + * All keys default to zero if not assigned, and the + * corresponding value will be chosen by netmap. + * + * extmem (multi-key) + * open the port in the memory region obtained by + * mmap()ing the given file. + * + * The keys are: + * + * *file the file to mmap + * if-num number of pre-allocated netmap_if's + * if-size size of each netmap_if + * ring-num number of pre-allocated netmap_ring's + * ring-size size of each netmap_ring + * buf-num number of pre-allocated buffers + * buf-size size of each buffer + * + * file must be assigned. The other keys default to zero, + * causing netmap to take the corresponding values from + * the priv_{if,ring,buf}_{num,size} sysctls. + * + */ + + +/* nmport manipulation */ + +/* struct nmport_d - describes a netmap port */ +struct nmport_d { + /* see net/netmap.h for the definition of these fields */ + struct nmreq_header hdr; + struct nmreq_register reg; + + /* all the fields below should be considered read-only */ + + /* if the same context is used throughout the program, d1->mem == + * d2->mem iff d1 and d2 are using the memory region (i.e., zero + * copy is possible between the two ports) + */ + struct nmem_d *mem; + + /* the nmctx used when this nmport_d was created */ + struct nmctx *ctx; + + int register_done; /* nmport_register() has been called */ + int mmap_done; /* nmport_mmap() has been called */ + /* pointer to the extmem option contained in the hdr options, if any */ + struct nmreq_opt_extmem *extmem; + + /* the fields below are compatible with nm_open() */ + int fd; /* "/dev/netmap", -1 if not open */ + struct netmap_if *nifp; /* pointer to the netmap_if */ + uint16_t first_tx_ring; + uint16_t last_tx_ring; + uint16_t first_rx_ring; + uint16_t last_rx_ring; + uint16_t cur_tx_ring; /* used by nmport_inject */ + uint16_t cur_rx_ring; + + /* LIFO list of cleanup functions (used internally) */ + struct nmport_cleanup_d *clist; +}; + +/* nmport_open - opens a port from a portspec + * @portspec the port opening specification + * + * If successful, the function returns a new nmport_d describing a netmap + * port, opened according to the port specification, ready to be used for rx + * and/or tx. + * + * The rings available for tx are in the [first_tx_ring, last_tx_ring] + * interval, and similarly for rx. One or both intervals may be empty. + * + * When done using it, the nmport_d descriptor must be closed using + * nmport_close(). + * + * In case of error, NULL is returned, errno is set to some error, and an + * error message is sent through the error() method of the current context. + */ +struct nmport_d * nmport_open(const char *portspec); + +/* nport_close - close a netmap port + * @d the port we want to close + * + * Undoes the actions performed by the nmport_open that created d, then + * frees the descriptor. + */ +void nmport_close(struct nmport_d *d); + +/* nmport_inject - sends a packet + * @d the port through which we want to send + * @buf base address of the packet + * @size its size in bytes + * + * Sends a packet using the cur_tx_ring and updates the index + * to use all available tx rings in turn. Note: the packet is copied. + * + * Returns 0 on success an -1 on error. + */ +int nmport_inject(struct nmport_d *d, const void *buf, size_t size); + +/* + * the functions below can be used to split the functionality of + * nmport_open when special features (e.g., extra buffers) are needed + * + * The relation among the functions is as follows: + * + * |nmport_new + * |nmport_prepare = | + * | |nmport_parse + * nmport_open =| + * | |nmport_register + * |nmport_open_desc =| + * |nmport_mmap + * + */ + +/* nmport_new - create a new nmport_d + * + * Creates a new nmport_d using the malloc() method of the current default + * context. Returns NULL on error, setting errno to an error value. + */ +struct nmport_d *nmport_new(void); + +/* nmport_parse - fills the nmport_d netmap-register request + * @d the nmport to be filled + * @portspec the port opening specification + * + * This function parses the portspec and initizalizes the @d->hdr and @d->reg + * fields. It may need to allocate a list of options. If an extmem option is + * found, it may also mmap() the corresponding file. + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_parse(struct nmport_d *d, const char *portspec); + +/* nmport_register - registers the port with netmap + * @d the nmport to be registered + * + * This function obtains a netmap file descriptor and registers the port with + * netmap. The @d->hdr and @d->reg data structures must have been previously + * initialized (via nmport_parse() or otherwise). + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_register(struct nmport_d *); + +/* nmport_mmap - maps the port resources into the process memory + * @d the nmport to be mapped + * + * The port must have been previously been registered using nmport_register. + * + * Note that if extmem is used (either via an option or by calling an + * nmport_extmem_* function before nmport_register()), no new mmap() is issued. + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_mmap(struct nmport_d *); + +/* the following functions undo the actions of nmport_new(), nmport_parse(), + * nmport_register() and nmport_mmap(), respectively. + */ +void nmport_delete(struct nmport_d *); +void nmport_undo_parse(struct nmport_d *); +void nmport_undo_register(struct nmport_d *); +void nmport_undo_mmap(struct nmport_d *); + +/* nmport_prepare - create a port descriptor, but do not open it + * @portspec the port opening specification + * + * This functions creates a new nmport_d and initializes it according to + * @portspec. It is equivalent to nmport_new() followed by nmport_parse(). + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +struct nmport_d *nmport_prepare(const char *portspec); + +/* nmport_open_desc - open an initialized port descriptor + * @d the descriptor we want to open + * + * Registers the port with netmap and maps the rings and buffers into the + * process memory. It is equivalent to nmport_register() followed by + * nmport_mmap(). + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_open_desc(struct nmport_d *d); + +/* the following functions undo the actions of nmport_prepare() + * and nmport_open_desc(), respectively. + */ +void nmport_undo_prepare(struct nmport_d *); +void nmport_undo_open_desc(struct nmport_d *); + +/* nmport_clone - copy an nmport_d + * @d the nmport_d we want to copy + * + * Copying an nmport_d by hand should be avoided, since adjustments are needed + * and some part of the state cannot be easily duplicated. This function + * creates a copy of @d in a safe way. The returned nmport_d contains + * nmreq_header and nmreq_register structures equivalent to those contained in + * @d, except for the option list, which is ignored. The returned nmport_d is + * already nmport_prepare()d, but it must still be nmport_open_desc()ed. The + * new nmport_d uses the same nmctx as @d. + * + * If extmem was used for @d, then @d cannot be nmport_clone()d until it has + * been nmport_register()ed. + * + * In case of error, the function returns NULL, sets errno to an error value + * and sends an error message to the nmctx error() method. + */ +struct nmport_d *nmport_clone(struct nmport_d *); + +/* nmport_extmem - use extmem for this port + * @d the port we want to use the extmem for + * @base the base address of the extmem region + * @size the size in bytes of the extmem region + * + * the memory that contains the netmap ifs, rings and buffers is usually + * allocated by netmap and later mmap()ed by the applications. It is sometimes + * useful to reverse this process, by having the applications allocate some + * memory (through mmap() or otherwise) and then let netmap use it. The extmem + * option can be used to implement this latter strategy. The option can be + * passed through the portspec using the '@extmem:...' syntax, or + * programmatically by calling nmport_extmem() or nmport_extmem_from_file() + * between nmport_parse() and nmport_register() (or between nmport_prepare() + * and nmport_open_desc()). + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_extmem(struct nmport_d *d, void *base, size_t size); + +/* nmport_extmem_from_file - use the extmem obtained by mapping a file + * @d the port we want to use the extmem for + * @fname path of the file we want to map + * + * This works like nmport_extmem, but the extmem memory is obtained by + * mmap()ping @fname. nmport_close() will also automatically munmap() the file. + * + * It returns 0 on success. On failure it returns -1, sets errno to an error + * value and sends an error message to the error() method of the context used + * when @d was created. Moreover, *@d is left unchanged. + */ +int nmport_extmem_from_file(struct nmport_d *d, const char *fname); + +/* nmport_extmem_getinfo - opbtai a pointer to the extmem configuration + * @d the port we want to obtain the pointer from + * + * Returns a pointer to the nmreq_pools_info structure containing the + * configuration of the extmem attached to port @d, or NULL if no extmem + * is attached. This can be used to set the desired configuration before + * registering the port, or to read the actual configuration after + * registration. + */ +struct nmreq_pools_info* nmport_extmem_getinfo(struct nmport_d *d); + + +/* enable/disable options + * + * These functions can be used to disable options that the application cannot + * or doesn't want to handle, or to enable options that require special support + * from the application and are, therefore, disabled by default. Disabled + * options will cause an error if encountered during option parsing. + * + * If the option is unknown, nmport_disable_option is a NOP, while + * nmport_enable_option returns -1 and sets errno to EOPNOTSUPP. + * + * These functions are not threadsafe and are meant to be used at the beginning + * of the program. + */ +void nmport_disable_option(const char *opt); +int nmport_enable_option(const char *opt); + +/* nmreq manipulation + * + * nmreq_header_init - initialize an nmreq_header + * @hdr the nmreq_header to initialize + * @reqtype the kind of netmap request + * @body the body of the request + * + * Initialize the nr_version, nr_reqtype and nr_body fields of *@hdr. + * The other fields are set to zero. + */ +void nmreq_header_init(struct nmreq_header *hdr, uint16_t reqtype, void *body); + +/* + * These functions allow for finer grained parsing of portspecs. They are used + * internally by nmport_parse(). + */ + +/* nmreq_header_decode - initialize an nmreq_header + * @ppspec: (in/out) pointer to a pointer to the portspec + * @hdr: pointer to the nmreq_header to be initialized + * @ctx: pointer to the nmctx to use (for errors) + * + * This function fills the @hdr the nr_name field with the port name extracted + * from *@pifname. The other fields of *@hdr are unchanged. The @pifname is + * updated to point at the first char past the port name. + * + * Returns 0 on success. In case of error, -1 is returned with errno set to + * EINVAL, @pifname is unchanged, *@hdr is also unchanged, and an error message + * is sent through @ctx->error(). + */ +int nmreq_header_decode(const char **ppspec, struct nmreq_header *hdr, + struct nmctx *ctx); + +/* nmreq_regiter_decode - initialize an nmreq_register + * @pmode: (in/out) pointer to a pointer to an opening mode + * @reg: pointer to the nmreq_register to be initialized + * @ctx: pointer to the nmctx to use (for errors) + * + * This function fills the nr_mode, nr_ringid, nr_flags and nr_mem_id fields of + * the structure pointed by @reg, according to the opening mode specified by + * *@pmode. The other fields of *@reg are unchanged. The @pmode is updated to + * point at the first char past the opening mode. + * + * If a '@' is encountered followed by something which is not a number, parsing + * stops (without error) and @pmode is left pointing at the '@' char. The + * nr_mode, nr_ringid and nr_flags fields are still updated, but nr_mem_id is + * not touched and the interpretation of the '@' field is left to the caller. + * + * Returns 0 on success. In case of error, -1 is returned with errno set to + * EINVAL, @pmode is unchanged, *@reg is also unchanged, and an error message + * is sent through @ctx->error(). + */ +int nmreq_register_decode(const char **pmode, struct nmreq_register *reg, + struct nmctx *ctx); + +/* nmreq_options_decode - parse the "options" part of the portspec + * @opt: pointer to the option list + * @parsers: list of option parsers + * @token: token to pass to each parser + * @ctx: pointer to the nmctx to use (for errors and malloc/free) + * + * This function parses each option in @opt. Each option is matched (based on + * the "option" prefix) to a corresponding parser in @parsers. The function + * checks that the syntax is appropriate for the parser and it assigns all the + * keys mentioned in the option. It then passes control to the parser, to + * interpret the keys values. + * + * Returns 0 on success. In case of error, -1 is returned, errno is set to an + * error value and a message is sent to @ctx->error(). The effects of partially + * interpreted options may not be undone. + */ +struct nmreq_opt_parser; +int nmreq_options_decode(const char *opt, struct nmreq_opt_parser *parsers, + void *token, struct nmctx *ctx); + +struct nmreq_parse_ctx; +/* type of the option-parsers callbacks */ +typedef int (*nmreq_opt_parser_cb)(struct nmreq_parse_ctx *); + +#define NMREQ_OPT_MAXKEYS 16 /* max nr of recognized keys per option */ + +/* struct nmreq_opt_key - describes an option key */ +struct nmreq_opt_key { + const char *key; /* the key name */ + int id; /* its position in the parse context */ + unsigned int flags; +#define NMREQ_OPTK_ALLOWEMPTY (1U << 0) /* =value may be omitted */ +#define NMREQ_OPTK_MUSTSET (1U << 1) /* the key is mandatory */ +#define NMREQ_OPTK_DEFAULT (1U << 2) /* this is the default key */ +}; + +/* struct nmreq_opt_parser - describes an option parser */ +struct nmreq_opt_parser { + const char *prefix; /* matches one option prefix */ + nmreq_opt_parser_cb parse; /* the parse callback */ + int default_key; /* which option is the default if the + parser is multi-key (-1 if none) */ + int nr_keys; + unsigned int flags; +#define NMREQ_OPTF_DISABLED (1U << 0) +#define NMREQ_OPTF_ALLOWEMPTY (1U << 1) /* =value can be omitted */ + + struct nmreq_opt_parser *next; /* list of options */ + + /* recognized keys */ + struct nmreq_opt_key keys[NMREQ_OPT_MAXKEYS]; +} __attribute__((aligned(16))); + +/* struct nmreq_parse_ctx - the parse context received by the parse callback */ +struct nmreq_parse_ctx { + struct nmctx *ctx; /* the nmctx for errors and malloc/free */ + void *token; /* the token passed to nmreq_options_parse */ + + /* the value (i.e., the part after the = sign) of each recognized key + * is assigned to the corresponding entry in this array, based on the + * key id. Unassigned keys are left at NULL. + */ + const char *keys[NMREQ_OPT_MAXKEYS]; +}; + +/* nmreq_get_mem_id - get the mem_id of the given port + * @portname pointer to a pointer to the portname + * @ctx pointer to the nmctx to use (for errors) + * + * *@portname must point to a substem:vpname porname, possibly followed by + * something else. + * + * If successful, returns the mem_id of *@portname and moves @portname past the + * subsystem:vpname part of the input. In case of error it returns -1, sets + * errno to an error value and sends an error message to ctx->error(). + */ +int32_t nmreq_get_mem_id(const char **portname, struct nmctx *ctx); + +/* option list manipulation */ +void nmreq_push_option(struct nmreq_header *, struct nmreq_option *); +void nmreq_remove_option(struct nmreq_header *, struct nmreq_option *); +struct nmreq_option *nmreq_find_option(struct nmreq_header *, uint32_t); +void nmreq_free_options(struct nmreq_header *); +const char* nmreq_option_name(uint32_t); +#define nmreq_foreach_option(h_, o_) \ + for ((o_) = (struct nmreq_option *)((h_)->nr_options);\ + (o_) != NULL;\ + (o_) = (struct nmreq_option *)((o_)->nro_next)) + +/* nmctx manipulation */ + +/* the nmctx serves a few purposes: + * + * - maintain a list of all memory regions open by the program, so that two + * ports that are using the same region (as identified by the mem_id) will + * point to the same nmem_d instance. + * + * - allow the user to specify how to lock accesses to the above list, if + * needed (lock() callback) + * + * - allow the user to specify how error messages should be delivered (error() + * callback) + * + * - select the verbosity of the library (verbose field); if verbose==0, no + * errors are sent to the error() callback + * + * - allow the user to override the malloc/free functions used by the library + * (malloc() and free() callbacks) + * + */ +typedef void (*nmctx_error_cb)(struct nmctx *, const char *); +typedef void *(*nmctx_malloc_cb)(struct nmctx *,size_t); +typedef void (*nmctx_free_cb)(struct nmctx *,void *); +typedef void (*nmctx_lock_cb)(struct nmctx *, int); + +struct nmctx { + int verbose; + nmctx_error_cb error; + nmctx_malloc_cb malloc; + nmctx_free_cb free; + nmctx_lock_cb lock; + + struct nmem_d *mem_descs; +}; + +/* nmctx_get - obtain a pointer to the current default context */ +struct nmctx *nmctx_get(void); + +/* nmctx_set_default - change the default context + * @ctx pointer to the new context + * + * Returns a pointer to the previous default context. + */ +struct nmctx *nmctx_set_default(struct nmctx *ctx); + +/* internal functions and data structures */ + +/* struct nmem_d - describes a memory region currently used */ +struct nmem_d { + uint16_t mem_id; /* the region netmap identifier */ + int refcount; /* how many nmport_d's point here */ + void *mem; /* memory region base address */ + size_t size; /* memory region size */ + int is_extmem; /* was it obtained via extmem? */ + + /* pointers for the circular list implementation. + * The list head is the mem_descs filed in the nmctx + */ + struct nmem_d *next; + struct nmem_d *prev; +}; + +/* a trick to force the inclusion of libpthread only if requested. If + * LIBNETMAP_NOTHREADSAFE is defined, no pthread symbol is imported. + * + * There is no need to actually call this function: the ((used)) attribute is + * sufficient to include it in the image. + */ +static __attribute__((used)) void libnetmap_init(void) +{ +#ifndef LIBNETMAP_NOTHREADSAFE + extern int nmctx_threadsafe; + /* dummy assignment to link-in the nmctx-pthread.o object. The proper + * inizialization is performed only once in the library constructor + * defined there. + */ + nmctx_threadsafe = 1; +#endif /* LIBNETMAP_NOTHREADSAFE */ +} + +/* nmctx_set_threadsafe - install a threadsafe default context + * + * called by the constructor in nmctx-pthread.o to initialize a lock and install + * the lock() callback in the default context. + */ +void nmctx_set_threadsafe(void); + +/* nmctx_ferror - format and send an error message */ +void nmctx_ferror(struct nmctx *, const char *, ...); +/* nmctx_malloc - allocate memory */ +void *nmctx_malloc(struct nmctx *, size_t); +/* nmctx_free - free memory allocated via nmctx_malloc */ +void nmctx_free(struct nmctx *, void *); +/* nmctx_lock - lock the list of nmem_d */ +void nmctx_lock(struct nmctx *); +/* nmctx_unlock - unlock the list of nmem_d */ +void nmctx_unlock(struct nmctx *); + +#endif /* LIBNETMAP_H_ */ Added: head/lib/libnetmap/nmctx-pthreads.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetmap/nmctx-pthreads.c Fri Aug 28 20:03:54 2020 (r364936) @@ -0,0 +1,47 @@ +/* $FreeBSD$ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libnetmap.h" + +struct nmctx_pthread { + struct nmctx up; + pthread_mutex_t mutex; +}; + +static struct nmctx_pthread nmctx_pthreadsafe; + +static void +nmctx_pthread_lock(struct nmctx *ctx, int lock) +{ + struct nmctx_pthread *ctxp = + (struct nmctx_pthread *)ctx; + if (lock) { + pthread_mutex_lock(&ctxp->mutex); + } else { + pthread_mutex_unlock(&ctxp->mutex); + } +} + +void __attribute__ ((constructor)) +nmctx_set_threadsafe(void) +{ + struct nmctx *old; + + pthread_mutex_init(&nmctx_pthreadsafe.mutex, NULL); + old = nmctx_set_default(&nmctx_pthreadsafe.up); + nmctx_pthreadsafe.up = *old; + nmctx_pthreadsafe.up.lock = nmctx_pthread_lock; +} + +int nmctx_threadsafe; Added: head/lib/libnetmap/nmctx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetmap/nmctx.c Fri Aug 28 20:03:54 2020 (r364936) @@ -0,0 +1,111 @@ +/* $FreeBSD$ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define LIBNETMAP_NOTHREADSAFE +#include "libnetmap.h" + +static void +nmctx_default_error(struct nmctx *ctx, const char *errmsg) +{ + fprintf(stderr, "%s\n", errmsg); +} + +static void * +nmctx_default_malloc(struct nmctx *ctx, size_t sz) +{ + (void)ctx; + return malloc(sz); +} + +static void +nmctx_default_free(struct nmctx *ctx, void *p) +{ + (void)ctx; + free(p); +} + +static struct nmctx nmctx_global = { + .verbose = 1, + .error = nmctx_default_error, + .malloc = nmctx_default_malloc, + .free = nmctx_default_free, + .lock = NULL, +}; + +static struct nmctx *nmctx_default = &nmctx_global; + +struct nmctx * +nmctx_get(void) +{ + return nmctx_default; +} + +struct nmctx * +nmctx_set_default(struct nmctx *ctx) +{ + struct nmctx *old = nmctx_default; + nmctx_default = ctx; + return old; +} + +#define MAXERRMSG 1000 +void +nmctx_ferror(struct nmctx *ctx, const char *fmt, ...) +{ + char errmsg[MAXERRMSG]; + va_list ap; + int rv; + + if (!ctx->verbose) + return; + + va_start(ap, fmt); + rv = vsnprintf(errmsg, MAXERRMSG, fmt, ap); + va_end(ap); + + if (rv > 0) { + if (rv < MAXERRMSG) { + ctx->error(ctx, errmsg); + } else { + ctx->error(ctx, "error message too long"); + } + } else { + ctx->error(ctx, "internal error"); + } +} + +void * +nmctx_malloc(struct nmctx *ctx, size_t sz) +{ + return ctx->malloc(ctx, sz); +} + +void +nmctx_free(struct nmctx *ctx, void *p) +{ + ctx->free(ctx, p); +} + +void +nmctx_lock(struct nmctx *ctx) +{ + if (ctx->lock != NULL) + ctx->lock(ctx, 1); +} + +void +nmctx_unlock(struct nmctx *ctx) +{ + if (ctx->lock != NULL) + ctx->lock(ctx, 0); +} Added: head/lib/libnetmap/nmport.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetmap/nmport.c Fri Aug 28 20:03:54 2020 (r364936) @@ -0,0 +1,810 @@ +/* $FreeBSD$ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define LIBNETMAP_NOTHREADSAFE +#include "libnetmap.h" + +struct nmport_cleanup_d { + struct nmport_cleanup_d *next; + void (*cleanup)(struct nmport_cleanup_d *, struct nmport_d *); +}; + +static void +nmport_push_cleanup(struct nmport_d *d, struct nmport_cleanup_d *c) +{ + c->next = d->clist; + d->clist = c; +} + +static void +nmport_pop_cleanup(struct nmport_d *d) +{ + struct nmport_cleanup_d *top; + + top = d->clist; + d->clist = d->clist->next; + (*top->cleanup)(top, d); + nmctx_free(d->ctx, top); +} + +void nmport_do_cleanup(struct nmport_d *d) +{ + while (d->clist != NULL) { + nmport_pop_cleanup(d); + } +} + +static struct nmport_d * +nmport_new_with_ctx(struct nmctx *ctx) +{ + struct nmport_d *d; + + /* allocate a descriptor */ + d = nmctx_malloc(ctx, sizeof(*d)); + if (d == NULL) { + nmctx_ferror(ctx, "cannot allocate nmport descriptor"); + goto out; + } + memset(d, 0, sizeof(*d)); + + nmreq_header_init(&d->hdr, NETMAP_REQ_REGISTER, &d->reg); + + d->ctx = ctx; + d->fd = -1; + +out: + return d; +} + +struct nmport_d * +nmport_new(void) +{ + struct nmctx *ctx = nmctx_get(); + return nmport_new_with_ctx(ctx); +} + + +void +nmport_delete(struct nmport_d *d) +{ + nmctx_free(d->ctx, d); +} + +void +nmport_extmem_cleanup(struct nmport_cleanup_d *c, struct nmport_d *d) +{ + (void)c; + + if (d->extmem == NULL) + return; + + nmreq_remove_option(&d->hdr, &d->extmem->nro_opt); + nmctx_free(d->ctx, d->extmem); + d->extmem = NULL; +} + + +int +nmport_extmem(struct nmport_d *d, void *base, size_t size) +{ + struct nmctx *ctx = d->ctx; + struct nmport_cleanup_d *clnup = NULL; + + if (d->register_done) { + nmctx_ferror(ctx, "%s: cannot set extmem of an already registered port", d->hdr.nr_name); + errno = EINVAL; + return -1; + } + + if (d->extmem != NULL) { + nmctx_ferror(ctx, "%s: extmem already in use", d->hdr.nr_name); + errno = EINVAL; + return -1; + } + + clnup = (struct nmport_cleanup_d *)nmctx_malloc(ctx, sizeof(*clnup)); + if (clnup == NULL) { + nmctx_ferror(ctx, "failed to allocate cleanup descriptor"); + errno = ENOMEM; + return -1; + } + + d->extmem = nmctx_malloc(ctx, sizeof(*d->extmem)); + if (d->extmem == NULL) { + nmctx_ferror(ctx, "%s: cannot allocate extmem option", d->hdr.nr_name); + nmctx_free(ctx, clnup); + errno = ENOMEM; + return -1; + } + memset(d->extmem, 0, sizeof(*d->extmem)); + d->extmem->nro_usrptr = (uintptr_t)base; + d->extmem->nro_opt.nro_reqtype = NETMAP_REQ_OPT_EXTMEM; + d->extmem->nro_info.nr_memsize = size; + nmreq_push_option(&d->hdr, &d->extmem->nro_opt); + + clnup->cleanup = nmport_extmem_cleanup; + nmport_push_cleanup(d, clnup); + + return 0; +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 28 20:05:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D34633BF16C; Fri, 28 Aug 2020 20:05:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdVvL5HCfz4JxB; Fri, 28 Aug 2020 20:05:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98B6819E65; Fri, 28 Aug 2020 20:05:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SK5IVL093672; Fri, 28 Aug 2020 20:05:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SK5I6N093671; Fri, 28 Aug 2020 20:05:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202008282005.07SK5I6N093671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 28 Aug 2020 20:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364937 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 364937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 20:05:18 -0000 Author: tuexen Date: Fri Aug 28 20:05:18 2020 New Revision: 364937 URL: https://svnweb.freebsd.org/changeset/base/364937 Log: Fix a regression with the explicit EOR mode I introduced in r364268. A short MFC time as discussed with the secteam. Reported by: Taylor Brandstetter MFC after: 1 day Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Aug 28 20:03:54 2020 (r364936) +++ head/sys/netinet/sctp_output.c Fri Aug 28 20:05:18 2020 (r364937) @@ -13118,11 +13118,10 @@ skip_preblock: error = EINVAL; goto out; } - SCTP_TCB_SEND_UNLOCK(stcb); - strm = &stcb->asoc.strmout[srcv->sinfo_stream]; if (strm->last_msg_incomplete == 0) { do_a_copy_in: + SCTP_TCB_SEND_UNLOCK(stcb); sp = sctp_copy_it_in(stcb, asoc, srcv, uio, net, max_len, user_marks_eor, &error); if (error) { goto out; @@ -13151,19 +13150,8 @@ skip_preblock: sp->processing = 1; TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp, 1); - SCTP_TCB_SEND_UNLOCK(stcb); } else { - SCTP_TCB_SEND_LOCK(stcb); sp = TAILQ_LAST(&strm->outqueue, sctp_streamhead); - if (sp->processing) { - SCTP_TCB_SEND_UNLOCK(stcb); - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); - error = EINVAL; - goto out; - } else { - sp->processing = 1; - } - SCTP_TCB_SEND_UNLOCK(stcb); if (sp == NULL) { /* ???? Huh ??? last msg is gone */ #ifdef INVARIANTS @@ -13175,7 +13163,16 @@ skip_preblock: goto do_a_copy_in; } + if (sp->processing) { + SCTP_TCB_SEND_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; + goto out; + } else { + sp->processing = 1; + } } + SCTP_TCB_SEND_UNLOCK(stcb); while (uio->uio_resid > 0) { /* How much room do we have? */ struct mbuf *new_tail, *mm; @@ -13200,6 +13197,11 @@ skip_preblock: if (mm) { sctp_m_freem(mm); } + SCTP_TCB_SEND_LOCK(stcb); + if (sp != NULL) { + sp->processing = 0; + } + SCTP_TCB_SEND_UNLOCK(stcb); goto out; } /* Update the mbuf and count */ @@ -13215,6 +13217,9 @@ skip_preblock: SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); error = ECONNRESET; } + if (sp != NULL) { + sp->processing = 0; + } SCTP_TCB_SEND_UNLOCK(stcb); goto out; } @@ -13274,6 +13279,11 @@ skip_preblock: /* wait for space now */ if (non_blocking) { /* Non-blocking io in place out */ + SCTP_TCB_SEND_LOCK(stcb); + if (sp != NULL) { + sp->processing = 0; + } + SCTP_TCB_SEND_UNLOCK(stcb); goto skip_out_eof; } /* What about the INIT, send it maybe */ @@ -13401,6 +13411,11 @@ skip_preblock: } } SOCKBUF_UNLOCK(&so->so_snd); + SCTP_TCB_SEND_LOCK(stcb); + if (sp != NULL) { + sp->processing = 0; + } + SCTP_TCB_SEND_UNLOCK(stcb); goto out_unlocked; } @@ -13410,9 +13425,15 @@ skip_preblock: } } SOCKBUF_UNLOCK(&so->so_snd); + SCTP_TCB_SEND_LOCK(stcb); if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + if (sp != NULL) { + sp->processing = 0; + } + SCTP_TCB_SEND_UNLOCK(stcb); goto out_unlocked; } + SCTP_TCB_SEND_UNLOCK(stcb); } SCTP_TCB_SEND_LOCK(stcb); if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) || From owner-svn-src-head@freebsd.org Fri Aug 28 21:31:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 099E23C2653; Fri, 28 Aug 2020 21:31:40 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdXpy24Klz4Rvs; Fri, 28 Aug 2020 21:31:38 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1kBly6-000JSR-KD; Fri, 28 Aug 2020 14:31:31 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 07SLVUeZ074798; Fri, 28 Aug 2020 14:31:30 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Fri, 28 Aug 2020 14:31:30 -0700 From: Oleksandr Tymoshenko To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r353419 - head/sys/net Message-ID: <20200828213130.GA74775@bluezbox.com> References: <201910102342.x9ANguvu083989@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201910102342.x9ANguvu083989@repo.freebsd.org> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Gleb Smirnoff (glebius@FreeBSD.org) wrote: > Author: glebius > Date: Thu Oct 10 23:42:55 2019 > New Revision: 353419 > URL: https://svnweb.freebsd.org/changeset/base/353419 > > Log: > Provide new KPI [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 4BdXpy24Klz4Rvs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-1.84 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[gonzo]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.944]; NEURAL_HAM_MEDIUM(-0.83)[-0.831]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.24)[0.239]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 21:31:40 -0000 Gleb Smirnoff (glebius@FreeBSD.org) wrote: > Author: glebius > Date: Thu Oct 10 23:42:55 2019 > New Revision: 353419 > URL: https://svnweb.freebsd.org/changeset/base/353419 > > Log: > Provide new KPI for network drivers to access lists of interface > addresses. The KPI doesn't reveal neither how addresses are stored, > how the access to them is synchronized, neither reveal struct ifaddr > and struct ifmaddr. > > Reviewed by: gallatin, erj, hselasky, philip, stevek > Differential Revision: https://reviews.freebsd.org/D21943 Hi Gleb, Are there any plans to MFC this change and the subsequent API consumer changes? Lack of this API in 12 makes MFCing unrelated eth driver fixes hard. -- gonzo From owner-svn-src-head@freebsd.org Fri Aug 28 21:59:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC6933C38FF; Fri, 28 Aug 2020 21:59:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdYQk6Pjcz4VMl; Fri, 28 Aug 2020 21:59:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C01721B945; Fri, 28 Aug 2020 21:59:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SLxAmw063628; Fri, 28 Aug 2020 21:59:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SLxAEE063626; Fri, 28 Aug 2020 21:59:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008282159.07SLxAEE063626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 28 Aug 2020 21:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364940 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 364940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 21:59:11 -0000 Author: melifaro Date: Fri Aug 28 21:59:10 2020 New Revision: 364940 URL: https://svnweb.freebsd.org/changeset/base/364940 Log: Further split nhop creation and rtable operations. As nexthops are immutable, some operations such as route attribute changes require nexthop fetching, forking, modification and route switching. These operations are not atomic, so they may need to be retried multiple times in presence of multiple speakers changing the same route. This change introduces "synchronisation" primitive: route_update_conditional(), simplifying logic for route changes and upcoming multipath operations. Differential Revision: https://reviews.freebsd.org/D26216 Modified: head/sys/net/route/route_ctl.c head/sys/net/route/route_var.h Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Fri Aug 28 20:37:57 2020 (r364939) +++ head/sys/net/route/route_ctl.c Fri Aug 28 21:59:10 2020 (r364940) @@ -78,9 +78,15 @@ struct rib_subscription { static int add_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info *rc); +static int add_route_nhop(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *rnd, + struct rib_cmd_info *rc); static int del_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info *rc); -static int change_route(struct rib_head *, struct rt_addrinfo *, +static int change_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct route_nhop_data *nhd_orig, struct rib_cmd_info *rc); +static int change_route_nhop(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *rnd, struct rib_cmd_info *rc); static void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, struct rib_cmd_info *rc); @@ -202,14 +208,18 @@ rib_add_route(uint32_t fibnum, struct rt_addrinfo *inf return (add_route(rnh, info, rc)); } +/* + * Creates rtentry and nexthop based on @info data. + * Return 0 and fills in rtentry into @prt on success, + * return errno otherwise. + */ static int -add_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rib_cmd_info *rc) +create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **prt) { struct sockaddr *dst, *ndst, *gateway, *netmask; - struct rtentry *rt, *rt_old; + struct rtentry *rt; struct nhop_object *nh; - struct radix_node *rn; struct ifaddr *ifa; int error, flags; @@ -276,8 +286,29 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in rt->rt_weight = 1; rt_setmetrics(info, rt); - rt_old = NULL; + *prt = rt; + return (0); +} + +static int +add_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rib_cmd_info *rc) +{ + struct sockaddr *ndst, *netmask; + struct route_nhop_data rnd; + struct nhop_object *nh; + struct rtentry *rt; + int error; + + error = create_rtentry(rnh, info, &rt); + if (error != 0) + return (error); + + rnd.rnd_nhop = rt->rt_nhop; + rnd.rnd_weight = rt->rt_weight; + nh = rt->rt_nhop; + RIB_WLOCK(rnh); #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ @@ -290,76 +321,42 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (EEXIST); } #endif + error = add_route_nhop(rnh, rt, info, &rnd, rc); + if (error == 0) { + rt = NULL; + nh = NULL; + } else if ((error == EEXIST) && ((info->rti_flags & RTF_PINNED) != 0)) { + struct rtentry *rt_orig; + struct nhop_object *nh_orig; + struct radix_node *rn; - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); - - if (rn != NULL) { - /* Most common usecase */ - if (rt->rt_expire > 0) - tmproutes_update(rnh, rt); - - /* Finalize notification */ - rnh->rnh_gen++; - - rc->rc_rt = rt; - rc->rc_nh_new = nh; - rc->rc_nh_weight = rt->rt_weight; - - rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); - } else if ((info->rti_flags & RTF_PINNED) != 0) { - - /* - * Force removal and re-try addition - * TODO: better multipath&pinned support - */ - struct sockaddr *info_dst = info->rti_info[RTAX_DST]; - info->rti_info[RTAX_DST] = ndst; - /* Do not delete existing PINNED(interface) routes */ - info->rti_flags &= ~RTF_PINNED; - rt_old = rt_unlinkrte(rnh, info, &error); - info->rti_flags |= RTF_PINNED; - info->rti_info[RTAX_DST] = info_dst; - if (rt_old != NULL) { - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, - rt->rt_nodes); - - /* Finalize notification */ - rnh->rnh_gen++; - - if (rn != NULL) { - rc->rc_cmd = RTM_CHANGE; - rc->rc_rt = rt; - rc->rc_nh_old = rt_old->rt_nhop; - rc->rc_nh_new = nh; - rc->rc_nh_weight = rt->rt_weight; - } else { - rc->rc_cmd = RTM_DELETE; - rc->rc_rt = rt_old; - rc->rc_nh_old = rt_old->rt_nhop; - rc->rc_nh_weight = rt_old->rt_weight; + ndst = (struct sockaddr *)rt_key(rt); + netmask = info->rti_info[RTAX_NETMASK]; + rn = rnh->rnh_lookup(ndst, netmask, &rnh->head); + rt_orig = (struct rtentry *)rn; + if (rt_orig != NULL) { + nh_orig = rt_orig->rt_nhop; + if ((nhop_get_rtflags(nh_orig) & RTF_PINNED) == 0) { + /* Current nexhop is not PINNED, can update */ + error = change_route_nhop(rnh, rt_orig, + info, &rnd, rc); + if (error == 0) + nh = NULL; } - rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); - } + } else + error = ENOBUFS; } RIB_WUNLOCK(rnh); - if ((rn != NULL) || (rt_old != NULL)) + if (error == 0) rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); - if (rt_old != NULL) - rtfree(rt_old); - - /* - * If it still failed to go into the tree, - * then un-make it (this should be a function) - */ - if (rn == NULL) { + if (nh != NULL) nhop_free(nh); + if (rt != NULL) uma_zfree(V_rtzone, rt); - return (EEXIST); - } - return (0); + return (error); } @@ -508,7 +505,11 @@ int rib_change_route(uint32_t fibnum, struct rt_addrinfo *info, struct rib_cmd_info *rc) { + RIB_RLOCK_TRACKER; + struct route_nhop_data rnd_orig; struct rib_head *rnh; + struct rtentry *rt; + int error; NET_EPOCH_ASSERT(); @@ -519,18 +520,18 @@ rib_change_route(uint32_t fibnum, struct rt_addrinfo * bzero(rc, sizeof(struct rib_cmd_info)); rc->rc_cmd = RTM_CHANGE; - return (change_route(rnh, info, rc)); -} + /* Check if updated gateway exists */ + if ((info->rti_flags & RTF_GATEWAY) && + (info->rti_info[RTAX_GATEWAY] == NULL)) + return (EINVAL); -static int -change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, - struct rib_cmd_info *rc) -{ - RIB_RLOCK_TRACKER; - struct rtentry *rt = NULL; - int error = 0; - int free_ifa = 0; - struct nhop_object *nh, *nh_orig; + /* + * route change is done in multiple steps, with dropping and + * reacquiring lock. In the situations with multiple processes + * changes the same route in can lead to the case when route + * is changed between the steps. Address it by retrying the operation + * multiple times before failing. + */ RIB_RLOCK(rnh); rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], @@ -554,12 +555,33 @@ change_route_one(struct rib_head *rnh, struct rt_addri } } #endif - nh_orig = rt->rt_nhop; + rnd_orig.rnd_nhop = rt->rt_nhop; + rnd_orig.rnd_weight = rt->rt_weight; RIB_RUNLOCK(rnh); - rt = NULL; + for (int i = 0; i < RIB_MAX_RETRIES; i++) { + error = change_route(rnh, info, &rnd_orig, rc); + if (error != EAGAIN) + break; + } + + return (error); +} + +static int +change_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc) +{ + int error = 0; + int free_ifa = 0; + struct nhop_object *nh, *nh_orig; + struct route_nhop_data rnd_new; + nh = NULL; + nh_orig = rnd_orig->rnd_nhop; + if (nh_orig == NULL) + return (ESRCH); /* * New gateway could require new ifaddr, ifp; @@ -593,71 +615,168 @@ change_route_one(struct rib_head *rnh, struct rt_addri if (error != 0) return (error); - RIB_WLOCK(rnh); + rnd_new.rnd_nhop = nh; + if (info->rti_mflags & RTV_WEIGHT) + rnd_new.rnd_weight = info->rti_rmx->rmx_weight; + else + rnd_new.rnd_weight = rnd_orig->rnd_weight; - /* Lookup rtentry once again and check if nexthop is still the same */ - rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], &rnh->head); + error = change_route_conditional(rnh, NULL, info, rnd_orig, &rnd_new, rc); - if (rt == NULL) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (ESRCH); - } + return (error); +} - if (rt->rt_nhop != nh_orig) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (EAGAIN); +/* + * Insert @rt with nhop data from @rnd_new to @rnh. + * Returns 0 on success. + */ +static int +add_route_nhop(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *rnd, + struct rib_cmd_info *rc) +{ + struct sockaddr *ndst, *netmask; + struct radix_node *rn; + int error = 0; + + RIB_WLOCK_ASSERT(rnh); + + ndst = (struct sockaddr *)rt_key(rt); + netmask = info->rti_info[RTAX_NETMASK]; + + rt->rt_nhop = rnd->rnd_nhop; + rt->rt_weight = rnd->rnd_weight; + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); + + if (rn != NULL) { + if (rt->rt_expire > 0) + tmproutes_update(rnh, rt); + + /* Finalize notification */ + rnh->rnh_gen++; + + rc->rc_cmd = RTM_ADD; + rc->rc_rt = rt; + rc->rc_nh_old = NULL; + rc->rc_nh_new = rnd->rnd_nhop; + rc->rc_nh_weight = rnd->rnd_weight; + + rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); + } else { + /* Existing route or memory allocation failure */ + error = EEXIST; } - /* Proceed with the update */ + return (error); +} - /* Provide notification to the protocols.*/ - rt->rt_nhop = nh; - rt_setmetrics(info, rt); +/* + * Switch @rt nhop/weigh to the ones specified in @rnd. + * Conditionally set rt_expire if set in @info. + * Returns 0 on success. + */ +static int +change_route_nhop(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *rnd, + struct rib_cmd_info *rc) +{ + struct nhop_object *nh_orig; + RIB_WLOCK_ASSERT(rnh); + + nh_orig = rt->rt_nhop; + + if (rnd->rnd_nhop != NULL) { + /* Changing expiration & nexthop & weight to a new one */ + rt_setmetrics(info, rt); + rt->rt_nhop = rnd->rnd_nhop; + rt->rt_weight = rnd->rnd_weight; + if (rt->rt_expire > 0) + tmproutes_update(rnh, rt); + } else { + /* Route deletion requested. */ + struct sockaddr *ndst, *netmask; + struct radix_node *rn; + + ndst = (struct sockaddr *)rt_key(rt); + netmask = info->rti_info[RTAX_NETMASK]; + rn = rnh->rnh_deladdr(ndst, netmask, &rnh->head); + if (rn == NULL) + return (ESRCH); + } + /* Finalize notification */ rnh->rnh_gen++; + rc->rc_cmd = (rnd->rnd_nhop != NULL) ? RTM_CHANGE : RTM_DELETE; rc->rc_rt = rt; rc->rc_nh_old = nh_orig; - rc->rc_nh_new = rt->rt_nhop; - rc->rc_nh_weight = rt->rt_weight; + rc->rc_nh_new = rnd->rnd_nhop; + rc->rc_nh_weight = rnd->rnd_weight; rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); - RIB_WUNLOCK(rnh); - - rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); - - nhop_free(nh_orig); - return (0); } -static int -change_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rib_cmd_info *rc) +/* + * Conditionally update route nhop/weight IFF data in @nhd_orig is + * consistent with the current route data. + * Nexthop in @nhd_new is consumed. + */ +int +change_route_conditional(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *rnd_orig, + struct route_nhop_data *rnd_new, struct rib_cmd_info *rc) { - int error; + struct rtentry *rt_new; + int error = 0; - /* Check if updated gateway exists */ - if ((info->rti_flags & RTF_GATEWAY) && - (info->rti_info[RTAX_GATEWAY] == NULL)) - return (EINVAL); + RIB_WLOCK(rnh); - /* - * route change is done in multiple steps, with dropping and - * reacquiring lock. In the situations with multiple processes - * changes the same route in can lead to the case when route - * is changed between the steps. Address it by retrying the operation - * multiple times before failing. - */ - for (int i = 0; i < RIB_MAX_RETRIES; i++) { - error = change_route_one(rnh, info, rc); - if (error != EAGAIN) - break; + rt_new = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], &rnh->head); + + if (rt_new == NULL) { + if (rnd_orig->rnd_nhop == NULL) + error = add_route_nhop(rnh, rt, info, rnd_new, rc); + else { + /* + * Prefix does not exist, which was not our assumption. + * Update @rnd_orig with the new data and return + */ + rnd_orig->rnd_nhop = NULL; + rnd_orig->rnd_weight = 0; + error = EAGAIN; + } + } else { + /* Prefix exists, try to update */ + if (rnd_orig->rnd_nhop == rt_new->rt_nhop) { + + /* + * Nhop/mpath group hasn't changed. Flip + * to the new precalculated one and return + */ + error = change_route_nhop(rnh, rt_new, info, rnd_new, rc); + } else { + /* Update and retry */ + rnd_orig->rnd_nhop = rt_new->rt_nhop; + rnd_orig->rnd_weight = rt_new->rt_weight; + error = EAGAIN; + } + } + + RIB_WUNLOCK(rnh); + + if (error == 0) { + rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); + + if (rnd_orig->rnd_nhop != NULL) + nhop_free_any(rnd_orig->rnd_nhop); + + } else { + if (rnd_new->rnd_nhop != NULL) + nhop_free_any(rnd_new->rnd_nhop); } return (error); Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Fri Aug 28 20:37:57 2020 (r364939) +++ head/sys/net/route/route_var.h Fri Aug 28 21:59:10 2020 (r364940) @@ -226,6 +226,14 @@ void tmproutes_init(struct rib_head *rh); void tmproutes_destroy(struct rib_head *rh); /* route_ctl.c */ +struct route_nhop_data { + struct nhop_object *rnd_nhop; + uint32_t rnd_weight; +}; +int change_route_conditional(struct rib_head *rnh, struct rtentry *rt, + struct rt_addrinfo *info, struct route_nhop_data *nhd_orig, + struct route_nhop_data *nhd_new, struct rib_cmd_info *rc); + void vnet_rtzone_init(void); void vnet_rtzone_destroy(void); From owner-svn-src-head@freebsd.org Fri Aug 28 22:50:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB3F83C4AE0; Fri, 28 Aug 2020 22:50:23 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdZYq5X4Gz4Yx0; Fri, 28 Aug 2020 22:50:23 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CF2D1C40A; Fri, 28 Aug 2020 22:50:23 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SMoNPe095765; Fri, 28 Aug 2020 22:50:23 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SMoL7I095754; Fri, 28 Aug 2020 22:50:21 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008282250.07SMoL7I095754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 28 Aug 2020 22:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364941 - in head/sys: net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net net/route netinet netinet6 X-SVN-Commit-Revision: 364941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 22:50:23 -0000 Author: melifaro Date: Fri Aug 28 22:50:20 2020 New Revision: 364941 URL: https://svnweb.freebsd.org/changeset/base/364941 Log: Move net/route/shared.h definitions to net/route/route_var.h. No functional changes. net/route/shared.h was created in the inital phases of nexthop conversion. It was intended to serve the same purpose as route_var.h - share definitions of functions and structures between the routing subsystem components. At that time route_var.h was included by many files external to the routing subsystem, which largerly defeats its purpose. As currently this is not the case anymore and amount of route_var.h includes is roughly the same as shared.h, retire the latter in favour of the former. Deleted: head/sys/net/route/shared.h Modified: head/sys/net/radix_mpath.c head/sys/net/route.c head/sys/net/route/nhop.c head/sys/net/route/nhop_ctl.c head/sys/net/route/route_ctl.c head/sys/net/route/route_helpers.c head/sys/net/route/route_var.h head/sys/net/rtsock.c head/sys/netinet/in_fib.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_rmx.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/radix_mpath.c Fri Aug 28 22:50:20 2020 (r364941) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route.c Fri Aug 28 22:50:20 2020 (r364941) @@ -64,7 +64,6 @@ #include #include #include -#include #include #ifdef RADIX_MPATH Modified: head/sys/net/route/nhop.c ============================================================================== --- head/sys/net/route/nhop.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route/nhop.c Fri Aug 28 22:50:20 2020 (r364941) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: head/sys/net/route/nhop_ctl.c ============================================================================== --- head/sys/net/route/nhop_ctl.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route/nhop_ctl.c Fri Aug 28 22:50:20 2020 (r364941) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route/route_ctl.c Fri Aug 28 22:50:20 2020 (r364941) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef RADIX_MPATH Modified: head/sys/net/route/route_helpers.c ============================================================================== --- head/sys/net/route/route_helpers.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route/route_helpers.c Fri Aug 28 22:50:20 2020 (r364941) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef INET #include #endif Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/route/route_var.h Fri Aug 28 22:50:20 2020 (r364941) @@ -39,7 +39,14 @@ #include #include /* struct sockaddr_in */ #include +#include +#ifdef RTDEBUG +#define DPRINTF(_fmt, ...) printf("%s: " _fmt "\n", __func__ , ## __VA_ARGS__) +#else +#define DPRINTF(_fmt, ...) +#endif + struct nh_control; typedef int rnh_preadd_entry_f_t(u_int fibnum, const struct sockaddr *addr, const struct sockaddr *mask, struct nhop_object *nh); @@ -221,6 +228,7 @@ fib_rte_to_nh_flags(int rt_flags) return (res); } +/* route_temporal.c */ void tmproutes_update(struct rib_head *rnh, struct rtentry *rt); void tmproutes_init(struct rib_head *rh); void tmproutes_destroy(struct rib_head *rh); @@ -236,5 +244,33 @@ int change_route_conditional(struct rib_head *rnh, str void vnet_rtzone_init(void); void vnet_rtzone_destroy(void); + +/* subscriptions */ +void rib_init_subscriptions(struct rib_head *rnh); +void rib_destroy_subscriptions(struct rib_head *rnh); + +/* Nexhops */ +void nhops_init(void); +int nhops_init_rib(struct rib_head *rh); +void nhops_destroy_rib(struct rib_head *rh); +void nhop_ref_object(struct nhop_object *nh); +int nhop_try_ref_object(struct nhop_object *nh); +int nhop_ref_any(struct nhop_object *nh); +void nhop_free_any(struct nhop_object *nh); + +void nhop_set_type(struct nhop_object *nh, enum nhop_type nh_type); +void nhop_set_rtflags(struct nhop_object *nh, int rt_flags); + +int nhop_create_from_info(struct rib_head *rnh, struct rt_addrinfo *info, + struct nhop_object **nh_ret); +int nhop_create_from_nhop(struct rib_head *rnh, const struct nhop_object *nh_orig, + struct rt_addrinfo *info, struct nhop_object **pnh_priv); + +void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, uint32_t mtu); +int nhops_dump_sysctl(struct rib_head *rh, struct sysctl_req *w); + +/* route */ +struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, + int *perror); #endif Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/net/rtsock.c Fri Aug 28 22:50:20 2020 (r364941) @@ -77,7 +77,6 @@ #include #endif #include -#include #ifdef COMPAT_FREEBSD32 #include Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/netinet/in_fib.c Fri Aug 28 22:50:20 2020 (r364941) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef RADIX_MPATH Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/netinet/in_rmx.c Fri Aug 28 22:50:20 2020 (r364941) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/netinet6/in6_fib.c Fri Aug 28 22:50:20 2020 (r364941) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef RADIX_MPATH Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Fri Aug 28 21:59:10 2020 (r364940) +++ head/sys/netinet6/in6_rmx.c Fri Aug 28 22:50:20 2020 (r364941) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Fri Aug 28 23:01:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82B5C3C5404; Fri, 28 Aug 2020 23:01:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdZq92tT8z4b4V; Fri, 28 Aug 2020 23:01:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4627B1BE7E; Fri, 28 Aug 2020 23:01:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SN1vrg003489; Fri, 28 Aug 2020 23:01:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SN1uhd003488; Fri, 28 Aug 2020 23:01:56 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008282301.07SN1uhd003488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 28 Aug 2020 23:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364942 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 364942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 23:01:57 -0000 Author: melifaro Date: Fri Aug 28 23:01:56 2020 New Revision: 364942 URL: https://svnweb.freebsd.org/changeset/base/364942 Log: Move fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c. No functional changes. Initially this function was created to perform runtime flag conversions for the previous incarnation of fib lookup functions. As these functions got deprecated, move the function to the file with the only remaining caller. Lastly, rename it to convert_rt_to_nh_flags() to follow the naming notation. Modified: head/sys/net/route/nhop_ctl.c head/sys/net/route/route_var.h Modified: head/sys/net/route/nhop_ctl.c ============================================================================== --- head/sys/net/route/nhop_ctl.c Fri Aug 28 22:50:20 2020 (r364941) +++ head/sys/net/route/nhop_ctl.c Fri Aug 28 23:01:56 2020 (r364942) @@ -244,6 +244,21 @@ set_nhop_gw_from_info(struct nhop_object *nh, struct r return (0); } +static uint16_t +convert_rt_to_nh_flags(int rt_flags) +{ + uint16_t res; + + res = (rt_flags & RTF_REJECT) ? NHF_REJECT : 0; + res |= (rt_flags & RTF_HOST) ? NHF_HOST : 0; + res |= (rt_flags & RTF_BLACKHOLE) ? NHF_BLACKHOLE : 0; + res |= (rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) ? NHF_REDIRECT : 0; + res |= (rt_flags & RTF_BROADCAST) ? NHF_BROADCAST : 0; + res |= (rt_flags & RTF_GATEWAY) ? NHF_GATEWAY : 0; + + return (res); +} + static int fill_nhop_from_info(struct nhop_priv *nh_priv, struct rt_addrinfo *info) { @@ -258,7 +273,7 @@ fill_nhop_from_info(struct nhop_priv *nh_priv, struct nh_priv->nh_family = info->rti_info[RTAX_DST]->sa_family; nh_priv->nh_type = 0; // hook responsibility to set nhop type - nh->nh_flags = fib_rte_to_nh_flags(rt_flags); + nh->nh_flags = convert_rt_to_nh_flags(rt_flags); set_nhop_mtu_from_info(nh, info); nh->nh_ifp = info->rti_ifa->ifa_ifp; nh->nh_ifa = info->rti_ifa; @@ -397,7 +412,7 @@ alter_nhop_from_info(struct nhop_object *nh, struct rt nh->nh_priv->rt_flags |= (RTF_GATEWAY & info->rti_flags); } /* Update datapath flags */ - nh->nh_flags = fib_rte_to_nh_flags(nh->nh_priv->rt_flags); + nh->nh_flags = convert_rt_to_nh_flags(nh->nh_priv->rt_flags); if (info->rti_ifa != NULL) nh->nh_ifa = info->rti_ifa; Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Fri Aug 28 22:50:20 2020 (r364941) +++ head/sys/net/route/route_var.h Fri Aug 28 23:01:56 2020 (r364942) @@ -212,22 +212,6 @@ struct rtentry { ((!NH_IS_MULTIPATH(_nh)) ? (_nh) : _SELECT_NHOP(_nh, _flowid)) #define RT_SELECT_NHOP(_rt, _flowid) _RT_SELECT_NHOP((_rt)->rt_nhop, _flowid) -/* rte<>nhop translation */ -static inline uint16_t -fib_rte_to_nh_flags(int rt_flags) -{ - uint16_t res; - - res = (rt_flags & RTF_REJECT) ? NHF_REJECT : 0; - res |= (rt_flags & RTF_HOST) ? NHF_HOST : 0; - res |= (rt_flags & RTF_BLACKHOLE) ? NHF_BLACKHOLE : 0; - res |= (rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) ? NHF_REDIRECT : 0; - res |= (rt_flags & RTF_BROADCAST) ? NHF_BROADCAST : 0; - res |= (rt_flags & RTF_GATEWAY) ? NHF_GATEWAY : 0; - - return (res); -} - /* route_temporal.c */ void tmproutes_update(struct rib_head *rnh, struct rtentry *rt); void tmproutes_init(struct rib_head *rh); From owner-svn-src-head@freebsd.org Sat Aug 29 00:56:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F26223C8D00; Sat, 29 Aug 2020 00:56:39 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BddMW5fqcz3Sjf; Sat, 29 Aug 2020 00:56:39 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3798DD62; Fri, 28 Aug 2020 20:56:38 -0400 (EDT) Received: from imap6 ([10.202.2.56]) by compute4.internal (MEProxy); Fri, 28 Aug 2020 20:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skunkwerks.at; h=mime-version:message-id:in-reply-to:references:date:from:to :cc:subject:content-type; s=fm3; bh=trFl0u5sLPAMoRyc+dhtAkadJE1f /G1twBoqufs9boA=; b=Jdd4MkhcxcYGz/3eZTU67lFUtHBIMFjmQ8VhdkFxYwOP tZ3l8MX/glaBIMXeYicd5Il1aJpJrKawAiSnjFn30gbhv00k35CZK8x/nFmP08ht Cu0JGV4Cti2YIAASvdFRMbvny7oDkFTn37mbRGNpNDUzA6WKw6e6KT67iA4iLz2Z gMhp2hOE47BGliht96mmjQxoaVNRzbW+CxDQDNnTBvbDQ3NZpJ0Yhfn3VMq5ZVaX EIUOt80MpSMt8QO3q3kFvuzu2xmR5btdiXMLd67WTRgLPAyuksObWS56+D/WqTL1 rAR/8tlqMrAI3UXs/iQC/fAXqi6unYhwekUmwkBwzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=trFl0u 5sLPAMoRyc+dhtAkadJE1f/G1twBoqufs9boA=; b=Chxc5bw5MMZOjIlZ3x3mG0 KYLX+WLOroKAaAO6NDqXY0WCjSBOJcp5cXWcCw0eA7CbD8VnIIfNEMQ7ChTZwEhw 2GM/3ThICQK2+5prgNzyhOylymjsyWAtkmWDVFbPNgeq2oBVWhQhfNHSVCJQoaJ9 KzB5Spr8g0PHCJ2ZLgEST+jvhl5CFbvtKTuzjmT63BnjLfB9JuAdDUlB0BYQ7fw2 CCoDXJIX3LuAHFc8UZzAGREuKeFyhyLbECfwjPiXw9yqSArIDnPrbVTk6yegBNi5 xiprdiY0yZ90EwXUqjQT8F/w3LPptzMG5PVFzHiyCzkptQsncJF5Ea74fBdMdn/A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeftddgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfffgrvhgvucevohhtthhlvghhuhgsvghrfdcuoegutghh sehskhhunhhkfigvrhhkshdrrghtqeenucggtffrrghtthgvrhhnpedvteeljefhveetie egfeeggeetjeeiffdufedviedvgfetieehgfeugffghfekheenucffohhmrghinhepfhhr vggvsghsugdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegutghhsehskhhunhhkfigvrhhkshdrrght X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C728B1400A1; Fri, 28 Aug 2020 20:56:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <98502308-cc22-4819-87be-2acccd71e0a4@www.fastmail.com> In-Reply-To: <202008281825.07SIPkBa029646@repo.freebsd.org> References: <202008281825.07SIPkBa029646@repo.freebsd.org> Date: Sat, 29 Aug 2020 00:56:16 +0000 From: "Dave Cottlehuber" To: "Emmanuel Vadot" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364927 - head/sys/arm/allwinner/clkng Content-Type: text/plain X-Rspamd-Queue-Id: 4BddMW5fqcz3Sjf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 00:56:40 -0000 On Fri, 28 Aug 2020, at 18:25, Emmanuel Vadot wrote: > Author: manu > Date: Fri Aug 28 18:25:45 2020 > New Revision: 364927 > URL: https://svnweb.freebsd.org/changeset/base/364927 > > Log: > arm: allwinner: clk: Add printfs when we cannot set the correct freq > > For some unknown reason this seems to fix this function when we printf > the best variable. This isn't a delay problem as doing a printf without > it doesn't solve this problem. > This is way above my pay grade so add some printf that shouldn't be printed > in 99% of the case anyway. > Fix booting on most Allwinner boards as the mmc IP uses a NM clock. > > Reported by: Alexander Mishin > MFC after: 3 days > X-MFC-With: 363887 > > Modified: > head/sys/arm/allwinner/clkng/aw_clk_nm.c > > Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c > ============================================================================== > --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Aug 28 17:55:54 2020 (r364926) > +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Aug 28 18:25:45 2020 (r364927) > @@ -221,11 +221,15 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare > if ((best < *fout) && > ((flags & CLK_SET_ROUND_DOWN) == 0)) { > *stop = 1; > + printf("best freq (%llu) < requested freq(%llu)\n", Salut Manu, Fails to build on aarch64 unless this is reverted, or I use printf("best freq (%lu) < requested freq(%lu)\n", > + best, *fout); > return (ERANGE); > } > if ((best > *fout) && > ((flags & CLK_SET_ROUND_UP) == 0)) { > *stop = 1; > + printf("best freq (%llu) > requested freq(%llu)\n", & again printf("best freq (%lu) > requested freq(%lu)\n", A+ Dave -------------------------------------------------------------- >>> stage 3.1: building everything -------------------------------------------------------------- /usr/src/sys/arm/allwinner/clkng/aw_clk_nm.c:225:7: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] best, *fout); ^~~~ /usr/src/sys/arm/allwinner/clkng/aw_clk_nm.c:225:13: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] best, *fout); ^~~~~ /usr/src/sys/arm/allwinner/clkng/aw_clk_nm.c:232:7: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] best, *fout); ^~~~ /usr/src/sys/arm/allwinner/clkng/aw_clk_nm.c:232:13: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] best, *fout); ^~~~~ 4 errors generated. --- aw_clk_nm.o --- *** [aw_clk_nm.o] Error code 1 From owner-svn-src-head@freebsd.org Sat Aug 29 02:46:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BECC3CB449; Sat, 29 Aug 2020 02:46:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdgpB3W3Tz3Ytt; Sat, 29 Aug 2020 02:46:26 +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 5C7341EFE6; Sat, 29 Aug 2020 02:46:26 +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 07T2kQH1044664; Sat, 29 Aug 2020 02:46:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T2kPiH044660; Sat, 29 Aug 2020 02:46:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008290246.07T2kPiH044660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 29 Aug 2020 02:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364943 - head/secure/caroot/trusted X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/secure/caroot/trusted X-SVN-Commit-Revision: 364943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 02:46:26 -0000 Author: kevans Date: Sat Aug 29 02:46:25 2020 New Revision: 364943 URL: https://svnweb.freebsd.org/changeset/base/364943 Log: carrot: update bundle Stats: - Seven (7) removed - Four (4) added MFC after: 3 days Added: head/secure/caroot/trusted/Microsoft_ECC_Root_Certificate_Authority_2017.pem (contents, props changed) head/secure/caroot/trusted/Microsoft_RSA_Root_Certificate_Authority_2017.pem (contents, props changed) head/secure/caroot/trusted/certSIGN_Root_CA_G2.pem (contents, props changed) head/secure/caroot/trusted/e-Szigno_Root_CA_2017.pem (contents, props changed) Deleted: head/secure/caroot/trusted/AddTrust_External_Root.pem head/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem head/secure/caroot/trusted/LuxTrust_Global_Root_2.pem head/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G2.pem head/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem head/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem head/secure/caroot/trusted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem Added: head/secure/caroot/trusted/Microsoft_ECC_Root_Certificate_Authority_2017.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Microsoft_ECC_Root_Certificate_Authority_2017.pem Sat Aug 29 02:46:25 2020 (r364943) @@ -0,0 +1,68 @@ +## +## Microsoft ECC Root Certificate Authority 2017 +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 66:f2:3d:af:87:de:8b:b1:4a:ea:0c:57:31:01:c2:ec + Signature Algorithm: ecdsa-with-SHA384 + Issuer: C = US, O = Microsoft Corporation, CN = Microsoft ECC Root Certificate Authority 2017 + Validity + Not Before: Dec 18 23:06:45 2019 GMT + Not After : Jul 18 23:16:04 2042 GMT + Subject: C = US, O = Microsoft Corporation, CN = Microsoft ECC Root Certificate Authority 2017 + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (384 bit) + pub: + 04:d4:bc:3d:02:42:75:41:13:23:cd:80:04:86:02: + 51:2f:6a:a8:81:62:0b:65:cc:f6:ca:9d:1e:6f:4a: + 66:51:a2:03:d9:9d:91:fa:b6:16:b1:8c:6e:de:7c: + cd:db:79:a6:2f:ce:bb:ce:71:2f:e5:a5:ab:28:ec: + 63:04:66:99:f8:fa:f2:93:10:05:e1:81:28:42:e3: + c6:68:f4:e6:1b:84:60:4a:89:af:ed:79:0f:3b:ce: + f1:f6:44:f5:01:78:c0 + ASN1 OID: secp384r1 + NIST CURVE: P-384 + X509v3 extensions: + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + C8:CB:99:72:70:52:0C:F8:E6:BE:B2:04:57:29:2A:CF:42:10:ED:35 + 1.3.6.1.4.1.311.21.1: + ... + Signature Algorithm: ecdsa-with-SHA384 + 30:65:02:30:58:f2:4d:ea:0c:f9:5f:5e:ee:60:29:cb:3a:f2: + db:d6:32:84:19:3f:7c:d5:2f:c2:b1:cc:93:ae:50:bb:09:32: + c6:c6:ed:7e:c9:36:94:12:e4:68:85:06:a2:1b:d0:2f:02:31: + 00:99:e9:16:b4:0e:fa:56:48:d4:a4:30:16:91:78:db:54:8c: + 65:01:8a:e7:50:66:c2:31:b7:39:ba:b8:1a:22:07:4e:fc:6b: + 54:16:20:ff:2b:b5:e7:4c:0c:4d:a6:4f:73 +SHA1 Fingerprint=99:9A:64:C3:7F:F4:7D:9F:AB:95:F1:47:69:89:14:60:EE:C4:C3:C5 +-----BEGIN CERTIFICATE----- +MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQsw +CQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYD +VQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIw +MTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4MjMxNjA0WjBlMQswCQYDVQQGEwJV +UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNy +b3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZR +ogPZnZH6thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYb +hGBKia/teQ87zvH2RPUBeMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBTIy5lycFIM+Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3 +FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlfXu5gKcs68tvWMoQZP3zV +L8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaReNtUjGUB +iudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/Microsoft_RSA_Root_Certificate_Authority_2017.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Microsoft_RSA_Root_Certificate_Authority_2017.pem Sat Aug 29 02:46:25 2020 (r364943) @@ -0,0 +1,136 @@ +## +## Microsoft RSA Root Certificate Authority 2017 +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 1e:d3:97:09:5f:d8:b4:b3:47:70:1e:aa:be:7f:45:b3 + Signature Algorithm: sha384WithRSAEncryption + Issuer: C = US, O = Microsoft Corporation, CN = Microsoft RSA Root Certificate Authority 2017 + Validity + Not Before: Dec 18 22:51:22 2019 GMT + Not After : Jul 18 23:00:23 2042 GMT + Subject: C = US, O = Microsoft Corporation, CN = Microsoft RSA Root Certificate Authority 2017 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:ca:5b:be:94:33:8c:29:95:91:16:0a:95:bd:47: + 62:c1:89:f3:99:36:df:46:90:c9:a5:ed:78:6a:6f: + 47:91:68:f8:27:67:50:33:1d:a1:a6:fb:e0:e5:43: + a3:84:02:57:01:5d:9c:48:40:82:53:10:bc:bf:c7: + 3b:68:90:b6:82:2d:e5:f4:65:d0:cc:6d:19:cc:95: + f9:7b:ac:4a:94:ad:0e:de:4b:43:1d:87:07:92:13: + 90:80:83:64:35:39:04:fc:e5:e9:6c:b3:b6:1f:50: + 94:38:65:50:5c:17:46:b9:b6:85:b5:1c:b5:17:e8: + d6:45:9d:d8:b2:26:b0:ca:c4:70:4a:ae:60:a4:dd: + b3:d9:ec:fc:3b:d5:57:72:bc:3f:c8:c9:b2:de:4b: + 6b:f8:23:6c:03:c0:05:bd:95:c7:cd:73:3b:66:80: + 64:e3:1a:ac:2e:f9:47:05:f2:06:b6:9b:73:f5:78: + 33:5b:c7:a1:fb:27:2a:a1:b4:9a:91:8c:91:d3:3a: + 82:3e:76:40:b4:cd:52:61:51:70:28:3f:c5:c5:5a: + f2:c9:8c:49:bb:14:5b:4d:c8:ff:67:4d:4c:12:96: + ad:f5:fe:78:a8:97:87:d7:fd:5e:20:80:dc:a1:4b: + 22:fb:d4:89:ad:ba:ce:47:97:47:55:7b:8f:45:c8: + 67:28:84:95:1c:68:30:ef:ef:49:e0:35:7b:64:e7: + 98:b0:94:da:4d:85:3b:3e:55:c4:28:af:57:f3:9e: + 13:db:46:27:9f:1e:a2:5e:44:83:a4:a5:ca:d5:13: + b3:4b:3f:c4:e3:c2:e6:86:61:a4:52:30:b9:7a:20: + 4f:6f:0f:38:53:cb:33:0c:13:2b:8f:d6:9a:bd:2a: + c8:2d:b1:1c:7d:4b:51:ca:47:d1:48:27:72:5d:87: + eb:d5:45:e6:48:65:9d:af:52:90:ba:5b:a2:18:65: + 57:12:9f:68:b9:d4:15:6b:94:c4:69:22:98:f4:33: + e0:ed:f9:51:8e:41:50:c9:34:4f:76:90:ac:fc:38: + c1:d8:e1:7b:b9:e3:e3:94:e1:46:69:cb:0e:0a:50: + 6b:13:ba:ac:0f:37:5a:b7:12:b5:90:81:1e:56:ae: + 57:22:86:d9:c9:d2:d1:d7:51:e3:ab:3b:c6:55:fd: + 1e:0e:d3:74:0a:d1:da:aa:ea:69:b8:97:28:8f:48: + c4:07:f8:52:43:3a:f4:ca:55:35:2c:b0:a6:6a:c0: + 9c:f9:f2:81:e1:12:6a:c0:45:d9:67:b3:ce:ff:23: + a2:89:0a:54:d4:14:b9:2a:a8:d7:ec:f9:ab:cd:25: + 58:32:79:8f:90:5b:98:39:c4:08:06:c1:ac:7f:0e: + 3d:00:a5 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: critical + Digital Signature, Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 09:CB:59:7F:86:B2:70:8F:1A:C3:39:E3:C0:D9:E9:BF:BB:4D:B2:23 + 1.3.6.1.4.1.311.21.1: + ... + Signature Algorithm: sha384WithRSAEncryption + ac:af:3e:5d:c2:11:96:89:8e:a3:e7:92:d6:97:15:b8:13:a2: + a6:42:2e:02:cd:16:05:59:27:ca:20:e8:ba:b8:e8:1a:ec:4d: + a8:97:56:ae:65:43:b1:8f:00:9b:52:cd:55:cd:53:39:6d:62: + 4c:8b:0d:5b:7c:2e:44:bf:83:10:8f:f3:53:82:80:c3:4f:3a: + c7:6e:11:3f:e6:e3:16:91:84:fb:6d:84:7f:34:74:ad:89:a7: + ce:b9:d7:d7:9f:84:64:92:be:95:a1:ad:09:53:33:dd:ee:0a: + ea:4a:51:8e:6f:55:ab:ba:b5:94:46:ae:8c:7f:d8:a2:50:25: + 65:60:80:46:db:33:04:ae:6c:b5:98:74:54:25:dc:93:e4:f8: + e3:55:15:3d:b8:6d:c3:0a:a4:12:c1:69:85:6e:df:64:f1:53: + 99:e1:4a:75:20:9d:95:0f:e4:d6:dc:03:f1:59:18:e8:47:89: + b2:57:5a:94:b6:a9:d8:17:2b:17:49:e5:76:cb:c1:56:99:3a: + 37:b1:ff:69:2c:91:91:93:e1:df:4c:a3:37:76:4d:a1:9f:f8: + 6d:1e:1d:d3:fa:ec:fb:f4:45:1d:13:6d:cf:f7:59:e5:22:27: + 72:2b:86:f3:57:bb:30:ed:24:4d:dc:7d:56:bb:a3:b3:f8:34: + 79:89:c1:e0:f2:02:61:f7:a6:fc:0f:bb:1c:17:0b:ae:41:d9: + 7c:bd:27:a3:fd:2e:3a:d1:93:94:b1:73:1d:24:8b:af:5b:20: + 89:ad:b7:67:66:79:f5:3a:c6:a6:96:33:fe:53:92:c8:46:b1: + 11:91:c6:99:7f:8f:c9:d6:66:31:20:41:10:87:2d:0c:d6:c1: + af:34:98:ca:64:83:fb:13:57:d1:c1:f0:3c:7a:8c:a5:c1:fd: + 95:21:a0:71:c1:93:67:71:12:ea:8f:88:0a:69:19:64:99:23: + 56:fb:ac:2a:2e:70:be:66:c4:0c:84:ef:e5:8b:f3:93:01:f8: + 6a:90:93:67:4b:b2:68:a3:b5:62:8f:e9:3f:8c:7a:3b:5e:0f: + e7:8c:b8:c6:7c:ef:37:fd:74:e2:c8:4f:33:72:e1:94:39:6d: + bd:12:af:be:0c:4e:70:7c:1b:6f:8d:b3:32:93:73:44:16:6d: + e8:f4:f7:e0:95:80:8f:96:5d:38:a4:f4:ab:de:0a:30:87:93: + d8:4d:00:71:62:45:27:4b:3a:42:84:5b:7f:65:b7:67:34:52: + 2d:9c:16:6b:aa:a8:d8:7b:a3:42:4c:71:c7:0c:ca:3e:83:e4: + a6:ef:b7:01:30:5e:51:a3:79:f5:70:69:a6:41:44:0f:86:b0: + 2c:91:c6:3d:ea:ae:0f:84 +SHA1 Fingerprint=73:A5:E6:4A:3B:FF:83:16:FF:0E:DC:CC:61:8A:90:6E:4E:AE:4D:74 +-----BEGIN CERTIFICATE----- +MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qvn9FszANBgkqhkiG9w0BAQwFADBl +MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw +NAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +IDIwMTcwHhcNMTkxMjE4MjI1MTIyWhcNNDIwNzE4MjMwMDIzWjBlMQswCQYDVQQG +EwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1N +aWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKW76UM4wplZEWCpW9R2LBifOZ +Nt9GkMml7Xhqb0eRaPgnZ1AzHaGm++DlQ6OEAlcBXZxIQIJTELy/xztokLaCLeX0 +ZdDMbRnMlfl7rEqUrQ7eS0MdhweSE5CAg2Q1OQT85elss7YfUJQ4ZVBcF0a5toW1 +HLUX6NZFndiyJrDKxHBKrmCk3bPZ7Pw71VdyvD/IybLeS2v4I2wDwAW9lcfNcztm +gGTjGqwu+UcF8ga2m3P1eDNbx6H7JyqhtJqRjJHTOoI+dkC0zVJhUXAoP8XFWvLJ +jEm7FFtNyP9nTUwSlq31/niol4fX/V4ggNyhSyL71Imtus5Hl0dVe49FyGcohJUc +aDDv70ngNXtk55iwlNpNhTs+VcQor1fznhPbRiefHqJeRIOkpcrVE7NLP8TjwuaG +YaRSMLl6IE9vDzhTyzMMEyuP1pq9KsgtsRx9S1HKR9FIJ3Jdh+vVReZIZZ2vUpC6 +W6IYZVcSn2i51BVrlMRpIpj0M+Dt+VGOQVDJNE92kKz8OMHY4Xu54+OU4UZpyw4K +UGsTuqwPN1q3ErWQgR5WrlcihtnJ0tHXUeOrO8ZV/R4O03QK0dqq6mm4lyiPSMQH ++FJDOvTKVTUssKZqwJz58oHhEmrARdlns87/I6KJClTUFLkqqNfs+avNJVgyeY+Q +W5g5xAgGwax/Dj0ApQIDAQABo1QwUjAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUCctZf4aycI8awznjwNnpv7tNsiMwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEMBQADggIBAKyvPl3CEZaJjqPnktaXFbgToqZC +LgLNFgVZJ8og6Lq46BrsTaiXVq5lQ7GPAJtSzVXNUzltYkyLDVt8LkS/gxCP81OC +gMNPOsduET/m4xaRhPtthH80dK2Jp86519efhGSSvpWhrQlTM93uCupKUY5vVau6 +tZRGrox/2KJQJWVggEbbMwSubLWYdFQl3JPk+ONVFT24bcMKpBLBaYVu32TxU5nh +SnUgnZUP5NbcA/FZGOhHibJXWpS2qdgXKxdJ5XbLwVaZOjex/2kskZGT4d9Mozd2 +TaGf+G0eHdP67Pv0RR0Tbc/3WeUiJ3IrhvNXuzDtJE3cfVa7o7P4NHmJweDyAmH3 +pvwPuxwXC65B2Xy9J6P9LjrRk5Sxcx0ki69bIImtt2dmefU6xqaWM/5TkshGsRGR +xpl/j8nWZjEgQRCHLQzWwa80mMpkg/sTV9HB8Dx6jKXB/ZUhoHHBk2dxEuqPiApp +GWSZI1b7rCoucL5mxAyE7+WL85MB+GqQk2dLsmijtWKP6T+MejteD+eMuMZ87zf9 +dOLITzNy4ZQ5bb0Sr74MTnB8G2+NszKTc0QWbej09+CVgI+WXTik9KveCjCHk9hN +AHFiRSdLOkKEW39lt2c0Ui2cFmuqqNh7o0JMcccMyj6D5KbvtwEwXlGjefVwaaZB +RA+GsCyRxj3qrg+E +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/certSIGN_Root_CA_G2.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/certSIGN_Root_CA_G2.pem Sat Aug 29 02:46:25 2020 (r364943) @@ -0,0 +1,132 @@ +## +## certSIGN Root CA G2 +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 11:00:34:b6:4e:c6:36:2d:36 + Signature Algorithm: sha256WithRSAEncryption + Issuer: C = RO, O = CERTSIGN SA, OU = certSIGN ROOT CA G2 + Validity + Not Before: Feb 6 09:27:35 2017 GMT + Not After : Feb 6 09:27:35 2042 GMT + Subject: C = RO, O = CERTSIGN SA, OU = certSIGN ROOT CA G2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:c0:c5:75:19:91:7d:44:74:74:87:fe:0e:3b:96: + dc:d8:01:16:cc:ee:63:91:e7:0b:6f:ce:3b:0a:69: + 1a:7c:c2:e3:af:82:8e:86:d7:5e:8f:57:eb:d3:21: + 59:fd:39:37:42:30:be:50:ea:b6:0f:a9:88:d8:2e: + 2d:69:21:e7:d1:37:18:4e:7d:91:d5:16:5f:6b:5b: + 00:c2:39:43:0d:36:85:52:b9:53:65:0f:1d:42:e5: + 8f:cf:05:d3:ee:dc:0c:1a:d9:b8:8b:78:22:67:e4: + 69:b0:68:c5:3c:e4:6c:5a:46:e7:cd:c7:fa:ef:c4: + ec:4b:bd:6a:a4:ac:fd:cc:28:51:ef:92:b4:29:ab: + ab:35:9a:4c:e4:c4:08:c6:26:cc:f8:69:9f:e4:9c: + f0:29:d3:5c:f9:c6:16:25:9e:23:c3:20:c1:3d:0f: + 3f:38:40:b0:fe:82:44:38:aa:5a:1a:8a:6b:63:58: + 38:b4:15:d3:b6:11:69:7b:1e:54:ee:8c:1a:22:ac: + 72:97:3f:23:59:9b:c9:22:84:c1:07:4f:cc:7f:e2: + 57:ca:12:70:bb:a6:65:f3:69:75:63:bd:95:fb:1b: + 97:cd:e4:a8:af:f6:d1:4e:a8:d9:8a:71:24:cd:36: + 3d:bc:96:c4:f1:6c:a9:ae:e5:cf:0d:6e:28:0d:b0: + 0e:b5:ca:51:7b:78:14:c3:20:2f:7f:fb:14:55:e1: + 11:99:fd:d5:0a:a1:9e:02:e3:62:5f:eb:35:4b:2c: + b8:72:e8:3e:3d:4f:ac:2c:bb:2e:86:e2:a3:76:8f: + e5:93:2a:cf:a5:ab:c8:5c:8d:4b:06:ff:12:46:ac: + 78:cb:14:07:35:e0:a9:df:8b:e9:af:15:4f:16:89: + 5b:bd:f6:8d:c6:59:ae:88:85:0e:c1:89:eb:1f:67: + c5:45:8e:ff:6d:37:36:2b:78:66:83:91:51:2b:3d: + ff:51:77:76:62:a1:ec:67:3e:3e:81:83:e0:56:a9: + 50:1f:1f:7a:99:ab:63:bf:84:17:77:f1:0d:3b:df: + f7:9c:61:b3:35:98:8a:3a:b2:ec:3c:1a:37:3f:7e: + 8f:92:cf:d9:12:14:64:da:10:02:15:41:ff:4f:c4: + eb:1c:a3:c9:fa:99:f7:46:e9:e1:18:d9:b1:b8:32: + 2d:cb:14:0c:50:d8:83:65:83:ee:b9:5c:cf:cb:05: + 5a:4c:fa:19:97:6b:d6:5d:13:d3:c2:5c:54:bc:32: + 73:a0:78:f5:f1:6d:1e:cb:9f:a5:a6:9f:22:dc:d1: + 51:9e:82:79:64:60:29:13:3e:a3:fd:4f:72:6a:ab: + e2:d4:e5:b8:24:55:2c:44:4b:8a:88:44:9c:ca:84: + d3:2a:3b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 82:21:2D:66:C6:D7:A0:E0:15:EB:CE:4C:09:77:C4:60:9E:54:6E:03 + Signature Algorithm: sha256WithRSAEncryption + 60:de:1a:b8:e7:f2:60:82:d5:03:33:81:cb:06:8a:f1:22:49: + e9:e8:ea:91:7f:c6:33:5e:68:19:03:86:3b:43:01:cf:07:70: + e4:08:1e:65:85:91:e6:11:22:b7:f5:02:23:8e:ae:b9:1e:7d: + 1f:7e:6c:e6:bd:25:d5:95:1a:f2:05:a6:af:85:02:6f:ae:f8: + d6:31:ff:25:c9:4a:c8:c7:8a:a9:d9:9f:4b:49:9b:11:57:99: + 92:43:11:de:b6:33:a4:cc:d7:8d:64:7d:d4:cd:3c:28:2c:b4: + 9a:96:ea:4d:f5:c4:44:c4:25:aa:20:80:d8:29:55:f7:e0:41: + fc:06:26:ff:b9:36:f5:43:14:03:66:78:e1:11:b1:da:20:5f: + 46:00:78:00:21:a5:1e:00:28:61:78:6f:a8:01:01:8f:9d:34: + 9a:ff:f4:38:90:fb:b8:d1:b3:72:06:c9:71:e6:81:c5:79:ed: + 0b:a6:79:f2:13:0b:9c:f7:5d:0e:7b:24:93:b4:48:db:86:5f: + de:50:86:78:e7:40:e6:31:a8:90:76:70:61:af:9c:37:2c:11: + b5:82:b7:aa:ae:24:34:5b:72:0c:69:0d:cd:59:9f:f6:71:af: + 9c:0b:d1:0a:38:f9:06:22:83:53:25:0c:fc:51:c4:e6:be:e2: + 39:95:0b:24:ad:af:d1:95:e4:96:d7:74:64:6b:71:4e:02:3c: + aa:85:f3:20:a3:43:39:76:5b:6c:50:fe:9a:9c:14:1e:65:14: + 8a:15:bd:a3:82:45:5a:49:56:6a:d2:9c:b1:63:32:e5:61:e0: + 53:22:0e:a7:0a:49:ea:cb:7e:1f:a8:e2:62:80:f6:10:45:52: + 98:06:18:de:a5:cd:2f:7f:aa:d4:e9:3e:08:72:ec:23:03:02: + 3c:a6:aa:d8:bc:67:74:3d:14:17:fb:54:4b:17:e3:d3:79:3d: + 6d:6b:49:c9:28:0e:2e:74:50:bf:0c:d9:46:3a:10:86:c9:a7: + 3f:e9:a0:ec:7f:eb:a5:77:58:69:71:e6:83:0a:37:f2:86:49: + 6a:be:79:08:90:f6:02:16:64:3e:e5:da:4c:7e:0c:34:c9:f9: + 5f:b6:b3:28:51:a7:a7:2b:aa:49:fa:8d:65:29:4e:e3:6b:13: + a7:94:a3:2d:51:6d:78:0c:44:cb:df:de:08:6f:ce:a3:64:ab: + d3:95:84:d4:b9:52:54:72:7b:96:25:cc:bc:69:e3:48:6e:0d: + d0:c7:9d:27:9a:aa:f8:13:92:dd:1e:df:63:9f:35:a9:16:36: + ec:8c:b8:83:f4:3d:89:8f:cd:b4:17:5e:d7:b3:17:41:10:5d: + 27:73:60:85:57:49:22:07 +SHA1 Fingerprint=26:F9:93:B4:ED:3D:28:27:B0:B9:4B:A7:E9:15:1D:A3:8D:92:E5:32 +-----BEGIN CERTIFICATE----- +MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNV +BAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04g +Uk9PVCBDQSBHMjAeFw0xNzAyMDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJ +BgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJ +R04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDF +dRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+CjobXXo9X69MhWf05N0Iw +vlDqtg+piNguLWkh59E3GE59kdUWX2tbAMI5Qw02hVK5U2UPHULlj88F0+7cDBrZ +uIt4ImfkabBoxTzkbFpG583H+u/E7Eu9aqSs/cwoUe+StCmrqzWaTOTECMYmzPhp +n+Sc8CnTXPnGFiWeI8MgwT0PPzhAsP6CRDiqWhqKa2NYOLQV07YRaXseVO6MGiKs +cpc/I1mbySKEwQdPzH/iV8oScLumZfNpdWO9lfsbl83kqK/20U6o2YpxJM02PbyW +xPFsqa7lzw1uKA2wDrXKUXt4FMMgL3/7FFXhEZn91QqhngLjYl/rNUssuHLoPj1P +rCy7Lobio3aP5ZMqz6WryFyNSwb/EkaseMsUBzXgqd+L6a8VTxaJW732jcZZroiF +DsGJ6x9nxUWO/203Nit4ZoORUSs9/1F3dmKh7Gc+PoGD4FapUB8fepmrY7+EF3fx +DTvf95xhszWYijqy7DwaNz9+j5LP2RIUZNoQAhVB/0/E6xyjyfqZ90bp4RjZsbgy +LcsUDFDYg2WD7rlcz8sFWkz6GZdr1l0T08JcVLwyc6B49fFtHsufpaafItzRUZ6C +eWRgKRM+o/1Pcmqr4tTluCRVLERLiohEnMqE0yo7AgMBAAGjQjBAMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSCIS1mxteg4BXrzkwJ +d8RgnlRuAzANBgkqhkiG9w0BAQsFAAOCAgEAYN4auOfyYILVAzOBywaK8SJJ6ejq +kX/GM15oGQOGO0MBzwdw5AgeZYWR5hEit/UCI46uuR59H35s5r0l1ZUa8gWmr4UC +b6741jH/JclKyMeKqdmfS0mbEVeZkkMR3rYzpMzXjWR91M08KCy0mpbqTfXERMQl +qiCA2ClV9+BB/AYm/7k29UMUA2Z44RGx2iBfRgB4ACGlHgAoYXhvqAEBj500mv/0 +OJD7uNGzcgbJceaBxXntC6Z58hMLnPddDnskk7RI24Zf3lCGeOdA5jGokHZwYa+c +NywRtYK3qq4kNFtyDGkNzVmf9nGvnAvRCjj5BiKDUyUM/FHE5r7iOZULJK2v0ZXk +ltd0ZGtxTgI8qoXzIKNDOXZbbFD+mpwUHmUUihW9o4JFWklWatKcsWMy5WHgUyIO +pwpJ6st+H6jiYoD2EEVSmAYY3qXNL3+q1Ok+CHLsIwMCPKaq2LxndD0UF/tUSxfj +03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZk +PuXaTH4MNMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE +1LlSVHJ7liXMvGnjSG4N0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MX +QRBdJ3NghVdJIgc= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/e-Szigno_Root_CA_2017.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/e-Szigno_Root_CA_2017.pem Sat Aug 29 02:46:25 2020 (r364943) @@ -0,0 +1,65 @@ +## +## e-Szigno Root CA 2017 +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 01:54:48:ef:21:fd:97:59:0d:f5:04:0a + Signature Algorithm: ecdsa-with-SHA256 + Issuer: C = HU, L = Budapest, O = Microsec Ltd., organizationIdentifier = VATHU-23584497, CN = e-Szigno Root CA 2017 + Validity + Not Before: Aug 22 12:07:06 2017 GMT + Not After : Aug 22 12:07:06 2042 GMT + Subject: C = HU, L = Budapest, O = Microsec Ltd., organizationIdentifier = VATHU-23584497, CN = e-Szigno Root CA 2017 + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:96:dc:3d:8a:d8:b0:7b:6f:c6:27:be:44:90:b1: + b3:56:15:7b:8e:43:24:7d:1a:84:59:ee:63:68:b2: + c6:5e:87:d0:15:48:1e:a8:90:ad:bd:53:a2:da:de: + 3a:90:a6:60:5f:68:32:b5:86:41:df:87:5b:2c:7b: + c5:fe:7c:7a:da + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 87:11:15:08:D1:AA:C1:78:0C:B1:AF:CE:C6:C9:90:EF:BF:30:04:C0 + X509v3 Authority Key Identifier: + keyid:87:11:15:08:D1:AA:C1:78:0C:B1:AF:CE:C6:C9:90:EF:BF:30:04:C0 + + Signature Algorithm: ecdsa-with-SHA256 + 30:46:02:21:00:b5:57:dd:d7:8a:55:0b:36:e1:86:44:fa:d4: + d9:68:8d:b8:dc:23:8a:8a:0d:d4:2f:7d:ea:73:ec:bf:4d:6c: + a8:02:21:00:cb:a5:b4:12:fa:e7:b5:e8:cf:7e:93:fc:f3:35: + 8f:6f:4e:5a:7c:b4:bc:4e:b2:fc:72:aa:5b:59:f9:e7:dc:31 +SHA1 Fingerprint=89:D4:83:03:4F:9E:9A:48:80:5F:72:37:D4:A9:A6:EF:CB:7C:1F:D1 +-----BEGIN CERTIFICATE----- +MIICQDCCAeWgAwIBAgIMAVRI7yH9l1kN9QQKMAoGCCqGSM49BAMCMHExCzAJBgNV +BAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMgTHRk +LjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25vIFJv +b3QgQ0EgMjAxNzAeFw0xNzA4MjIxMjA3MDZaFw00MjA4MjIxMjA3MDZaMHExCzAJ +BgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMg +THRkLjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25v +IFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtv +xie+RJCxs1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+H +Wyx7xf58etqjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBSHERUI0arBeAyxr87GyZDvvzAEwDAfBgNVHSMEGDAWgBSHERUI0arB +eAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEAtVfd14pVCzbhhkT61Nlo +jbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxOsvxyqltZ ++efcMQ== +-----END CERTIFICATE----- From owner-svn-src-head@freebsd.org Sat Aug 29 04:29:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31D423CCB97; Sat, 29 Aug 2020 04:29:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdk5Z0PzZz3dwr; Sat, 29 Aug 2020 04:29:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E675520411; Sat, 29 Aug 2020 04:29:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07T4Trvc007765; Sat, 29 Aug 2020 04:29:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T4TrbH007764; Sat, 29 Aug 2020 04:29:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008290429.07T4TrbH007764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 04:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364944 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 04:29:54 -0000 Author: imp Date: Sat Aug 29 04:29:53 2020 New Revision: 364944 URL: https://svnweb.freebsd.org/changeset/base/364944 Log: devctl: move to using a uma zone Convert the memory management of devctl. Rewrite if to make better use of memory. This eliminates several mallocs (5? worse case) needed to send a message. It's now possible to always send a message, though if things are really backed up the oldest message will be dropped to free up space for the newest. Add a static bus_child_{location,pnpinfo}_sb to start migrating to sbuf instead of buffer + length. Use it in the new code. Other code will be converted later (bus_child_*_str is only used inside of subr_bus.c, though implemented in ~100 places in the tree). Reviewed by: markj@ Differential Revision: https://reviews.freebsd.org/D26140 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 02:46:25 2020 (r364943) +++ head/sys/kern/subr_bus.c Sat Aug 29 04:29:53 2020 (r364944) @@ -156,6 +156,8 @@ EVENTHANDLER_LIST_DEFINE(device_attach); EVENTHANDLER_LIST_DEFINE(device_detach); EVENTHANDLER_LIST_DEFINE(dev_lookup); +static int bus_child_location_sb(device_t child, struct sbuf *sb); +static int bus_child_pnpinfo_sb(device_t child, struct sbuf *sb); static void devctl2_init(void); static bool device_frozen; @@ -392,9 +394,10 @@ static struct cdevsw dev_cdevsw = { .d_name = "devctl", }; +#define DEVCTL_BUFFER (1024 - sizeof(void *)) struct dev_event_info { - char *dei_data; STAILQ_ENTRY(dev_event_info) dei_link; + char dei_data[DEVCTL_BUFFER]; }; STAILQ_HEAD(devq, dev_event_info); @@ -409,6 +412,7 @@ static struct dev_softc { struct selinfo sel; struct devq devq; struct sigio *sigio; + uma_zone_t zone; } devsoftc; static void filt_devctl_detach(struct knote *kn); @@ -431,6 +435,11 @@ devinit(void) cv_init(&devsoftc.cv, "dev cv"); STAILQ_INIT(&devsoftc.devq); knlist_init_mtx(&devsoftc.sel.si_note, &devsoftc.mtx); + if (devctl_queue_length > 0) { + devsoftc.zone = uma_zcreate("DEVCTL", sizeof(struct dev_event_info), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_prealloc(devsoftc.zone, devctl_queue_length); + } devctl2_init(); } @@ -495,8 +504,7 @@ devread(struct cdev *dev, struct uio *uio, int ioflag) devsoftc.queued--; mtx_unlock(&devsoftc.mtx); rv = uiomove(n1->dei_data, strlen(n1->dei_data), uio); - free(n1->dei_data, M_BUS); - free(n1, M_BUS); + uma_zfree(devsoftc.zone, n1); return (rv); } @@ -585,42 +593,51 @@ devctl_process_running(void) return (devsoftc.inuse == 1); } -/** - * @brief Queue data to be read from the devctl device - * - * Generic interface to queue data to the devctl device. It is - * assumed that @p data is properly formatted. It is further assumed - * that @p data is allocated using the M_BUS malloc type. - */ -static void -devctl_queue_data_f(char *data, int flags) +static struct dev_event_info * +devctl_alloc_dei(void) { - struct dev_event_info *n1 = NULL, *n2 = NULL; + struct dev_event_info *dei = NULL; - if (strlen(data) == 0) - goto out; + mtx_lock(&devsoftc.mtx); if (devctl_queue_length == 0) goto out; - n1 = malloc(sizeof(*n1), M_BUS, flags); - if (n1 == NULL) - goto out; - n1->dei_data = data; - mtx_lock(&devsoftc.mtx); - if (devctl_queue_length == 0) { - mtx_unlock(&devsoftc.mtx); - free(n1->dei_data, M_BUS); - free(n1, M_BUS); - return; - } - /* Leave at least one spot in the queue... */ - while (devsoftc.queued > devctl_queue_length - 1) { - n2 = STAILQ_FIRST(&devsoftc.devq); + if (devctl_queue_length == devsoftc.queued) { + dei = STAILQ_FIRST(&devsoftc.devq); STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link); - free(n2->dei_data, M_BUS); - free(n2, M_BUS); devsoftc.queued--; + } else { + /* dei can't be NULL -- we know we have at least one in the zone */ + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); + MPASS(dei != NULL); } - STAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link); + *dei->dei_data = '\0'; +out: + mtx_unlock(&devsoftc.mtx); + return (dei); +} + +static struct dev_event_info * +devctl_alloc_dei_sb(struct sbuf *sb) +{ + struct dev_event_info *dei; + + dei = devctl_alloc_dei(); + if (dei != NULL) + sbuf_new(sb, dei->dei_data, sizeof(dei->dei_data), SBUF_FIXEDLEN); + return (dei); +} + +static void +devctl_free_dei(struct dev_event_info *dei) +{ + uma_zfree(devsoftc.zone, dei); +} + +static void +devctl_queue(struct dev_event_info *dei) +{ + mtx_lock(&devsoftc.mtx); + STAILQ_INSERT_TAIL(&devsoftc.devq, dei, dei_link); devsoftc.queued++; cv_broadcast(&devsoftc.cv); KNOTE_LOCKED(&devsoftc.sel.si_note, 0); @@ -628,55 +645,38 @@ devctl_queue_data_f(char *data, int flags) selwakeup(&devsoftc.sel); if (devsoftc.async && devsoftc.sigio != NULL) pgsigio(&devsoftc.sigio, SIGIO, 0); - return; -out: - /* - * We have to free data on all error paths since the caller - * assumes it will be free'd when this item is dequeued. - */ - free(data, M_BUS); - return; } -static void -devctl_queue_data(char *data) -{ - devctl_queue_data_f(data, M_NOWAIT); -} - /** * @brief Send a 'notification' to userland, using standard ways */ void devctl_notify_f(const char *system, const char *subsystem, const char *type, - const char *data, int flags) + const char *data, int flags __unused) { - int len = 0; - char *msg; + struct dev_event_info *dei; + struct sbuf sb; - if (system == NULL) - return; /* BOGUS! Must specify system. */ - if (subsystem == NULL) - return; /* BOGUS! Must specify subsystem. */ - if (type == NULL) - return; /* BOGUS! Must specify type. */ - len += strlen(" system=") + strlen(system); - len += strlen(" subsystem=") + strlen(subsystem); - len += strlen(" type=") + strlen(type); - /* add in the data message plus newline. */ - if (data != NULL) - len += strlen(data); - len += 3; /* '!', '\n', and NUL */ - msg = malloc(len, M_BUS, flags); - if (msg == NULL) - return; /* Drop it on the floor */ - if (data != NULL) - snprintf(msg, len, "!system=%s subsystem=%s type=%s %s\n", - system, subsystem, type, data); + if (system == NULL || subsystem == NULL || type == NULL) + return; + dei = devctl_alloc_dei_sb(&sb); + if (dei == NULL) + return; + sbuf_cpy(&sb, "!system="); + sbuf_cat(&sb, system); + sbuf_cat(&sb, " subsystem="); + sbuf_cat(&sb, subsystem); + sbuf_cat(&sb, " type="); + sbuf_cat(&sb, type); + if (data != NULL) { + sbuf_putc(&sb, ' '); + sbuf_cat(&sb, data); + } + sbuf_putc(&sb, '\n'); + if (sbuf_finish(&sb) != 0) + devctl_free_dei(dei); /* overflow -> drop it */ else - snprintf(msg, len, "!system=%s subsystem=%s type=%s\n", - system, subsystem, type); - devctl_queue_data_f(msg, flags); + devctl_queue(dei); } void @@ -698,53 +698,46 @@ devctl_notify(const char *system, const char *subsyste * object of that event, plus the plug and play info and location info * for that event. This is likely most useful for devices, but less * useful for other consumers of this interface. Those should use - * the devctl_queue_data() interface instead. + * the devctl_notify() interface instead. + * + * Output: + * ${type}${what} at $(location dev) $(pnp-info dev) on $(parent dev) */ static void devaddq(const char *type, const char *what, device_t dev) { - char *data = NULL; - char *loc = NULL; - char *pnp = NULL; + struct dev_event_info *dei; const char *parstr; + struct sbuf sb; - if (!devctl_queue_length)/* Rare race, but lost races safely discard */ + dei = devctl_alloc_dei_sb(&sb); + if (dei == NULL) return; - data = malloc(1024, M_BUS, M_NOWAIT); - if (data == NULL) - goto bad; + sbuf_cpy(&sb, type); + sbuf_cat(&sb, what); + sbuf_cat(&sb, " at "); - /* get the bus specific location of this device */ - loc = malloc(1024, M_BUS, M_NOWAIT); - if (loc == NULL) - goto bad; - *loc = '\0'; - bus_child_location_str(dev, loc, 1024); + /* Add in the location */ + bus_child_location_sb(dev, &sb); + sbuf_putc(&sb, ' '); - /* Get the bus specific pnp info of this device */ - pnp = malloc(1024, M_BUS, M_NOWAIT); - if (pnp == NULL) - goto bad; - *pnp = '\0'; - bus_child_pnpinfo_str(dev, pnp, 1024); + /* Add in pnpinfo */ + bus_child_pnpinfo_sb(dev, &sb); /* Get the parent of this device, or / if high enough in the tree. */ if (device_get_parent(dev) == NULL) parstr = "."; /* Or '/' ? */ else parstr = device_get_nameunit(device_get_parent(dev)); - /* String it all together. */ - snprintf(data, 1024, "%s%s at %s %s on %s\n", type, what, loc, pnp, - parstr); - free(loc, M_BUS); - free(pnp, M_BUS); - devctl_queue_data(data); + sbuf_cat(&sb, " on "); + sbuf_cat(&sb, parstr); + sbuf_putc(&sb, '\n'); + if (sbuf_finish(&sb) != 0) + goto bad; + devctl_queue(dei); return; bad: - free(pnp, M_BUS); - free(loc, M_BUS); - free(data, M_BUS); - return; + devctl_free_dei(dei); } /* @@ -786,7 +779,6 @@ devnomatch(device_t dev) static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) { - struct dev_event_info *n1; int q, error; q = devctl_queue_length; @@ -795,18 +787,32 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) return (error); if (q < 0) return (EINVAL); - if (mtx_initialized(&devsoftc.mtx)) - mtx_lock(&devsoftc.mtx); - devctl_queue_length = q; - while (devsoftc.queued > devctl_queue_length) { - n1 = STAILQ_FIRST(&devsoftc.devq); - STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link); - free(n1->dei_data, M_BUS); - free(n1, M_BUS); - devsoftc.queued--; + + /* + * When set as a tunable, we've not yet initialized the mutex. + * It is safe to just assign to devctl_queue_length and return + * as we're racing no one. We'll use whatever value set in + * devinit. + */ + if (!mtx_initialized(&devsoftc.mtx)) { + devctl_queue_length = q; + return (0); } - if (mtx_initialized(&devsoftc.mtx)) - mtx_unlock(&devsoftc.mtx); + + /* + * XXX It's hard to grow or shrink the UMA zone. Only allow + * disabling the queue size for the moment until underlying + * UMA issues can be sorted out. + */ + if (q != 0) + return (EINVAL); + if (q == devctl_queue_length) + return (0); + mtx_lock(&devsoftc.mtx); + devctl_queue_length = 0; + uma_zdestroy(devsoftc.zone); + devsoftc.zone = 0; + mtx_unlock(&devsoftc.mtx); return (0); } @@ -4918,6 +4924,70 @@ bus_child_location_str(device_t child, char *buf, size } return (BUS_CHILD_LOCATION_STR(parent, child, buf, buflen)); } + +/** + * @brief Wrapper function for bus_child_pnpinfo_str using sbuf + * + * A convenient wrapper frunction for bus_child_pnpinfo_str that allows + * us to splat that into an sbuf. It uses unholy knowledge of sbuf to + * accomplish this, however. It is an interim function until we can convert + * this interface more fully. + */ +/* Note: we reach inside of sbuf because it's API isn't rich enough to do this */ +#define SPACE(s) ((s)->s_size - (s)->s_len) +#define EOB(s) ((s)->s_buf + (s)->s_len) + +static int +bus_child_pnpinfo_sb(device_t dev, struct sbuf *sb) +{ + char *p; + size_t space; + + MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0); + if (sb->s_error != 0) + return (-1); + p = EOB(sb); + *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ + space = SPACE(sb); + if (space <= 1) { + sb->s_error = ENOMEM; + return (-1); + } + bus_child_pnpinfo_str(dev, p, space); + sb->s_len += strlen(p); + return (0); +} + +/** + * @brief Wrapper function for bus_child_pnpinfo_str using sbuf + * + * A convenient wrapper frunction for bus_child_pnpinfo_str that allows + * us to splat that into an sbuf. It uses unholy knowledge of sbuf to + * accomplish this, however. It is an interim function until we can convert + * this interface more fully. + */ +static int +bus_child_location_sb(device_t dev, struct sbuf *sb) +{ + char *p; + size_t space; + + MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0); + if (sb->s_error != 0) + return (-1); + p = EOB(sb); + *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ + space = SPACE(sb); + if (space <= 1) { + sb->s_error = ENOMEM; + return (-1); + } + bus_child_location_str(dev, p, space); + sb->s_len += strlen(p); + return (0); +} +#undef SPACE +#undef EOB /** * @brief Wrapper function for BUS_GET_CPUS(). From owner-svn-src-head@freebsd.org Sat Aug 29 04:30:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A70A3CC26A; Sat, 29 Aug 2020 04:30:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdk5s0HtRz3dln; Sat, 29 Aug 2020 04:30:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20A741FC6F; Sat, 29 Aug 2020 04:30:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07T4U72D007877; Sat, 29 Aug 2020 04:30:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T4U6ZC007871; Sat, 29 Aug 2020 04:30:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008290430.07T4U6ZC007871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 04:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364945 - in head/sys: arm/ti/am335x geom kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/ti/am335x geom kern sys X-SVN-Commit-Revision: 364945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 04:30:09 -0000 Author: imp Date: Sat Aug 29 04:30:06 2020 New Revision: 364945 URL: https://svnweb.freebsd.org/changeset/base/364945 Log: Retire devctl_notify_f() devctl_notify_f isn't needed, so retire it. The flags argument is now unused, so rather than keep it around, retire it. Convert all old users of it to devctl_notify(). This path no longer sleeps, so is safe to call from any context. Since it doesn't sleep, it doesn't need to know if it is OK to sleep or not. Reviewed by: markj@ Differential Revision: https://reviews.freebsd.org/D26140 Modified: head/sys/arm/ti/am335x/am335x_pmic.c head/sys/geom/geom_dev.c head/sys/kern/kern_conf.c head/sys/kern/kern_rctl.c head/sys/kern/subr_bus.c head/sys/sys/devctl.h Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 29 04:30:06 2020 (r364945) @@ -113,7 +113,7 @@ am335x_pmic_intr(void *arg) if (int_reg.aci) { snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", status_reg.acpwr); - devctl_notify_f("ACPI", "ACAD", "power", notify_buf, M_NOWAIT); + devctl_notify("ACPI", "ACAD", "power", notify_buf); } } Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/geom/geom_dev.c Sat Aug 29 04:30:06 2020 (r364945) @@ -213,7 +213,7 @@ g_dev_destroy(void *arg, int flags __unused) sc = cp->private; g_trace(G_T_TOPOLOGY, "g_dev_destroy(%p(%s))", cp, gp->name); snprintf(buf, sizeof(buf), "cdev=%s", gp->name); - devctl_notify_f("GEOM", "DEV", "DESTROY", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "DESTROY", buf); if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) g_access(cp, -cp->acr, -cp->acw, -cp->ace); g_detach(cp); @@ -277,13 +277,13 @@ g_dev_set_media(struct g_consumer *cp) sc = cp->private; dev = sc->sc_dev; snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); - devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); + devctl_notify("DEVFS", "CDEV", "MEDIACHANGE", buf); + devctl_notify("GEOM", "DEV", "MEDIACHANGE", buf); dev = sc->sc_alias; if (dev != NULL) { snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); - devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); + devctl_notify("DEVFS", "CDEV", "MEDIACHANGE", buf); + devctl_notify("GEOM", "DEV", "MEDIACHANGE", buf); } } @@ -308,7 +308,7 @@ g_dev_resize(struct g_consumer *cp) char buf[SPECNAMELEN + 6]; snprintf(buf, sizeof(buf), "cdev=%s", cp->provider->name); - devctl_notify_f("GEOM", "DEV", "SIZECHANGE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "SIZECHANGE", buf); } struct g_provider * @@ -379,7 +379,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, g_dev_attrchanged(cp, "GEOM::physpath"); snprintf(buf, sizeof(buf), "cdev=%s", gp->name); - devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "CREATE", buf); /* * Now add all the aliases for this drive */ @@ -392,7 +392,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, continue; } snprintf(buf, sizeof(buf), "cdev=%s", gap->ga_alias); - devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "CREATE", buf); } return (gp); Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/kern_conf.c Sat Aug 29 04:30:06 2020 (r364945) @@ -546,7 +546,7 @@ notify(struct cdev *dev, const char *ev, int flags) return; memcpy(data, prefix, sizeof(prefix) - 1); memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1); - devctl_notify_f("DEVFS", "CDEV", ev, data, mflags); + devctl_notify("DEVFS", "CDEV", ev, data); free(data, M_TEMP); } Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/kern_rctl.c Sat Aug 29 04:30:06 2020 (r364945) @@ -591,8 +591,8 @@ rctl_enforce(struct proc *p, int resource, uint64_t am p->p_pid, p->p_ucred->cr_ruid, p->p_ucred->cr_prison->pr_prison_racct->prr_name); sbuf_finish(&sb); - devctl_notify_f("RCTL", "rule", "matched", - sbuf_data(&sb), M_NOWAIT); + devctl_notify("RCTL", "rule", "matched", + sbuf_data(&sb)); sbuf_delete(&sb); free(buf, M_RCTL); link->rrl_exceeded = 1; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) @@ -651,8 +651,8 @@ devctl_queue(struct dev_event_info *dei) * @brief Send a 'notification' to userland, using standard ways */ void -devctl_notify_f(const char *system, const char *subsystem, const char *type, - const char *data, int flags __unused) +devctl_notify(const char *system, const char *subsystem, const char *type, + const char *data) { struct dev_event_info *dei; struct sbuf sb; @@ -677,13 +677,6 @@ devctl_notify_f(const char *system, const char *subsys devctl_free_dei(dei); /* overflow -> drop it */ else devctl_queue(dei); -} - -void -devctl_notify(const char *system, const char *subsystem, const char *type, - const char *data) -{ - devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } /* Modified: head/sys/sys/devctl.h ============================================================================== --- head/sys/sys/devctl.h Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/sys/devctl.h Sat Aug 29 04:30:06 2020 (r364945) @@ -36,8 +36,6 @@ * hook to send the message. */ boolean_t devctl_process_running(void); -void devctl_notify_f(const char *__system, const char *__subsystem, - const char *__type, const char *__data, int __flags); void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); struct sbuf; From owner-svn-src-head@freebsd.org Sat Aug 29 04:30:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45DE83CC26C; Sat, 29 Aug 2020 04:30:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdk5w5ZQMz3dvW; Sat, 29 Aug 2020 04:30:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87A692048A; Sat, 29 Aug 2020 04:30:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07T4UCk7007929; Sat, 29 Aug 2020 04:30:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T4UCM4007928; Sat, 29 Aug 2020 04:30:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008290430.07T4UCM4007928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 04:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364946 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 04:30:13 -0000 Author: imp Date: Sat Aug 29 04:30:12 2020 New Revision: 364946 URL: https://svnweb.freebsd.org/changeset/base/364946 Log: Move to using sbuf for some sysctl in newbus Convert two different sysctl to using sbuf. First, for all the default sysctls we implement for each device driver that's attached. This is a pure sbuf conversion. Second, convert sysctl_devices to fill its buffer with sbuf rather than a hand-rolled crappy thing I wrote years ago. Reviewed by: cem, markj Differential Revision: https://reviews.freebsd.org/D26206 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) @@ -260,36 +260,33 @@ enum { static int device_sysctl_handler(SYSCTL_HANDLER_ARGS) { + struct sbuf sb; device_t dev = (device_t)arg1; - const char *value; - char *buf; int error; - buf = NULL; + sbuf_new_for_sysctl(&sb, NULL, 1024, req); switch (arg2) { case DEVICE_SYSCTL_DESC: - value = dev->desc ? dev->desc : ""; + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); break; case DEVICE_SYSCTL_DRIVER: - value = dev->driver ? dev->driver->name : ""; + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); break; case DEVICE_SYSCTL_LOCATION: - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); - bus_child_location_str(dev, buf, 1024); + bus_child_location_sb(dev, &sb); break; case DEVICE_SYSCTL_PNPINFO: - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); - bus_child_pnpinfo_str(dev, buf, 1024); + bus_child_pnpinfo_sb(dev, &sb); break; case DEVICE_SYSCTL_PARENT: - value = dev->parent ? dev->parent->nameunit : ""; + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); break; default: + sbuf_delete(&sb); return (EINVAL); } - error = SYSCTL_OUT_STR(req, value); - if (buf != NULL) - free(buf, M_BUS); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT | static int sysctl_devices(SYSCTL_HANDLER_ARGS) { + struct sbuf sb; int *name = (int *)arg1; u_int namelen = arg2; int index; device_t dev; struct u_device *udev; int error; - char *walker, *ep; if (namelen != 2) return (EINVAL); @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) udev->dv_devflags = dev->devflags; udev->dv_flags = dev->flags; udev->dv_state = dev->state; - walker = udev->dv_fields; - ep = walker + sizeof(udev->dv_fields); -#define CP(src) \ - if ((src) == NULL) \ - *walker++ = '\0'; \ - else { \ - strlcpy(walker, (src), ep - walker); \ - walker += strlen(walker) + 1; \ - } \ - if (walker >= ep) \ - break; - - do { - CP(dev->nameunit); - CP(dev->desc); - CP(dev->driver != NULL ? dev->driver->name : NULL); - bus_child_pnpinfo_str(dev, walker, ep - walker); - walker += strlen(walker) + 1; - if (walker >= ep) - break; - bus_child_location_str(dev, walker, ep - walker); - walker += strlen(walker) + 1; - if (walker >= ep) - break; - *walker++ = '\0'; - } while (0); -#undef CP - error = SYSCTL_OUT(req, udev, sizeof(*udev)); + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), SBUF_FIXEDLEN); + sbuf_cat(&sb, dev->nameunit); + sbuf_putc(&sb, '\0'); + sbuf_cat(&sb, dev->desc); + sbuf_putc(&sb, '\0'); + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); + sbuf_putc(&sb, '\0'); + bus_child_pnpinfo_sb(dev, &sb); + sbuf_putc(&sb, '\0'); + bus_child_location_sb(dev, &sb); + sbuf_putc(&sb, '\0'); + error = sbuf_finish(&sb); + if (error == 0) + error = SYSCTL_OUT(req, udev, sizeof(*udev)); + sbuf_delete(&sb); free(udev, M_BUS); return (error); } From owner-svn-src-head@freebsd.org Sat Aug 29 07:09:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0350C3D0025; Sat, 29 Aug 2020 07:09:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdndM3V0Jz43ZC; Sat, 29 Aug 2020 07:09:11 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id f7so1141165wrw.1; Sat, 29 Aug 2020 00:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fr+XgDr1LRxwO6sKj9p+ER5WnSKmqsBFFhMYokA0lCg=; b=j2G9mEy2Ys3HVj9M7A+B4FBbacg78q9ke1IOH7KpctooeWeOuXk2Inedir7j1VDpRM 4lkkiRbiFbgMfe8cl6dRaLq6FvtLH/9iIUJl3KlGAYkJIMlub+WRZy4QYAqpG6/wPdpg W1SkMw+XG9XlxzZSNbPJIFwOwD9tmzjGXcKDtE7Iv/caGZrkNJDNsJuIxuUJoONvfPLm hCySIhSkNtkCgVW/WP9niCZVjfoR/anjEFy4fXZ/vKnl028weVRGj88pDAVOnXOggxUv 3G3i+nuB2fQbdosH7nWqbL3l67p7fYB+fuk4Q32lAt2/BV882YeTmZEVL4udFUyP+QBh LoYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fr+XgDr1LRxwO6sKj9p+ER5WnSKmqsBFFhMYokA0lCg=; b=ihw2k5HeQL5cpxSYGIpaJPI7x30XtIJz3Qa1doudWMLHdtdY9okKRxvnhnCF7w8tgV S27dS7ztFiUsl2nJtUaWDKVxbA+V1I/DRUBzcsck0AcqcAwF7IokgnDX5YBR7LRV3S0r xxfCNKqzl6cHSseCEqSPqig+gsNXayYdYvgeccymqC6NVdudkKHfnDO5QMGGJ9h+OJMd xQYzRzAKx2nsVG4aFynAlQHeLWmVx2OwzVdmcbL0yHrK2cUsL71vRU+fNfHADN4x1m87 3DWQ2YFpE0TNl3ETBitcphCNVaZh16nlM8UroMMA/JwxGmbG8Hr9m5ZstHYEyDIFqCni 97+w== X-Gm-Message-State: AOAM532Fw6mCvSWaPoM8ZEq88POWIrvnHjim8dGqAxjoU5mZKGc53jL5 IK3My+ARxKwavnTKTE8kyeWzwKEjHppDiN6R2ssS1lKp X-Google-Smtp-Source: ABdhPJyit1/adjopwey0inVvO4+M/reOOyi8UllS2fiq8G7YXxkmKbXkaHnbnQe6BWL7h5AkY+cA/OOLyCvY+heBA0w= X-Received: by 2002:adf:f8d0:: with SMTP id f16mr2549616wrq.66.1598684949249; Sat, 29 Aug 2020 00:09:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:5347:0:0:0:0:0 with HTTP; Sat, 29 Aug 2020 00:09:08 -0700 (PDT) In-Reply-To: <202008290430.07T4UCM4007928@repo.freebsd.org> References: <202008290430.07T4UCM4007928@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 29 Aug 2020 09:09:08 +0200 Message-ID: Subject: Re: svn commit: r364946 - head/sys/kern To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BdndM3V0Jz43ZC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 07:09:12 -0000 This crashes on boot for me: atal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x0 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff805b0a7f stack pointer = 0x28:0xfffffe002366a7f0 frame pointer = 0x28:0xfffffe002366a7f0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 89 (devmatch) trap number = 12 panic: page fault cpuid = 0 time = 1598692135 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe002366a4a0 vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 panic() at panic+0x43/frame 0xfffffe002366a550 trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 trap() at trap+0x27d/frame 0xfffffe002366a720 calltrap() at calltrap+0x8/frame 0xfffffe002366a720 --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp = 0xfffffe002366a7f0 --- strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame 0xfffffe002366a8f0 sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe002366abf0 --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- KDB: enter: panic [ thread pid 89 tid 100067 ] Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) On 8/29/20, Warner Losh wrote: > Author: imp > Date: Sat Aug 29 04:30:12 2020 > New Revision: 364946 > URL: https://svnweb.freebsd.org/changeset/base/364946 > > Log: > Move to using sbuf for some sysctl in newbus > > Convert two different sysctl to using sbuf. First, for all the default > sysctls we implement for each device driver that's attached. This is a > pure sbuf conversion. > > Second, convert sysctl_devices to fill its buffer with sbuf rather > than a hand-rolled crappy thing I wrote years ago. > > Reviewed by: cem, markj > Differential Revision: https://reviews.freebsd.org/D26206 > > Modified: > head/sys/kern/subr_bus.c > > Modified: head/sys/kern/subr_bus.c > ============================================================================== > --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) > +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) > @@ -260,36 +260,33 @@ enum { > static int > device_sysctl_handler(SYSCTL_HANDLER_ARGS) > { > + struct sbuf sb; > device_t dev = (device_t)arg1; > - const char *value; > - char *buf; > int error; > > - buf = NULL; > + sbuf_new_for_sysctl(&sb, NULL, 1024, req); > switch (arg2) { > case DEVICE_SYSCTL_DESC: > - value = dev->desc ? dev->desc : ""; > + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); > break; > case DEVICE_SYSCTL_DRIVER: > - value = dev->driver ? dev->driver->name : ""; > + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); > break; > case DEVICE_SYSCTL_LOCATION: > - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > - bus_child_location_str(dev, buf, 1024); > + bus_child_location_sb(dev, &sb); > break; > case DEVICE_SYSCTL_PNPINFO: > - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > - bus_child_pnpinfo_str(dev, buf, 1024); > + bus_child_pnpinfo_sb(dev, &sb); > break; > case DEVICE_SYSCTL_PARENT: > - value = dev->parent ? dev->parent->nameunit : ""; > + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); > break; > default: > + sbuf_delete(&sb); > return (EINVAL); > } > - error = SYSCTL_OUT_STR(req, value); > - if (buf != NULL) > - free(buf, M_BUS); > + error = sbuf_finish(&sb); > + sbuf_delete(&sb); > return (error); > } > > @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT > | > static int > sysctl_devices(SYSCTL_HANDLER_ARGS) > { > + struct sbuf sb; > int *name = (int *)arg1; > u_int namelen = arg2; > int index; > device_t dev; > struct u_device *udev; > int error; > - char *walker, *ep; > > if (namelen != 2) > return (EINVAL); > @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) > udev->dv_devflags = dev->devflags; > udev->dv_flags = dev->flags; > udev->dv_state = dev->state; > - walker = udev->dv_fields; > - ep = walker + sizeof(udev->dv_fields); > -#define CP(src) \ > - if ((src) == NULL) \ > - *walker++ = '\0'; \ > - else { \ > - strlcpy(walker, (src), ep - walker); \ > - walker += strlen(walker) + 1; \ > - } \ > - if (walker >= ep) \ > - break; > - > - do { > - CP(dev->nameunit); > - CP(dev->desc); > - CP(dev->driver != NULL ? dev->driver->name : NULL); > - bus_child_pnpinfo_str(dev, walker, ep - walker); > - walker += strlen(walker) + 1; > - if (walker >= ep) > - break; > - bus_child_location_str(dev, walker, ep - walker); > - walker += strlen(walker) + 1; > - if (walker >= ep) > - break; > - *walker++ = '\0'; > - } while (0); > -#undef CP > - error = SYSCTL_OUT(req, udev, sizeof(*udev)); > + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), SBUF_FIXEDLEN); > + sbuf_cat(&sb, dev->nameunit); > + sbuf_putc(&sb, '\0'); > + sbuf_cat(&sb, dev->desc); > + sbuf_putc(&sb, '\0'); > + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); > + sbuf_putc(&sb, '\0'); > + bus_child_pnpinfo_sb(dev, &sb); > + sbuf_putc(&sb, '\0'); > + bus_child_location_sb(dev, &sb); > + sbuf_putc(&sb, '\0'); > + error = sbuf_finish(&sb); > + if (error == 0) > + error = SYSCTL_OUT(req, udev, sizeof(*udev)); > + sbuf_delete(&sb); > free(udev, M_BUS); > return (error); > } > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 29 08:56:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F9B03D221C; Sat, 29 Aug 2020 08:56:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdr1X67G9z48tn; Sat, 29 Aug 2020 08:56:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5F54D26024C; Sat, 29 Aug 2020 10:56:41 +0200 (CEST) Subject: Re: svn commit: r364944 - head/sys/kern To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008290429.07T4TrbH007764@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <25be5af1-76a9-78a1-4e4f-2777b0e7f350@selasky.org> Date: Sat, 29 Aug 2020 10:56:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202008290429.07T4TrbH007764@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bdr1X67G9z48tn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 08:56:49 -0000 On 2020-08-29 06:29, Warner Losh wrote: > +#define DEVCTL_BUFFER (1024 - sizeof(void *)) > struct dev_event_info { > - char *dei_data; > STAILQ_ENTRY(dev_event_info) dei_link; > + char dei_data[DEVCTL_BUFFER]; > }; Maybe add: CTASSERT(sizeof(struct dev_event_info) == 1024); Not sure if STAILQ's can have some debug fields in them. --HPS From owner-svn-src-head@freebsd.org Sat Aug 29 09:44:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABC283D35DA; Sat, 29 Aug 2020 09:44:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bds4H1pLfz4DqM; Sat, 29 Aug 2020 09:44:14 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1598694253; bh=Bxov30qVuC2YzECV5Qq7h8SRPDecyF2CtW/SUdSCAxk=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=bMdxS0r+BTzY4qmt8Coagxj4iv9kSoEPf7PYK3/RR5e8GIOq5eT47REcGQWcy6FuF gb8E/ECYYreFxvw/3KwIc0WSHUwsCNwR8P84gJoQnzatYlbCOxBlGZjXOmcZqs4AhQ ZLXUlFmkisp6Sm/hzp2bfCY6MYJy27FCrRVm3BQE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermann.fritz.box ([78.55.153.100]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MD9XF-1kKzoS0NW5-009BOI; Sat, 29 Aug 2020 11:44:13 +0200 Date: Sat, 29 Aug 2020 11:44:04 +0200 From: "Hartmann, O." To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364941 - in head/sys: net net/route netinet netinet6 Message-ID: <20200829114404.2fbdb73d@hermann.fritz.box> In-Reply-To: <202008282250.07SMoL7I095754@repo.freebsd.org> References: <202008282250.07SMoL7I095754@repo.freebsd.org> Organization: walstatt.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/BkXhTkDbEWYS4IuN+9OceSu"; protocol="application/pgp-signature" X-Provags-ID: V03:K1:UpUdPCyzXm5Mkp6pbNTxyOl1I6olMtun/KvJLSs2EL4HnRIHkN7 2jG/2kXfGGwUhlaeqQtJUGfHCAoimxBwSWRDqhy139qIpFs/OEiTuf6kHYh/kwd2Zq6chUW 8feq2kxO7DbQKqas6bsyKb8QR1v6K6lBQdVGa6KJuYGbLB1Pb6GK1C7sdYZAYz72eVUztd7 NmlD90KiuSdkYdtFVrL4g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:DA8xGfCGMqY=:zBvrx3XgV8HZZybTfB8ln0 R9CdlbkkFCpkOxq+z+wbf5jYE5S1szRxsWOQ/yEoHy/XS9Nd8LFeebUTDsPVcd3zG+asgM3Yg 93C8AvKxOUT6WlMkeNQgywm1A7ClreTHyt3FAdGG8RMnBDT1AKqtmXwQJLpd8fKZm9vE5/6sc ZyH4R4rUo+v6NQi7Y4bHuk8+aJ9uNndwLJpGiN+eLr/6GfX/Mryr8Y7nYL82siaLmhfMn5kng Muc3XS7MIHPAwsperloaaHiMMOPZOD94hJGrOmxLPE2rzTHQJnwVhs8joEeytkzSzhdo9n8In h7TDfHrYUYKMxZOODX9volxpfuC7ZpEfZxZtQn7zUcE2IDZviQ5Ya202OgvQNl/uOJsSIBSlS ZpYPQpsJGRucxrjAPNFLsT/c8D9soejJiP2vSRHkxOlZMpQ+qLgg+cbMuYHaWYKAmYdkPQvND NZTRQp4bDnWAmckpd44q+x8yhJOpCiPiXT0B9DUOVZBICzNdzp0Gg1iihnNoolSEu62QRTkoi zQ9xcdmXScGSnQyEFv/szfGgf6hflCw3YzHCEEgnL+C1RJ69jug22JvAr2n1GENoLdwt0zWGR oHLAE7Y2J7y7UL1mgTfwxTOlpn/16kbRK24/KK7ZhyyPV6DQ0XqZ9Tgr0yaASqWUSAGF5eRKt bIMNFC2u1HDvAuWqO213n+SOepkid0suF+U76fHAU7Y84U/o/sVjcyBs1RxHTOdOwppRkm5zF 57q9gO+pwV0rvUX0hCuYZbGpa3JK6JVGfpidHXTd5GZX98ZRhaStPRzUCQs4hrv5r9VGNmIZL dh8VVsQmTWibXhGJn/WlZ7WuXjOdcDTYHjppr78UA2+YYeti6aT77gNplL6KPkaKgyokGcxGN aMuibYP08BgHPaEBdhuHLN0Nij97t+OgPnZ8Ui4OufjrjNDIuO5wT5jQEpjGKZ1+2gz03JbuI RQ6/tXsd0Ah9fg8vDWxIDsndHl31J6j8it5ozibRbf3hcmwb2RWhCv8Q+6tugx270ygeCaI2V t6jPGF2E2wDQpUIw/24w6B4r23vLLb5kfjsV/I0Ay98kAJ89lBL+oLxnsUwO6sB7xWG22hoFa AxNq8toy9ppXN71NN9AjCkVqD6ihYFNFUO1ThwKzHbtivKKJuUGp4FfUsJa3xmYPDL6A6IG1P jhqw+m0/LI/7d/iePol3uhSXodfhJ2fMLS6ZV57kV67CbbWAXBpZl2HVRLyb1R/job+qOa+zN /EfZx5fgkB1CK/xHlHjKL6lJFb/VtarTzCxmqFA== X-Rspamd-Queue-Id: 4Bds4H1pLfz4DqM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=bMdxS0r+; dmarc=none; spf=none (mx1.freebsd.org: domain of ohartmann@walstatt.org has no SPF policy when checking 212.227.17.22) smtp.mailfrom=ohartmann@walstatt.org X-Spamd-Result: default: False [-2.62 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.22:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[walstatt.org]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-0.93)[-0.926]; HAS_ORG_HEADER(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[78.55.153.100:received]; NEURAL_HAM_MEDIUM(-0.84)[-0.836]; DKIM_TRACE(0.00)[gmx.net:+]; NEURAL_HAM_SHORT(-0.36)[-0.361]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.17.22:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 09:44:16 -0000 --Sig_/BkXhTkDbEWYS4IuN+9OceSu Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 28 Aug 2020 22:50:21 +0000 (UTC) "Alexander V. Chernikov" wrote: > Author: melifaro > Date: Fri Aug 28 22:50:20 2020 > New Revision: 364941 > URL: https://svnweb.freebsd.org/changeset/base/364941 >=20 > Log: > Move net/route/shared.h definitions to net/route/route_var.h. > =20 > No functional changes. > =20 > net/route/shared.h was created in the inital phases of nexthop > conversion. It was intended to serve the same purpose as route_var.h > - share definitions of functions and structures between the routing > subsystem components. At that time route_var.h was included by many > files external to the routing subsystem, which largerly defeats its > purpose.=20 > As currently this is not the case anymore and amount of route_var.h > includes is roughly the same as shared.h, retire the latter in favour > of the former. >=20 > Deleted: > head/sys/net/route/shared.h > Modified: > head/sys/net/radix_mpath.c > head/sys/net/route.c > head/sys/net/route/nhop.c > head/sys/net/route/nhop_ctl.c > head/sys/net/route/route_ctl.c > head/sys/net/route/route_helpers.c > head/sys/net/route/route_var.h > head/sys/net/rtsock.c > head/sys/netinet/in_fib.c > head/sys/netinet/in_rmx.c > head/sys/netinet6/in6_fib.c > head/sys/netinet6/in6_rmx.c >=20 > Modified: head/sys/net/radix_mpath.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/radix_mpath.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/net/radix_mpath.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include >=20 > Modified: head/sys/net/route.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/net/route.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -64,7 +64,6 @@ > #include > #include > #include > -#include > #include > =20 > #ifdef RADIX_MPATH >=20 > Modified: head/sys/net/route/nhop.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route/nhop.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/net/route/nhop.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > =20 > /* >=20 > Modified: head/sys/net/route/nhop_ctl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route/nhop_ctl.c Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/net/route/nhop_ctl.c Fri > Aug 28 22:50:20 2020 (r364941) @@ -49,7 +49,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > #include > -#include > #include > =20 > /* >=20 > Modified: head/sys/net/route/route_ctl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route/route_ctl.c Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/net/route/route_ctl.c Fri > Aug 28 22:50:20 2020 (r364941) @@ -52,7 +52,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > #include > -#include > #include > =20 > #ifdef RADIX_MPATH >=20 > Modified: head/sys/net/route/route_helpers.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route/route_helpers.c Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/net/route/route_helpers.c > Fri Aug 28 22:50:20 2020 (r364941) @@ -55,7 +55,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > #include > -#include > #ifdef INET > #include > #endif >=20 > Modified: head/sys/net/route/route_var.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/route/route_var.h Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/net/route/route_var.h Fri > Aug 28 22:50:20 2020 (r364941) @@ -39,7 +39,14 @@ > #include > #include /* struct sockaddr_in */ > #include > +#include > =20 > +#ifdef RTDEBUG > +#define DPRINTF(_fmt, ...) printf("%s: " _fmt "\n", > __func__ , ## __VA_ARGS__) +#else > +#define DPRINTF(_fmt, ...) > +#endif > + > struct nh_control; > typedef int rnh_preadd_entry_f_t(u_int fibnum, const struct sockaddr > *addr, const struct sockaddr *mask, struct nhop_object *nh); > @@ -221,6 +228,7 @@ fib_rte_to_nh_flags(int rt_flags) > return (res); > } > =20 > +/* route_temporal.c */ > void tmproutes_update(struct rib_head *rnh, struct rtentry *rt); > void tmproutes_init(struct rib_head *rh); > void tmproutes_destroy(struct rib_head *rh); > @@ -236,5 +244,33 @@ int change_route_conditional(struct rib_head > *rnh, str=20 > void vnet_rtzone_init(void); > void vnet_rtzone_destroy(void); > + > +/* subscriptions */ > +void rib_init_subscriptions(struct rib_head *rnh); > +void rib_destroy_subscriptions(struct rib_head *rnh); > + > +/* Nexhops */ > +void nhops_init(void); > +int nhops_init_rib(struct rib_head *rh); > +void nhops_destroy_rib(struct rib_head *rh); > +void nhop_ref_object(struct nhop_object *nh); > +int nhop_try_ref_object(struct nhop_object *nh); > +int nhop_ref_any(struct nhop_object *nh); > +void nhop_free_any(struct nhop_object *nh); > + > +void nhop_set_type(struct nhop_object *nh, enum nhop_type nh_type); > +void nhop_set_rtflags(struct nhop_object *nh, int rt_flags); > + > +int nhop_create_from_info(struct rib_head *rnh, struct rt_addrinfo > *info, > + struct nhop_object **nh_ret); > +int nhop_create_from_nhop(struct rib_head *rnh, const struct > nhop_object *nh_orig, > + struct rt_addrinfo *info, struct nhop_object **pnh_priv); > + > +void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, > uint32_t mtu); +int nhops_dump_sysctl(struct rib_head *rh, struct > sysctl_req *w); + > +/* route */ > +struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct > rt_addrinfo *info, > + int *perror); > =20 > #endif >=20 > Modified: head/sys/net/rtsock.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net/rtsock.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/net/rtsock.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -77,7 +77,6 @@ > #include > #endif > #include > -#include > =20 > #ifdef COMPAT_FREEBSD32 > #include >=20 > Modified: head/sys/netinet/in_fib.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/in_fib.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/netinet/in_fib.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > =20 > #ifdef RADIX_MPATH >=20 > Modified: head/sys/netinet/in_rmx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/in_rmx.c Fri Aug 28 21:59:10 2020 > (r364940) +++ head/sys/netinet/in_rmx.c Fri Aug 28 22:50:20 > 2020 (r364941) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > =20 > #include >=20 > Modified: head/sys/netinet6/in6_fib.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet6/in6_fib.c Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/netinet6/in6_fib.c Fri Aug > 28 22:50:20 2020 (r364941) @@ -51,7 +51,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > #include > -#include > #include > =20 > #ifdef RADIX_MPATH >=20 > Modified: head/sys/netinet6/in6_rmx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet6/in6_rmx.c Fri Aug 28 21:59:10 > 2020 (r364940) +++ head/sys/netinet6/in6_rmx.c Fri Aug > 28 22:50:20 2020 (r364941) @@ -84,7 +84,6 @@ > __FBSDID("$FreeBSD$"); #include > #include > #include > -#include > =20 > #include > #include > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org" This commit breaks "make buildkernel" on CURRENT for me on several CURRENT boxes: [...] x86 -> /usr/src/sys/x86/include --- route_ctl.o --- /usr/src/sys/net/route/route_ctl.c:315:30: error: variable 'netmask' is uninitialized when used here [-Werror,-Wuninitialized] rt_mpath_conflict(rnh, rt, netmask)) { ^~~~~~~ /usr/src/sys/net/route/route_ctl.c:297:33: note: initialize the variable 'netmask' to silence this warning --- modules-all --- --- all_subdir_acpi/acpi_video --- =3D=3D=3D> acpi/acpi_video (all) --- route_ctl.o --- struct sockaddr *ndst, *netmask; ^ =3D NULL --- modules-all --- --- all_subdir_amdgpio --- [...] Greetings, oh --Sig_/BkXhTkDbEWYS4IuN+9OceSu Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCX0ojZQAKCRA4N1ZZPba5 R+ZeAQD5LeXZv0dgpNNRqQvknjeiyG6sxAzB5Ay2SIyDBq3C7wD+KDsFEY+YmPIf pDjjP+EX81EXnFIMRyEuY/5PsSTJ5w4= =RiTg -----END PGP SIGNATURE----- --Sig_/BkXhTkDbEWYS4IuN+9OceSu-- From owner-svn-src-head@freebsd.org Sat Aug 29 09:59:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DAD83D36E9; Sat, 29 Aug 2020 09:59:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdsQJ6YHvz4FDY; Sat, 29 Aug 2020 09:59:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C459D23F2F; Sat, 29 Aug 2020 09:59:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07T9xqfH011902; Sat, 29 Aug 2020 09:59:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T9xq5K011901; Sat, 29 Aug 2020 09:59:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008290959.07T9xq5K011901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 09:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364949 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 09:59:53 -0000 Author: imp Date: Sat Aug 29 09:59:52 2020 New Revision: 364949 URL: https://svnweb.freebsd.org/changeset/base/364949 Log: Avoid NULL pointer dereferences Add back NULL pointer checks accidentally dropped in r364946. We need to append a NUL character when that happens. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 06:55:10 2020 (r364948) +++ head/sys/kern/subr_bus.c Sat Aug 29 09:59:52 2020 (r364949) @@ -5499,11 +5499,20 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) udev->dv_flags = dev->flags; udev->dv_state = dev->state; sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), SBUF_FIXEDLEN); - sbuf_cat(&sb, dev->nameunit); + if (dev->nameunit != NULL) + sbuf_cat(&sb, dev->nameunit); + else + sbuf_putc(&sb, '\0'); sbuf_putc(&sb, '\0'); - sbuf_cat(&sb, dev->desc); + if (dev->desc != NULL) + sbuf_cat(&sb, dev->desc); + else + sbuf_putc(&sb, '\0'); sbuf_putc(&sb, '\0'); - sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); + if (dev->driver != NULL) + sbuf_cat(&sb, dev->driver->name); + else + sbuf_putc(&sb, '\0'); sbuf_putc(&sb, '\0'); bus_child_pnpinfo_sb(dev, &sb); sbuf_putc(&sb, '\0'); From owner-svn-src-head@freebsd.org Sat Aug 29 10:05:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 444D23D3763 for ; Sat, 29 Aug 2020 10:05:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdsXM1z7Hz4Fgs for ; Sat, 29 Aug 2020 10:05:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x731.google.com with SMTP id b14so1979678qkn.4 for ; Sat, 29 Aug 2020 03:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fHWPOBbKafawZ0WGTH4sb0VjMATu9lFMcSQou1fqz7c=; b=OqxJ1zF7BCBMEUxLG7fJKj1/jwNmz7AA/qfGAz6y8On9/t+Pxj3OGjctrMWWz+AEKD 4XZGkxOqEDXBTwLJFBZXBgHJeqhrspFW4BvcCXBkZjV3sKjIsXbKThDkMn+JehKVVYFv PH7MAhsysj+IUGJt5l1VCL83485xdzpZvbbDBLSoSzu/CL7tvHl/4D0t7Mn2HRHynVDv LYAaTsd99Scg1TRrJ8MwznAZRueG+F3SdMqN0kF8F1LMWbqi2NXqL0wqQtG2cbIv6stZ ejSIxXtVlFxlDCcA/dDxvIBK4Ye7OVz9ajjxd4tkytvtp5WVtBU/50OfKlc+Qm1TRV0y LgWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fHWPOBbKafawZ0WGTH4sb0VjMATu9lFMcSQou1fqz7c=; b=sP4XQcSl3+5l8y1LupTS0AQ+AvUxco1joixTm+xrBLCo9qyByLH5m+I+Jmvxd/gc7R 6xkKrQ80N/AdDWB11CBnryIhazALS4fLmrkcHlpO1jebKCCcAZBS4yx6Td83LDU7BmzL QzaQxbRIIzUEEcZGiUsJ/2WicpL7ThOsHvKXenPCcOmu+s7Q+JrNJ7WTJiLuUE5bcnMK 8VRoBdfS1nnG0AkRxZcze6nkg78dPjSQOPBjgEctnUcXiMwwM8tWjuPGngkViCou+DOp FhZG/AC7F0pT52FS5VO/yPXPIXcDskPM5SjnI7pLb6kqKnT4NDYfefeM+yJzOWGNsjPy fNEQ== X-Gm-Message-State: AOAM530pAiEhPK+t2yXCMNeMV3PX4BwPToiLws3A3scVw6rsBCam93yo zdM9MPWGvOhz1ITE6pqWxELn4xlDDu44w49IV0U6KQ== X-Google-Smtp-Source: ABdhPJwJRD1adpgazsM2JVtlvlfGQov/TPXBNSg9hMiFT10D86x2aSOpo0vepuCM/1LH+8o/p8fwZ6sl9x5tgWZAs4Q= X-Received: by 2002:a37:b801:: with SMTP id i1mr2628648qkf.240.1598695506179; Sat, 29 Aug 2020 03:05:06 -0700 (PDT) MIME-Version: 1.0 References: <202008290430.07T4UCM4007928@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sat, 29 Aug 2020 04:04:55 -0600 Message-ID: Subject: Re: svn commit: r364946 - head/sys/kern To: Mateusz Guzik Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BdsXM1z7Hz4Fgs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=OqxJ1zF7; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::731) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.99 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.81)[-0.813]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.948]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.23)[-0.225]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 10:05:08 -0000 On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik wrote: > This crashes on boot for me: > I wasn't able to get it to crash on boot for me, but I was able to recreate it. Fixed in r364949. I think it didn't crash on boot for me because kldxref failed due to the segment thing so devmatch didn't run which would have triggered this bug. devinfo did trigger a very similar crash, and r364949 fixes that crash. Even a new kldxref failed due to the too many segments thing, so I can't confirm that's what you hit, but I'm pretty sure it is... Warner > atal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0x0 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff805b0a7f > stack pointer = 0x28:0xfffffe002366a7f0 > frame pointer = 0x28:0xfffffe002366a7f0 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 89 (devmatch) > trap number = 12 > panic: page fault > cpuid = 0 > time = 1598692135 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe002366a4a0 > vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 > panic() at panic+0x43/frame 0xfffffe002366a550 > trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 > trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 > trap() at trap+0x27d/frame 0xfffffe002366a720 > calltrap() at calltrap+0x8/frame 0xfffffe002366a720 > --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp > = 0xfffffe002366a7f0 --- > strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 > sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 > sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame > 0xfffffe002366a8f0 > sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 > userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 > amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 > fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe002366abf0 > --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp > = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- > KDB: enter: panic > [ thread pid 89 tid 100067 ] > Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) > > > On 8/29/20, Warner Losh wrote: > > Author: imp > > Date: Sat Aug 29 04:30:12 2020 > > New Revision: 364946 > > URL: https://svnweb.freebsd.org/changeset/base/364946 > > > > Log: > > Move to using sbuf for some sysctl in newbus > > > > Convert two different sysctl to using sbuf. First, for all the default > > sysctls we implement for each device driver that's attached. This is a > > pure sbuf conversion. > > > > Second, convert sysctl_devices to fill its buffer with sbuf rather > > than a hand-rolled crappy thing I wrote years ago. > > > > Reviewed by: cem, markj > > Differential Revision: https://reviews.freebsd.org/D26206 > > > > Modified: > > head/sys/kern/subr_bus.c > > > > Modified: head/sys/kern/subr_bus.c > > > ============================================================================== > > --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) > > +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) > > @@ -260,36 +260,33 @@ enum { > > static int > > device_sysctl_handler(SYSCTL_HANDLER_ARGS) > > { > > + struct sbuf sb; > > device_t dev = (device_t)arg1; > > - const char *value; > > - char *buf; > > int error; > > > > - buf = NULL; > > + sbuf_new_for_sysctl(&sb, NULL, 1024, req); > > switch (arg2) { > > case DEVICE_SYSCTL_DESC: > > - value = dev->desc ? dev->desc : ""; > > + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); > > break; > > case DEVICE_SYSCTL_DRIVER: > > - value = dev->driver ? dev->driver->name : ""; > > + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); > > break; > > case DEVICE_SYSCTL_LOCATION: > > - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > > - bus_child_location_str(dev, buf, 1024); > > + bus_child_location_sb(dev, &sb); > > break; > > case DEVICE_SYSCTL_PNPINFO: > > - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > > - bus_child_pnpinfo_str(dev, buf, 1024); > > + bus_child_pnpinfo_sb(dev, &sb); > > break; > > case DEVICE_SYSCTL_PARENT: > > - value = dev->parent ? dev->parent->nameunit : ""; > > + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); > > break; > > default: > > + sbuf_delete(&sb); > > return (EINVAL); > > } > > - error = SYSCTL_OUT_STR(req, value); > > - if (buf != NULL) > > - free(buf, M_BUS); > > + error = sbuf_finish(&sb); > > + sbuf_delete(&sb); > > return (error); > > } > > > > @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, > CTLTYPE_STRUCT > > | > > static int > > sysctl_devices(SYSCTL_HANDLER_ARGS) > > { > > + struct sbuf sb; > > int *name = (int *)arg1; > > u_int namelen = arg2; > > int index; > > device_t dev; > > struct u_device *udev; > > int error; > > - char *walker, *ep; > > > > if (namelen != 2) > > return (EINVAL); > > @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) > > udev->dv_devflags = dev->devflags; > > udev->dv_flags = dev->flags; > > udev->dv_state = dev->state; > > - walker = udev->dv_fields; > > - ep = walker + sizeof(udev->dv_fields); > > -#define CP(src) \ > > - if ((src) == NULL) \ > > - *walker++ = '\0'; \ > > - else { \ > > - strlcpy(walker, (src), ep - walker); \ > > - walker += strlen(walker) + 1; \ > > - } \ > > - if (walker >= ep) \ > > - break; > > - > > - do { > > - CP(dev->nameunit); > > - CP(dev->desc); > > - CP(dev->driver != NULL ? dev->driver->name : NULL); > > - bus_child_pnpinfo_str(dev, walker, ep - walker); > > - walker += strlen(walker) + 1; > > - if (walker >= ep) > > - break; > > - bus_child_location_str(dev, walker, ep - walker); > > - walker += strlen(walker) + 1; > > - if (walker >= ep) > > - break; > > - *walker++ = '\0'; > > - } while (0); > > -#undef CP > > - error = SYSCTL_OUT(req, udev, sizeof(*udev)); > > + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), > SBUF_FIXEDLEN); > > + sbuf_cat(&sb, dev->nameunit); > > + sbuf_putc(&sb, '\0'); > > + sbuf_cat(&sb, dev->desc); > > + sbuf_putc(&sb, '\0'); > > + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); > > + sbuf_putc(&sb, '\0'); > > + bus_child_pnpinfo_sb(dev, &sb); > > + sbuf_putc(&sb, '\0'); > > + bus_child_location_sb(dev, &sb); > > + sbuf_putc(&sb, '\0'); > > + error = sbuf_finish(&sb); > > + if (error == 0) > > + error = SYSCTL_OUT(req, udev, sizeof(*udev)); > > + sbuf_delete(&sb); > > free(udev, M_BUS); > > return (error); > > } > > > > > -- > Mateusz Guzik > From owner-svn-src-head@freebsd.org Sat Aug 29 10:38:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53EFD3D4968; Sat, 29 Aug 2020 10:38:26 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdtGn4dMRz4HYq; Sat, 29 Aug 2020 10:38:25 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wr1-x441.google.com with SMTP id b18so1434635wrs.7; Sat, 29 Aug 2020 03:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VVFV1yBTnxUIwL5QN4/6lDv/ifz3VmDDy3L8220G9ac=; b=eRHxeMHH9lQgTgp+5MRXZLeqGZ5H80Un31KractYxenW9t3K1Rs/JeqbiXaKcfiMMY yTxbWTrhv0BXlU++mh9ANHiq5zpdy+xdZcu1ECIt+15FAhQHYLXYMDpKC3B1RyNW1DYv maWjILeOGc5k+AVEw5pomFEowcNWjQhW20MlvnoOD93qjKQK+Ysznyxz4hIKmRvydC6H dXBRQSlva4RIiJ7Suzkkq4JWe9le4HQqWQvDjKegbsX66H/HmlPrPPLPnk83YfadwHh+ c0YQBLVlH0HnDesJWtIZDIbBvoUpk9gWKXJZOASNd0p1o4es5hPJwySl46gBvD4PbA6i TbVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=VVFV1yBTnxUIwL5QN4/6lDv/ifz3VmDDy3L8220G9ac=; b=q8pcZs+f0glhGIz9+4kNo1YpG/+mfVpkEIxLW1x97WlBI7o7DBGCH1eCPupR+edatC 9W07cfDbsFSmG9Rhds99eaW1+qtjz7fK5eKIp7TTJIk4Mbx9IXbaieLlNnzqKcSZGaQA eaQ3HRXMoisA4Bm1FsyymEDM7yCY3LePN2O/ynUrt7n3NuO8g7Hk8wASDBcV3o1RJB53 +33dMjE8CowUSKGHkXB3kkhrYMU+Bh2PHOsb62RuRMFf+nGPi/EXh1l3tVEogMCTM6zJ cPrlIy4RKtPR9nZF9Pbt17bDBP9QG1dUmYqA4jj+iQwXCxlt3+3gH00FxyYe15IQYo5R kWZg== X-Gm-Message-State: AOAM532qvvoR2hQLmYHBhELgbJ52Tf13davs4R2nbBpdrGAfuY8gW+OB vFiWw28c8GWk6CD/ptUIkSw2oGpVbFk= X-Google-Smtp-Source: ABdhPJz58qD3cLhCnTq7Z5ZYQNWjLPLJs0BsXMZXULjFFrV0jKMIeUpNFH4ge8R9bgcWAskVS13TSg== X-Received: by 2002:adf:dd51:: with SMTP id u17mr2955745wrm.355.1598697503911; Sat, 29 Aug 2020 03:38:23 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id t4sm3041141wre.30.2020.08.29.03.38.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Aug 2020 03:38:23 -0700 (PDT) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r364946 - head/sys/kern To: Warner Losh , Mateusz Guzik Cc: Warner Losh , src-committers , svn-src-all , svn-src-head References: <202008290430.07T4UCM4007928@repo.freebsd.org> From: Michal Meloun Message-ID: Date: Sat, 29 Aug 2020 12:38:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BdtGn4dMRz4HYq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=eRHxeMHH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::441 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.12 / 15.00]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.19)[-0.193]; FREEMAIL_TO(0.00)[bsdimp.com,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.972]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.955]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::441:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 10:38:26 -0000 On 29.08.2020 12:04, Warner Losh wrote: > On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik wrote: > >> This crashes on boot for me: >> > > I wasn't able to get it to crash on boot for me, but I was able to recreate > it. It crashed on ofw based systems where some enumerated devices have not a suitable driver, see: --------------------------------------- sysctl_devices: nameunit: root0, descs: System root bus, driver: root sysctl_devices: nameunit: nexus0, descs: (null), driver: nexus sysctl_devices: nameunit: ofwbus0, descs: Open Firmware Device Tree, driver: ofwbus sysctl_devices: nameunit: pcib0, descs: Nvidia Integrated PCI/PCI-E Controller, driver: pcib sysctl_devices: nameunit: simplebus0, descs: Flattened device tree simple bus, driver: simplebus sysctl_devices: nameunit: gic0, descs: ARM Generic Interrupt Controller, driver: gic sysctl_devices: nameunit: (null), descs: (null), driver: sysctl_devices: nameunit: lic0, descs: (null), driver: lic sysctl_devices: nameunit: (null), descs: (null), driver: sysctl_devices: nameunit: car0, descs: Tegra Clock Driver, driver: car .... ---------------------------------------------------------------------- > Fixed in r364949.Confirmed. I think it didn't crash on boot for me because > kldxref failed due to the segment thing so devmatch didn't run which would > have triggered this bug. devinfo did trigger a very similar crash, and > r364949 fixes that crash. Even a new kldxref failed due to the too many > segments thing, so I can't confirm that's what you hit, but I'm pretty sure > it is... > But there is another issue in device_sysctl_handler() (not analyzed yet): root@tegra210:~ # sysctl dev.cpu. dev.cpu.3.temperature: 50.5C dev.cpu.3panic: sbuf_clear makes no sense on sbuf 0xffff00006f21a528 with drain cpuid = 2 time = 1598696937 KDB: stack backtrace: db_trace_self() at db_fetch_ksymtab+0x164 pc = 0xffff0000006787f4 lr = 0xffff000000153400 sp = 0xffff00006f21a1b0 fp = 0xffff00006f21a3b0 db_fetch_ksymtab() at vpanic+0x198 pc = 0xffff000000153400 lr = 0xffff00000036b274 sp = 0xffff00006f21a3c0 fp = 0xffff00006f21a420 vpanic() at panic+0x44 pc = 0xffff00000036b274 lr = 0xffff00000036b018 sp = 0xffff00006f21a430 fp = 0xffff00006f21a4e0 panic() at sbuf_clear+0xa0 pc = 0xffff00000036b018 lr = 0xffff0000003c17c8 sp = 0xffff00006f21a4f0 fp = 0xffff00006f21a4f0 sbuf_clear() at sbuf_cpy+0x58 pc = 0xffff0000003c17c8 lr = 0xffff0000003c1ff0 sp = 0xffff00006f21a500 fp = 0xffff00006f21a500 sbuf_cpy() at _gone_in_dev+0x560 pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 _gone_in_dev() at sbuf_new_for_sysctl+0x170 pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 sbuf_new_for_sysctl() at kernel_sysctl+0x36c pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 kernel_sysctl() at userland_sysctl+0xf4 pc = 0xffff00000037b63c lr = 0xffff00000037bc5c sp = 0xffff00006f21a640 fp = 0xffff00006f21a6d0 userland_sysctl() at sys___sysctl+0x68 pc = 0xffff00000037bc5c lr = 0xffff00000037bb28 sp = 0xffff00006f21a6e0 fp = 0xffff00006f21a790 sys___sysctl() at do_el0_sync+0x4e0 pc = 0xffff00000037bb28 lr = 0xffff000000697918 sp = 0xffff00006f21a7a0 fp = 0xffff00006f21a830 do_el0_sync() at handle_el0_sync+0x90 pc = 0xffff000000697918 lr = 0xffff00000067aa24 sp = 0xffff00006f21a840 fp = 0xffff00006f21a980 handle_el0_sync() at 0x4047764c pc = 0xffff00000067aa24 lr = 0x000000004047764c sp = 0xffff00006f21a990 fp = 0x0000ffffffffc250 KDB: enter: panic [ thread pid 1263 tid 100092 ] Stopped at 0x40477fb4: undefined 54000042 > Warner > > >> atal trap 12: page fault while in kernel mode >> cpuid = 0; apic id = 00 >> fault virtual address = 0x0 >> fault code = supervisor read data, page not present >> instruction pointer = 0x20:0xffffffff805b0a7f >> stack pointer = 0x28:0xfffffe002366a7f0 >> frame pointer = 0x28:0xfffffe002366a7f0 >> code segment = base 0x0, limit 0xfffff, type 0x1b >> = DPL 0, pres 1, long 1, def32 0, gran 1 >> processor eflags = interrupt enabled, resume, IOPL = 0 >> current process = 89 (devmatch) >> trap number = 12 >> panic: page fault >> cpuid = 0 >> time = 1598692135 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe002366a4a0 >> vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 >> panic() at panic+0x43/frame 0xfffffe002366a550 >> trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 >> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 >> trap() at trap+0x27d/frame 0xfffffe002366a720 >> calltrap() at calltrap+0x8/frame 0xfffffe002366a720 >> --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp >> = 0xfffffe002366a7f0 --- >> strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 >> sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 >> sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 >> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame >> 0xfffffe002366a8f0 >> sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 >> userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 >> amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 >> fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe002366abf0 >> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp >> = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- >> KDB: enter: panic >> [ thread pid 89 tid 100067 ] >> Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) >> >> >> On 8/29/20, Warner Losh wrote: >>> Author: imp >>> Date: Sat Aug 29 04:30:12 2020 >>> New Revision: 364946 >>> URL: https://svnweb.freebsd.org/changeset/base/364946 >>> >>> Log: >>> Move to using sbuf for some sysctl in newbus >>> >>> Convert two different sysctl to using sbuf. First, for all the default >>> sysctls we implement for each device driver that's attached. This is a >>> pure sbuf conversion. >>> >>> Second, convert sysctl_devices to fill its buffer with sbuf rather >>> than a hand-rolled crappy thing I wrote years ago. >>> >>> Reviewed by: cem, markj >>> Differential Revision: https://reviews.freebsd.org/D26206 >>> >>> Modified: >>> head/sys/kern/subr_bus.c >>> >>> Modified: head/sys/kern/subr_bus.c >>> >> ============================================================================== >>> --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) >>> +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) >>> @@ -260,36 +260,33 @@ enum { >>> static int >>> device_sysctl_handler(SYSCTL_HANDLER_ARGS) >>> { >>> + struct sbuf sb; >>> device_t dev = (device_t)arg1; >>> - const char *value; >>> - char *buf; >>> int error; >>> >>> - buf = NULL; >>> + sbuf_new_for_sysctl(&sb, NULL, 1024, req); >>> switch (arg2) { >>> case DEVICE_SYSCTL_DESC: >>> - value = dev->desc ? dev->desc : ""; >>> + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); >>> break; >>> case DEVICE_SYSCTL_DRIVER: >>> - value = dev->driver ? dev->driver->name : ""; >>> + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); >>> break; >>> case DEVICE_SYSCTL_LOCATION: >>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); >>> - bus_child_location_str(dev, buf, 1024); >>> + bus_child_location_sb(dev, &sb); >>> break; >>> case DEVICE_SYSCTL_PNPINFO: >>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); >>> - bus_child_pnpinfo_str(dev, buf, 1024); >>> + bus_child_pnpinfo_sb(dev, &sb); >>> break; >>> case DEVICE_SYSCTL_PARENT: >>> - value = dev->parent ? dev->parent->nameunit : ""; >>> + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); >>> break; >>> default: >>> + sbuf_delete(&sb); >>> return (EINVAL); >>> } >>> - error = SYSCTL_OUT_STR(req, value); >>> - if (buf != NULL) >>> - free(buf, M_BUS); >>> + error = sbuf_finish(&sb); >>> + sbuf_delete(&sb); >>> return (error); >>> } >>> >>> @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, >> CTLTYPE_STRUCT >>> | >>> static int >>> sysctl_devices(SYSCTL_HANDLER_ARGS) >>> { >>> + struct sbuf sb; >>> int *name = (int *)arg1; >>> u_int namelen = arg2; >>> int index; >>> device_t dev; >>> struct u_device *udev; >>> int error; >>> - char *walker, *ep; >>> >>> if (namelen != 2) >>> return (EINVAL); >>> @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) >>> udev->dv_devflags = dev->devflags; >>> udev->dv_flags = dev->flags; >>> udev->dv_state = dev->state; >>> - walker = udev->dv_fields; >>> - ep = walker + sizeof(udev->dv_fields); >>> -#define CP(src) \ >>> - if ((src) == NULL) \ >>> - *walker++ = '\0'; \ >>> - else { \ >>> - strlcpy(walker, (src), ep - walker); \ >>> - walker += strlen(walker) + 1; \ >>> - } \ >>> - if (walker >= ep) \ >>> - break; >>> - >>> - do { >>> - CP(dev->nameunit); >>> - CP(dev->desc); >>> - CP(dev->driver != NULL ? dev->driver->name : NULL); >>> - bus_child_pnpinfo_str(dev, walker, ep - walker); >>> - walker += strlen(walker) + 1; >>> - if (walker >= ep) >>> - break; >>> - bus_child_location_str(dev, walker, ep - walker); >>> - walker += strlen(walker) + 1; >>> - if (walker >= ep) >>> - break; >>> - *walker++ = '\0'; >>> - } while (0); >>> -#undef CP >>> - error = SYSCTL_OUT(req, udev, sizeof(*udev)); >>> + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), >> SBUF_FIXEDLEN); >>> + sbuf_cat(&sb, dev->nameunit); >>> + sbuf_putc(&sb, '\0'); >>> + sbuf_cat(&sb, dev->desc); >>> + sbuf_putc(&sb, '\0'); >>> + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); >>> + sbuf_putc(&sb, '\0'); >>> + bus_child_pnpinfo_sb(dev, &sb); >>> + sbuf_putc(&sb, '\0'); >>> + bus_child_location_sb(dev, &sb); >>> + sbuf_putc(&sb, '\0'); >>> + error = sbuf_finish(&sb); >>> + if (error == 0) >>> + error = SYSCTL_OUT(req, udev, sizeof(*udev)); >>> + sbuf_delete(&sb); >>> free(udev, M_BUS); >>> return (error); >>> } >>> >> >> >> -- >> Mateusz Guzik >> > From owner-svn-src-head@freebsd.org Sat Aug 29 11:03:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AD263D4A7D for ; Sat, 29 Aug 2020 11:03:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdtq62Mqpz4Jp7 for ; Sat, 29 Aug 2020 11:02:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf43.google.com with SMTP id l13so838243qvt.10 for ; Sat, 29 Aug 2020 04:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5JX5XGQxWbgwzF+Jxo6O+N3j3HLDuQezWZ2nsQfvtWk=; b=ZqxHqnb7DCkKWOMEiTdPwzJiTqwlURYoiVaG6BdvFmoGHUN3tRl6gYiCqLm2eRzYW/ HSQFGBrHi122mVdUOYAjWGK7PwKQROSYkHYcVE33Gf5gS/YFZMuE8Y7qkDPskIwisqeD +MReBMQFQQfFhTnEBAYBajGIzVqDjiT4FwYOl5++DI6Whys2y1hoVg9E71en750N6pvU S8M6QQ10c+PYkH94qAVJCEweG2oTBhTHwBJFlxl/sM+OtL289iUPWE5QnPjL+kYNv7Wn TSuFPV/UHeW5hT1vkfFzi0NHh4n6GTdCgvNoY7XFFxSta2xvK90nBBUAJ9YKcN1AkKra 8tWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5JX5XGQxWbgwzF+Jxo6O+N3j3HLDuQezWZ2nsQfvtWk=; b=MpkJSvaIar6GnE1aEFK1tvjcKe8z8S22ldcYfPXR97H4NEaUdFIdV7pLaJlFA41bSi 8fmdt0BaKNuMPV3nOgybC295g45osBvcEh/FoIhgZGhYjW1qDjcbCJx+HQGhloNGaQNv U8hi5klTHwMYmGowW0NOq2pNV80Oxx9v/nw33u97SO77feW/8m0peo/bXLbdDb4iI+ZO wvj/8u8ZV5u68P4DnikFrxsUtTJKfsHRKPOL4R/NVL8ghez6hwaoFw+SZbZSicyKew2X mAyW09wXdHa4me+AuHv4jY+beO4iVjiIrDi0ipRxYkwVXmRjmS8/XcQaYoAMbaUHhOZR HLlQ== X-Gm-Message-State: AOAM532yjUmapPJPzcZrgzERJY/h8Vh+xXtQJFxt++HzSPQ+wBxEZ9LL XmlaH4F3MpvOZoG7fORvwXzIWEOVXfkLofIm/c46MQ== X-Google-Smtp-Source: ABdhPJx4XX6rLB6pK+xyP0xl8ViiH2F3OylTPOayGhXvkVFvOxGe18MVE3VGrrswyrhkuNB6PvMdtvLlUTWq3hAJLMQ= X-Received: by 2002:a0c:b61c:: with SMTP id f28mr2455558qve.92.1598698976591; Sat, 29 Aug 2020 04:02:56 -0700 (PDT) MIME-Version: 1.0 References: <202008290430.07T4UCM4007928@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sat, 29 Aug 2020 05:02:45 -0600 Message-ID: Subject: Re: svn commit: r364946 - head/sys/kern To: meloun.michal@gmail.com Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Bdtq62Mqpz4Jp7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ZqxHqnb7; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f43) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.29 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.78)[-0.780]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-0.97)[-0.967]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.54)[-0.541]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f43:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:03:02 -0000 On Sat, Aug 29, 2020 at 4:38 AM Michal Meloun wrote: > > > On 29.08.2020 12:04, Warner Losh wrote: > > On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik wrote: > > > >> This crashes on boot for me: > >> > > > > I wasn't able to get it to crash on boot for me, but I was able to > recreate > > it. > It crashed on ofw based systems where some enumerated devices have not a > suitable driver, see: > --------------------------------------- > sysctl_devices: nameunit: root0, descs: System root bus, driver: root > sysctl_devices: nameunit: nexus0, descs: (null), driver: nexus > sysctl_devices: nameunit: ofwbus0, descs: Open Firmware Device Tree, > driver: ofwbus > sysctl_devices: nameunit: pcib0, descs: Nvidia Integrated PCI/PCI-E > Controller, driver: pcib > sysctl_devices: nameunit: simplebus0, descs: Flattened device tree > simple bus, driver: simplebus > sysctl_devices: nameunit: gic0, descs: ARM Generic Interrupt Controller, > driver: gic > sysctl_devices: nameunit: (null), descs: (null), driver: > sysctl_devices: nameunit: lic0, descs: (null), driver: lic > sysctl_devices: nameunit: (null), descs: (null), driver: > sysctl_devices: nameunit: car0, descs: Tegra Clock Driver, driver: car > .... > ---------------------------------------------------------------------- > > Fixed in r364949.Confirmed. > I think it didn't crash on boot for me because > > kldxref failed due to the segment thing so devmatch didn't run which > would > > have triggered this bug. devinfo did trigger a very similar crash, and > > r364949 fixes that crash. Even a new kldxref failed due to the too many > > segments thing, so I can't confirm that's what you hit, but I'm pretty > sure > > it is... > > > But there is another issue in device_sysctl_handler() (not analyzed yet): > root@tegra210:~ # sysctl dev.cpu. > dev.cpu.3.temperature: 50.5C > dev.cpu.3panic: sbuf_clear makes no sense on sbuf 0xffff00006f21a528 > with drain > cpuid = 2 > time = 1598696937 > KDB: stack backtrace: > db_trace_self() at db_fetch_ksymtab+0x164 > pc = 0xffff0000006787f4 lr = 0xffff000000153400 > sp = 0xffff00006f21a1b0 fp = 0xffff00006f21a3b0 > > db_fetch_ksymtab() at vpanic+0x198 > pc = 0xffff000000153400 lr = 0xffff00000036b274 > sp = 0xffff00006f21a3c0 fp = 0xffff00006f21a420 > > vpanic() at panic+0x44 > pc = 0xffff00000036b274 lr = 0xffff00000036b018 > sp = 0xffff00006f21a430 fp = 0xffff00006f21a4e0 > > panic() at sbuf_clear+0xa0 > pc = 0xffff00000036b018 lr = 0xffff0000003c17c8 > sp = 0xffff00006f21a4f0 fp = 0xffff00006f21a4f0 > > sbuf_clear() at sbuf_cpy+0x58 > pc = 0xffff0000003c17c8 lr = 0xffff0000003c1ff0 > sp = 0xffff00006f21a500 fp = 0xffff00006f21a500 > > sbuf_cpy() at _gone_in_dev+0x560 > pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 > sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 > > _gone_in_dev() at sbuf_new_for_sysctl+0x170 > pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 > sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 > > sbuf_new_for_sysctl() at kernel_sysctl+0x36c > pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c > sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 > This traceback is all kinds of crazy. sbuf_new_for_sysctl doesn't call _gone_in_dev(), which doesn't do sbuf stuff at all. And neither does it call sbuf_cpy(). Though I get a crash that looks like: Tracing pid 66442 tid 101464 td 0xfffffe02f47b7c00 kdb_enter() at kdb_enter+0x37/frame 0xfffffe02f4ae3740 vpanic() at vpanic+0x19e/frame 0xfffffe02f4ae3790 panic() at panic+0x43/frame 0xfffffe02f4ae37f0 sbuf_clear() at sbuf_clear+0xac/frame 0xfffffe02f4ae3800 sbuf_cpy() at sbuf_cpy+0x5a/frame 0xfffffe02f4ae3820 device_sysctl_handler() at device_sysctl_handler+0x133/frame 0xfffffe02f4ae38a0 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame 0xfffffe02f4ae38f0 sysctl_root() at sysctl_root+0x20a/frame 0xfffffe02f4ae3970 userland_sysctl() at userland_sysctl+0x17d/frame 0xfffffe02f4ae3a20 sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe02f4ae3ad0 amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe02f4ae3bf0 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe02f4ae3bf0 --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80042d50a, rsp = 0x7fffffffd458, rbp = 0x7fffffffd490 --- on a sysctl -a which I think makes more sense... I'll see if I can track it down... I think it's because sbuf_cpy does an unconditional clear, which triggers this assert, which is likely bogus for this case. sbuf_cat doesn't seem to have this issue... I'll confirm and commit. Warner > kernel_sysctl() at userland_sysctl+0xf4 > pc = 0xffff00000037b63c lr = 0xffff00000037bc5c > sp = 0xffff00006f21a640 fp = 0xffff00006f21a6d0 > > userland_sysctl() at sys___sysctl+0x68 > pc = 0xffff00000037bc5c lr = 0xffff00000037bb28 > sp = 0xffff00006f21a6e0 fp = 0xffff00006f21a790 > > sys___sysctl() at do_el0_sync+0x4e0 > pc = 0xffff00000037bb28 lr = 0xffff000000697918 > sp = 0xffff00006f21a7a0 fp = 0xffff00006f21a830 > > do_el0_sync() at handle_el0_sync+0x90 > pc = 0xffff000000697918 lr = 0xffff00000067aa24 > sp = 0xffff00006f21a840 fp = 0xffff00006f21a980 > > handle_el0_sync() at 0x4047764c > pc = 0xffff00000067aa24 lr = 0x000000004047764c > sp = 0xffff00006f21a990 fp = 0x0000ffffffffc250 > > KDB: enter: panic > [ thread pid 1263 tid 100092 ] > Stopped at 0x40477fb4: undefined 54000042 > > > Warner > > > > > > >> atal trap 12: page fault while in kernel mode > >> cpuid = 0; apic id = 00 > >> fault virtual address = 0x0 > >> fault code = supervisor read data, page not present > >> instruction pointer = 0x20:0xffffffff805b0a7f > >> stack pointer = 0x28:0xfffffe002366a7f0 > >> frame pointer = 0x28:0xfffffe002366a7f0 > >> code segment = base 0x0, limit 0xfffff, type 0x1b > >> = DPL 0, pres 1, long 1, def32 0, gran 1 > >> processor eflags = interrupt enabled, resume, IOPL = 0 > >> current process = 89 (devmatch) > >> trap number = 12 > >> panic: page fault > >> cpuid = 0 > >> time = 1598692135 > >> KDB: stack backtrace: > >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >> 0xfffffe002366a4a0 > >> vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 > >> panic() at panic+0x43/frame 0xfffffe002366a550 > >> trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 > >> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 > >> trap() at trap+0x27d/frame 0xfffffe002366a720 > >> calltrap() at calltrap+0x8/frame 0xfffffe002366a720 > >> --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp > >> = 0xfffffe002366a7f0 --- > >> strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 > >> sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 > >> sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 > >> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame > >> 0xfffffe002366a8f0 > >> sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 > >> userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 > >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 > >> amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 > >> fast_syscall_common() at fast_syscall_common+0xf8/frame > 0xfffffe002366abf0 > >> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp > >> = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- > >> KDB: enter: panic > >> [ thread pid 89 tid 100067 ] > >> Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) > >> > >> > >> On 8/29/20, Warner Losh wrote: > >>> Author: imp > >>> Date: Sat Aug 29 04:30:12 2020 > >>> New Revision: 364946 > >>> URL: https://svnweb.freebsd.org/changeset/base/364946 > >>> > >>> Log: > >>> Move to using sbuf for some sysctl in newbus > >>> > >>> Convert two different sysctl to using sbuf. First, for all the > default > >>> sysctls we implement for each device driver that's attached. This is > a > >>> pure sbuf conversion. > >>> > >>> Second, convert sysctl_devices to fill its buffer with sbuf rather > >>> than a hand-rolled crappy thing I wrote years ago. > >>> > >>> Reviewed by: cem, markj > >>> Differential Revision: https://reviews.freebsd.org/D26206 > >>> > >>> Modified: > >>> head/sys/kern/subr_bus.c > >>> > >>> Modified: head/sys/kern/subr_bus.c > >>> > >> > ============================================================================== > >>> --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) > >>> +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) > >>> @@ -260,36 +260,33 @@ enum { > >>> static int > >>> device_sysctl_handler(SYSCTL_HANDLER_ARGS) > >>> { > >>> + struct sbuf sb; > >>> device_t dev = (device_t)arg1; > >>> - const char *value; > >>> - char *buf; > >>> int error; > >>> > >>> - buf = NULL; > >>> + sbuf_new_for_sysctl(&sb, NULL, 1024, req); > >>> switch (arg2) { > >>> case DEVICE_SYSCTL_DESC: > >>> - value = dev->desc ? dev->desc : ""; > >>> + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); > >>> break; > >>> case DEVICE_SYSCTL_DRIVER: > >>> - value = dev->driver ? dev->driver->name : ""; > >>> + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); > >>> break; > >>> case DEVICE_SYSCTL_LOCATION: > >>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>> - bus_child_location_str(dev, buf, 1024); > >>> + bus_child_location_sb(dev, &sb); > >>> break; > >>> case DEVICE_SYSCTL_PNPINFO: > >>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>> - bus_child_pnpinfo_str(dev, buf, 1024); > >>> + bus_child_pnpinfo_sb(dev, &sb); > >>> break; > >>> case DEVICE_SYSCTL_PARENT: > >>> - value = dev->parent ? dev->parent->nameunit : ""; > >>> + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); > >>> break; > >>> default: > >>> + sbuf_delete(&sb); > >>> return (EINVAL); > >>> } > >>> - error = SYSCTL_OUT_STR(req, value); > >>> - if (buf != NULL) > >>> - free(buf, M_BUS); > >>> + error = sbuf_finish(&sb); > >>> + sbuf_delete(&sb); > >>> return (error); > >>> } > >>> > >>> @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, > >> CTLTYPE_STRUCT > >>> | > >>> static int > >>> sysctl_devices(SYSCTL_HANDLER_ARGS) > >>> { > >>> + struct sbuf sb; > >>> int *name = (int *)arg1; > >>> u_int namelen = arg2; > >>> int index; > >>> device_t dev; > >>> struct u_device *udev; > >>> int error; > >>> - char *walker, *ep; > >>> > >>> if (namelen != 2) > >>> return (EINVAL); > >>> @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) > >>> udev->dv_devflags = dev->devflags; > >>> udev->dv_flags = dev->flags; > >>> udev->dv_state = dev->state; > >>> - walker = udev->dv_fields; > >>> - ep = walker + sizeof(udev->dv_fields); > >>> -#define CP(src) \ > >>> - if ((src) == NULL) \ > >>> - *walker++ = '\0'; \ > >>> - else { \ > >>> - strlcpy(walker, (src), ep - walker); \ > >>> - walker += strlen(walker) + 1; \ > >>> - } \ > >>> - if (walker >= ep) \ > >>> - break; > >>> - > >>> - do { > >>> - CP(dev->nameunit); > >>> - CP(dev->desc); > >>> - CP(dev->driver != NULL ? dev->driver->name : NULL); > >>> - bus_child_pnpinfo_str(dev, walker, ep - walker); > >>> - walker += strlen(walker) + 1; > >>> - if (walker >= ep) > >>> - break; > >>> - bus_child_location_str(dev, walker, ep - walker); > >>> - walker += strlen(walker) + 1; > >>> - if (walker >= ep) > >>> - break; > >>> - *walker++ = '\0'; > >>> - } while (0); > >>> -#undef CP > >>> - error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>> + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), > >> SBUF_FIXEDLEN); > >>> + sbuf_cat(&sb, dev->nameunit); > >>> + sbuf_putc(&sb, '\0'); > >>> + sbuf_cat(&sb, dev->desc); > >>> + sbuf_putc(&sb, '\0'); > >>> + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); > >>> + sbuf_putc(&sb, '\0'); > >>> + bus_child_pnpinfo_sb(dev, &sb); > >>> + sbuf_putc(&sb, '\0'); > >>> + bus_child_location_sb(dev, &sb); > >>> + sbuf_putc(&sb, '\0'); > >>> + error = sbuf_finish(&sb); > >>> + if (error == 0) > >>> + error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>> + sbuf_delete(&sb); > >>> free(udev, M_BUS); > >>> return (error); > >>> } > >>> > >> > >> > >> -- > >> Mateusz Guzik > >> > > > From owner-svn-src-head@freebsd.org Sat Aug 29 11:04:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88BFB3D4C7C; Sat, 29 Aug 2020 11:04:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdtrn2pgPz4Jq5; Sat, 29 Aug 2020 11:04:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43BA924BA4; Sat, 29 Aug 2020 11:04:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TB4P2P055371; Sat, 29 Aug 2020 11:04:25 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TB4PHE055370; Sat, 29 Aug 2020 11:04:25 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008291104.07TB4PHE055370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 29 Aug 2020 11:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364950 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 364950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:04:25 -0000 Author: melifaro Date: Sat Aug 29 11:04:24 2020 New Revision: 364950 URL: https://svnweb.freebsd.org/changeset/base/364950 Log: Fix build with RADIX_MPATH. Reported by: Hartmann, O Modified: head/sys/net/route/route_ctl.c Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sat Aug 29 09:59:52 2020 (r364949) +++ head/sys/net/route/route_ctl.c Sat Aug 29 11:04:24 2020 (r364950) @@ -101,7 +101,7 @@ vnet_rtzone_init() { V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); } #ifdef VIMAGE @@ -310,6 +310,7 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in RIB_WLOCK(rnh); #ifdef RADIX_MPATH + netmask = info->rti_info[RTAX_NETMASK]; /* do not permit exactly the same dst/mask/gw pair */ if (rt_mpath_capable(rnh) && rt_mpath_conflict(rnh, rt, netmask)) { From owner-svn-src-head@freebsd.org Sat Aug 29 11:18:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BF993D5427; Sat, 29 Aug 2020 11:18:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdv8g2kHCz4KT8; Sat, 29 Aug 2020 11:18:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40C9624D47; Sat, 29 Aug 2020 11:18:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TBIBYK062384; Sat, 29 Aug 2020 11:18:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TBIBs3062383; Sat, 29 Aug 2020 11:18:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008291118.07TBIBs3062383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 11:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364951 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:18:11 -0000 Author: imp Date: Sat Aug 29 11:18:10 2020 New Revision: 364951 URL: https://svnweb.freebsd.org/changeset/base/364951 Log: Use sbuf_cat instead of sbuf_cpy sbuf_cpy doesn't work with sysctl sbufs because of the drain function. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 11:04:24 2020 (r364950) +++ head/sys/kern/subr_bus.c Sat Aug 29 11:18:10 2020 (r364951) @@ -267,10 +267,10 @@ device_sysctl_handler(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&sb, NULL, 1024, req); switch (arg2) { case DEVICE_SYSCTL_DESC: - sbuf_cpy(&sb, dev->desc ? dev->desc : ""); + sbuf_cat(&sb, dev->desc ? dev->desc : ""); break; case DEVICE_SYSCTL_DRIVER: - sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); + sbuf_cat(&sb, dev->driver ? dev->driver->name : ""); break; case DEVICE_SYSCTL_LOCATION: bus_child_location_sb(dev, &sb); @@ -279,7 +279,7 @@ device_sysctl_handler(SYSCTL_HANDLER_ARGS) bus_child_pnpinfo_sb(dev, &sb); break; case DEVICE_SYSCTL_PARENT: - sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); + sbuf_cat(&sb, dev->parent ? dev->parent->nameunit : ""); break; default: sbuf_delete(&sb); From owner-svn-src-head@freebsd.org Sat Aug 29 11:25:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1C673D5617; Sat, 29 Aug 2020 11:25:19 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdvJt3jQ3z4L5N; Sat, 29 Aug 2020 11:25:18 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id b79so1374676wmb.4; Sat, 29 Aug 2020 04:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gWhTosAX5BqH7KHV8hZ/BkWkRe470qZCELJXQtDT9WM=; b=O6R6DUmvqgkN8RVjjseIOGuE++/0FOqu27+LKI1VHBhCbBPb4dxKMe38CYv9JrVfF/ 0TJz8narsAWrIaRUI1WBR9k93CMgij4yscyBM5bh6TtpMei/P+sW+O6U96OjijAhS8V1 eeS+wuqiIThP/VMUGvx8RCIC/rHvMzi+SY22qM7LiibqIhuScleYWgNv9lNQiDFzwXOR EwDTDa56w5KntwG8AcD5CYshTi+suuyFMcn87RmCnQabia377eFr+fY5J9RyT+mSa5YE Sr296UcwDTEjXV4GRwLogshDFkcr2BzQ411nTPNjeaHEFysQnqjHT6RjSFM+UoLY87vA hC/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=gWhTosAX5BqH7KHV8hZ/BkWkRe470qZCELJXQtDT9WM=; b=EAYShP2p65fsjMren9HnDONiTxWrbgBPptytGGhmQMvtLyqiCQ16zg6ERJXhI/phAP OrKe0hzRYRzXu0kIB1kLH4DbcbO+D/b8UXj1lUnEVb3EHVI7ZDvKa/qhHg+K6VA43WQB 0+QqvKyRt0WAycKDXdH7O6r6G4qTLGuPYHi+oLYULZkazYVSfda5IdX033IaGNbYKszx PXlB+BE9WdkuewjEPwvMQuiLleRy6DlvIGEZEmRsE0xPmUf1qFSTQb9IfiPJZ2CzfPzt M/rXUdb+6jPEyJzmLSAungXP7JbYHGz9gNG/5AkuTs/R5fva2PR3h1Z/XItb+Y8zexDT Cgfw== X-Gm-Message-State: AOAM530MQRi9PpIoMpeJHfTHD1Ew0bO3JPYQpi36wy/QDnhY/U3wh8ST R70mhXs2/ti3rcPXSufj9NCYsFoE9pOpZA== X-Google-Smtp-Source: ABdhPJw4Fy4DqYosTfG6YtTP+4RYTd5w80fJBOOhof+G6eGU4nVg+r5rxbKfVhdDjw5A+RM0m+xd1Q== X-Received: by 2002:a1c:cc0d:: with SMTP id h13mr2783984wmb.44.1598700315514; Sat, 29 Aug 2020 04:25:15 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id r18sm3350559wrg.64.2020.08.29.04.25.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Aug 2020 04:25:14 -0700 (PDT) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r364946 - head/sys/kern To: Warner Losh Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head References: <202008290430.07T4UCM4007928@repo.freebsd.org> From: Michal Meloun Message-ID: <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> Date: Sat, 29 Aug 2020 13:25:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BdvJt3jQ3z4L5N X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=O6R6DUmv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.19 / 15.00]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.26)[-0.255]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.977]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.962]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::341:from]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:25:19 -0000 On 29.08.2020 13:02, Warner Losh wrote: > On Sat, Aug 29, 2020 at 4:38 AM Michal Meloun > wrote: > >> >> >> On 29.08.2020 12:04, Warner Losh wrote: >>> On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik wrote: >>> >>>> This crashes on boot for me: >>>> >>> >>> I wasn't able to get it to crash on boot for me, but I was able to >> recreate >>> it. >> It crashed on ofw based systems where some enumerated devices have not a >> suitable driver, see: >> --------------------------------------- >> sysctl_devices: nameunit: root0, descs: System root bus, driver: root >> sysctl_devices: nameunit: nexus0, descs: (null), driver: nexus >> sysctl_devices: nameunit: ofwbus0, descs: Open Firmware Device Tree, >> driver: ofwbus >> sysctl_devices: nameunit: pcib0, descs: Nvidia Integrated PCI/PCI-E >> Controller, driver: pcib >> sysctl_devices: nameunit: simplebus0, descs: Flattened device tree >> simple bus, driver: simplebus >> sysctl_devices: nameunit: gic0, descs: ARM Generic Interrupt Controller, >> driver: gic >> sysctl_devices: nameunit: (null), descs: (null), driver: >> sysctl_devices: nameunit: lic0, descs: (null), driver: lic >> sysctl_devices: nameunit: (null), descs: (null), driver: >> sysctl_devices: nameunit: car0, descs: Tegra Clock Driver, driver: car >> .... >> ---------------------------------------------------------------------- >>> Fixed in r364949.Confirmed. >> I think it didn't crash on boot for me because >>> kldxref failed due to the segment thing so devmatch didn't run which >> would >>> have triggered this bug. devinfo did trigger a very similar crash, and >>> r364949 fixes that crash. Even a new kldxref failed due to the too many >>> segments thing, so I can't confirm that's what you hit, but I'm pretty >> sure >>> it is... >>> >> But there is another issue in device_sysctl_handler() (not analyzed yet): >> root@tegra210:~ # sysctl dev.cpu. >> dev.cpu.3.temperature: 50.5C >> dev.cpu.3panic: sbuf_clear makes no sense on sbuf 0xffff00006f21a528 >> with drain >> cpuid = 2 >> time = 1598696937 >> KDB: stack backtrace: >> db_trace_self() at db_fetch_ksymtab+0x164 >> pc = 0xffff0000006787f4 lr = 0xffff000000153400 >> sp = 0xffff00006f21a1b0 fp = 0xffff00006f21a3b0 >> >> db_fetch_ksymtab() at vpanic+0x198 >> pc = 0xffff000000153400 lr = 0xffff00000036b274 >> sp = 0xffff00006f21a3c0 fp = 0xffff00006f21a420 >> >> vpanic() at panic+0x44 >> pc = 0xffff00000036b274 lr = 0xffff00000036b018 >> sp = 0xffff00006f21a430 fp = 0xffff00006f21a4e0 >> >> panic() at sbuf_clear+0xa0 >> pc = 0xffff00000036b018 lr = 0xffff0000003c17c8 >> sp = 0xffff00006f21a4f0 fp = 0xffff00006f21a4f0 >> >> sbuf_clear() at sbuf_cpy+0x58 >> pc = 0xffff0000003c17c8 lr = 0xffff0000003c1ff0 >> sp = 0xffff00006f21a500 fp = 0xffff00006f21a500 >> >> sbuf_cpy() at _gone_in_dev+0x560 >> pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 >> sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 >> >> _gone_in_dev() at sbuf_new_for_sysctl+0x170 >> pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 >> sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 >> >> sbuf_new_for_sysctl() at kernel_sysctl+0x36c >> pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c >> sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 >> > > This traceback is all kinds of crazy. sbuf_new_for_sysctl doesn't call > _gone_in_dev(), which doesn't do sbuf stuff at all. And neither does it > call sbuf_cpy(). Though I get a crash that looks like: > Tracing pid 66442 tid 101464 td 0xfffffe02f47b7c00 > kdb_enter() at kdb_enter+0x37/frame 0xfffffe02f4ae3740 > vpanic() at vpanic+0x19e/frame 0xfffffe02f4ae3790 > panic() at panic+0x43/frame 0xfffffe02f4ae37f0 > sbuf_clear() at sbuf_clear+0xac/frame 0xfffffe02f4ae3800 > sbuf_cpy() at sbuf_cpy+0x5a/frame 0xfffffe02f4ae3820 > device_sysctl_handler() at device_sysctl_handler+0x133/frame > 0xfffffe02f4ae38a0 > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame > 0xfffffe02f4ae38f0 > sysctl_root() at sysctl_root+0x20a/frame 0xfffffe02f4ae3970 > userland_sysctl() at userland_sysctl+0x17d/frame 0xfffffe02f4ae3a20 > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe02f4ae3ad0 > amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe02f4ae3bf0 > fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe02f4ae3bf0 > --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80042d50a, rsp = > 0x7fffffffd458, rbp = 0x7fffffffd490 --- > > on a sysctl -a which I think makes more sense... I'll see if I can track > it down... I think it's because sbuf_cpy does an unconditional clear, which > triggers this assert, which is likely bogus for this case. sbuf_cat doesn't > seem to have this issue... I'll confirm and commit. > > Warner Yeah, sorry. Local symbols are not available for netbooted kernel :(. And i csan confirm that problem is cause by using sbuf_cpy() on sbuf allocated by sbuf_new_for_sysctl() (thus with drain handler) in device_sysctl_handler(). But pure replacing sbuf_cpy() by sbuf_cat() gives me another panic: panic: Assertion (sb->s_flags & SBUF_INCLUDENUL) == 0 failed at /usr2/Meloun/git/pmap/sys/kern/subr_bus.c:4936 (still as respose for sysctl dev.cpu) Michal > >> kernel_sysctl() at userland_sysctl+0xf4 >> pc = 0xffff00000037b63c lr = 0xffff00000037bc5c >> sp = 0xffff00006f21a640 fp = 0xffff00006f21a6d0 >> >> userland_sysctl() at sys___sysctl+0x68 >> pc = 0xffff00000037bc5c lr = 0xffff00000037bb28 >> sp = 0xffff00006f21a6e0 fp = 0xffff00006f21a790 >> >> sys___sysctl() at do_el0_sync+0x4e0 >> pc = 0xffff00000037bb28 lr = 0xffff000000697918 >> sp = 0xffff00006f21a7a0 fp = 0xffff00006f21a830 >> >> do_el0_sync() at handle_el0_sync+0x90 >> pc = 0xffff000000697918 lr = 0xffff00000067aa24 >> sp = 0xffff00006f21a840 fp = 0xffff00006f21a980 >> >> handle_el0_sync() at 0x4047764c >> pc = 0xffff00000067aa24 lr = 0x000000004047764c >> sp = 0xffff00006f21a990 fp = 0x0000ffffffffc250 >> >> KDB: enter: panic >> [ thread pid 1263 tid 100092 ] >> Stopped at 0x40477fb4: undefined 54000042 >> >>> Warner >>> >> >>> >>>> atal trap 12: page fault while in kernel mode >>>> cpuid = 0; apic id = 00 >>>> fault virtual address = 0x0 >>>> fault code = supervisor read data, page not present >>>> instruction pointer = 0x20:0xffffffff805b0a7f >>>> stack pointer = 0x28:0xfffffe002366a7f0 >>>> frame pointer = 0x28:0xfffffe002366a7f0 >>>> code segment = base 0x0, limit 0xfffff, type 0x1b >>>> = DPL 0, pres 1, long 1, def32 0, gran 1 >>>> processor eflags = interrupt enabled, resume, IOPL = 0 >>>> current process = 89 (devmatch) >>>> trap number = 12 >>>> panic: page fault >>>> cpuid = 0 >>>> time = 1598692135 >>>> KDB: stack backtrace: >>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>> 0xfffffe002366a4a0 >>>> vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 >>>> panic() at panic+0x43/frame 0xfffffe002366a550 >>>> trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 >>>> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 >>>> trap() at trap+0x27d/frame 0xfffffe002366a720 >>>> calltrap() at calltrap+0x8/frame 0xfffffe002366a720 >>>> --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp >>>> = 0xfffffe002366a7f0 --- >>>> strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 >>>> sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 >>>> sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 >>>> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame >>>> 0xfffffe002366a8f0 >>>> sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 >>>> userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 >>>> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 >>>> amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 >>>> fast_syscall_common() at fast_syscall_common+0xf8/frame >> 0xfffffe002366abf0 >>>> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp >>>> = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- >>>> KDB: enter: panic >>>> [ thread pid 89 tid 100067 ] >>>> Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) >>>> >>>> >>>> On 8/29/20, Warner Losh wrote: >>>>> Author: imp >>>>> Date: Sat Aug 29 04:30:12 2020 >>>>> New Revision: 364946 >>>>> URL: https://svnweb.freebsd.org/changeset/base/364946 >>>>> >>>>> Log: >>>>> Move to using sbuf for some sysctl in newbus >>>>> >>>>> Convert two different sysctl to using sbuf. First, for all the >> default >>>>> sysctls we implement for each device driver that's attached. This is >> a >>>>> pure sbuf conversion. >>>>> >>>>> Second, convert sysctl_devices to fill its buffer with sbuf rather >>>>> than a hand-rolled crappy thing I wrote years ago. >>>>> >>>>> Reviewed by: cem, markj >>>>> Differential Revision: https://reviews.freebsd.org/D26206 >>>>> >>>>> Modified: >>>>> head/sys/kern/subr_bus.c >>>>> >>>>> Modified: head/sys/kern/subr_bus.c >>>>> >>>> >> ============================================================================== >>>>> --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) >>>>> +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 (r364946) >>>>> @@ -260,36 +260,33 @@ enum { >>>>> static int >>>>> device_sysctl_handler(SYSCTL_HANDLER_ARGS) >>>>> { >>>>> + struct sbuf sb; >>>>> device_t dev = (device_t)arg1; >>>>> - const char *value; >>>>> - char *buf; >>>>> int error; >>>>> >>>>> - buf = NULL; >>>>> + sbuf_new_for_sysctl(&sb, NULL, 1024, req); >>>>> switch (arg2) { >>>>> case DEVICE_SYSCTL_DESC: >>>>> - value = dev->desc ? dev->desc : ""; >>>>> + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); >>>>> break; >>>>> case DEVICE_SYSCTL_DRIVER: >>>>> - value = dev->driver ? dev->driver->name : ""; >>>>> + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); >>>>> break; >>>>> case DEVICE_SYSCTL_LOCATION: >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); >>>>> - bus_child_location_str(dev, buf, 1024); >>>>> + bus_child_location_sb(dev, &sb); >>>>> break; >>>>> case DEVICE_SYSCTL_PNPINFO: >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); >>>>> - bus_child_pnpinfo_str(dev, buf, 1024); >>>>> + bus_child_pnpinfo_sb(dev, &sb); >>>>> break; >>>>> case DEVICE_SYSCTL_PARENT: >>>>> - value = dev->parent ? dev->parent->nameunit : ""; >>>>> + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : ""); >>>>> break; >>>>> default: >>>>> + sbuf_delete(&sb); >>>>> return (EINVAL); >>>>> } >>>>> - error = SYSCTL_OUT_STR(req, value); >>>>> - if (buf != NULL) >>>>> - free(buf, M_BUS); >>>>> + error = sbuf_finish(&sb); >>>>> + sbuf_delete(&sb); >>>>> return (error); >>>>> } >>>>> >>>>> @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, >>>> CTLTYPE_STRUCT >>>>> | >>>>> static int >>>>> sysctl_devices(SYSCTL_HANDLER_ARGS) >>>>> { >>>>> + struct sbuf sb; >>>>> int *name = (int *)arg1; >>>>> u_int namelen = arg2; >>>>> int index; >>>>> device_t dev; >>>>> struct u_device *udev; >>>>> int error; >>>>> - char *walker, *ep; >>>>> >>>>> if (namelen != 2) >>>>> return (EINVAL); >>>>> @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) >>>>> udev->dv_devflags = dev->devflags; >>>>> udev->dv_flags = dev->flags; >>>>> udev->dv_state = dev->state; >>>>> - walker = udev->dv_fields; >>>>> - ep = walker + sizeof(udev->dv_fields); >>>>> -#define CP(src) \ >>>>> - if ((src) == NULL) \ >>>>> - *walker++ = '\0'; \ >>>>> - else { \ >>>>> - strlcpy(walker, (src), ep - walker); \ >>>>> - walker += strlen(walker) + 1; \ >>>>> - } \ >>>>> - if (walker >= ep) \ >>>>> - break; >>>>> - >>>>> - do { >>>>> - CP(dev->nameunit); >>>>> - CP(dev->desc); >>>>> - CP(dev->driver != NULL ? dev->driver->name : NULL); >>>>> - bus_child_pnpinfo_str(dev, walker, ep - walker); >>>>> - walker += strlen(walker) + 1; >>>>> - if (walker >= ep) >>>>> - break; >>>>> - bus_child_location_str(dev, walker, ep - walker); >>>>> - walker += strlen(walker) + 1; >>>>> - if (walker >= ep) >>>>> - break; >>>>> - *walker++ = '\0'; >>>>> - } while (0); >>>>> -#undef CP >>>>> - error = SYSCTL_OUT(req, udev, sizeof(*udev)); >>>>> + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), >>>> SBUF_FIXEDLEN); >>>>> + sbuf_cat(&sb, dev->nameunit); >>>>> + sbuf_putc(&sb, '\0'); >>>>> + sbuf_cat(&sb, dev->desc); >>>>> + sbuf_putc(&sb, '\0'); >>>>> + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); >>>>> + sbuf_putc(&sb, '\0'); >>>>> + bus_child_pnpinfo_sb(dev, &sb); >>>>> + sbuf_putc(&sb, '\0'); >>>>> + bus_child_location_sb(dev, &sb); >>>>> + sbuf_putc(&sb, '\0'); >>>>> + error = sbuf_finish(&sb); >>>>> + if (error == 0) >>>>> + error = SYSCTL_OUT(req, udev, sizeof(*udev)); >>>>> + sbuf_delete(&sb); >>>>> free(udev, M_BUS); >>>>> return (error); >>>>> } >>>>> >>>> >>>> >>>> -- >>>> Mateusz Guzik >>>> >>> >> > From owner-svn-src-head@freebsd.org Sat Aug 29 11:34:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E65173D5BCA for ; Sat, 29 Aug 2020 11:34:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdvWl6lfFz4LRy for ; Sat, 29 Aug 2020 11:34:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id d27so1560242qtg.4 for ; Sat, 29 Aug 2020 04:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o3jXBz5nDIIFj1L25ZpT0GFXgwQPFG2rTkKUrxndlNc=; b=mK03SkZsVRQWQp79F+HjPDFtIYikCaZmX5hf1/yVxfDE0sQxccMoMg0biShxbttm2y z0KKlObT1tOm+08Wcq44Y7hPZ+arq3Eh3dkoGKOjj2lnVMMcZwPb6FrFu/u/Gr1A01L9 V9BDs1syUwkd+aBgHqremThTrcIOKI/TTBie6NBTqM3T8fLbs6+VoR0btoQhXv2ONmR8 l9bOMeuIAxQRwDoWYgCVyOPN458fzQpmHbbdPi2xXSPQgV3DG9tKxmP7G8y9JBW2qk36 Nb1AbmHAelzrAYvmjvQi46edCIErH7mJPMPT+jUQVOtLRy34EoFAcxDGlSQa6Gs59MZu 29TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o3jXBz5nDIIFj1L25ZpT0GFXgwQPFG2rTkKUrxndlNc=; b=igoa3C7XgvOVHrMiQgFDffmyl2fd+A3wxO+ZiurRdHn+xINyN6+mX/UPQ47mld9+9h 9Jczmz2ZYmI2l5O4kDxBN4QqiEhk1LaORDwM0b/GIithmPkz+1Pi3FPgcg8PIDn44sWG WJ+kQL00JkdwsXiCSXtaPdgGldSqehFsrrhEKojU4ODGDv1Hg6eb9clTqh6Mm0z+IZ3G VKsNhzEXJFJz65/l9hdvRB0Xidegv+o0POLhfPtj23pSdADs2j3PI+E4COPP3jODJwvG AzZFbD+ebUtLzdcPMU6G7Hernsr5OKttXTFu3iaSy0G0GzSeKti4xGWGC/uxxrqqb/ay t9UQ== X-Gm-Message-State: AOAM530vsOqJJ3NWS8NhN/l+NEQRa4JuuTFfH5D6baUXfCzNDTwDrQwi o1XAIno8J94shXQu9JpoL6OsnOIPhrXZ1FDVQ0qtUg== X-Google-Smtp-Source: ABdhPJwMwO0kS+RyMpvWY9xALIYh3+Sn874NDIe4svZvS3EKXW8DVEhl5ZXRmycrSDiCqsEe9Ppj4KrT0cF9A3qfwN4= X-Received: by 2002:ac8:47c8:: with SMTP id d8mr5073129qtr.32.1598700882798; Sat, 29 Aug 2020 04:34:42 -0700 (PDT) MIME-Version: 1.0 References: <202008290430.07T4UCM4007928@repo.freebsd.org> <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> In-Reply-To: <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> From: Warner Losh Date: Sat, 29 Aug 2020 05:34:31 -0600 Message-ID: Subject: Re: svn commit: r364946 - head/sys/kern To: meloun.michal@gmail.com Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BdvWl6lfFz4LRy X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=mK03SkZs; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.57 / 15.00]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.78)[-0.780]; NEURAL_HAM_LONG(-0.97)[-0.967]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.82)[-0.825]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:34:45 -0000 On Sat, Aug 29, 2020 at 5:25 AM Michal Meloun wrote: > > > On 29.08.2020 13:02, Warner Losh wrote: > > On Sat, Aug 29, 2020 at 4:38 AM Michal Meloun > > wrote: > > > >> > >> > >> On 29.08.2020 12:04, Warner Losh wrote: > >>> On Sat, Aug 29, 2020 at 1:09 AM Mateusz Guzik > wrote: > >>> > >>>> This crashes on boot for me: > >>>> > >>> > >>> I wasn't able to get it to crash on boot for me, but I was able to > >> recreate > >>> it. > >> It crashed on ofw based systems where some enumerated devices have not a > >> suitable driver, see: > >> --------------------------------------- > >> sysctl_devices: nameunit: root0, descs: System root bus, driver: root > >> sysctl_devices: nameunit: nexus0, descs: (null), driver: nexus > >> sysctl_devices: nameunit: ofwbus0, descs: Open Firmware Device Tree, > >> driver: ofwbus > >> sysctl_devices: nameunit: pcib0, descs: Nvidia Integrated PCI/PCI-E > >> Controller, driver: pcib > >> sysctl_devices: nameunit: simplebus0, descs: Flattened device tree > >> simple bus, driver: simplebus > >> sysctl_devices: nameunit: gic0, descs: ARM Generic Interrupt Controller, > >> driver: gic > >> sysctl_devices: nameunit: (null), descs: (null), driver: > >> sysctl_devices: nameunit: lic0, descs: (null), driver: lic > >> sysctl_devices: nameunit: (null), descs: (null), driver: > >> sysctl_devices: nameunit: car0, descs: Tegra Clock Driver, driver: car > >> .... > >> ---------------------------------------------------------------------- > >>> Fixed in r364949.Confirmed. > >> I think it didn't crash on boot for me because > >>> kldxref failed due to the segment thing so devmatch didn't run which > >> would > >>> have triggered this bug. devinfo did trigger a very similar crash, and > >>> r364949 fixes that crash. Even a new kldxref failed due to the too many > >>> segments thing, so I can't confirm that's what you hit, but I'm pretty > >> sure > >>> it is... > >>> > >> But there is another issue in device_sysctl_handler() (not analyzed > yet): > >> root@tegra210:~ # sysctl dev.cpu. > >> dev.cpu.3.temperature: 50.5C > >> dev.cpu.3panic: sbuf_clear makes no sense on sbuf 0xffff00006f21a528 > >> with drain > >> cpuid = 2 > >> time = 1598696937 > >> KDB: stack backtrace: > >> db_trace_self() at db_fetch_ksymtab+0x164 > >> pc = 0xffff0000006787f4 lr = 0xffff000000153400 > >> sp = 0xffff00006f21a1b0 fp = 0xffff00006f21a3b0 > >> > >> db_fetch_ksymtab() at vpanic+0x198 > >> pc = 0xffff000000153400 lr = 0xffff00000036b274 > >> sp = 0xffff00006f21a3c0 fp = 0xffff00006f21a420 > >> > >> vpanic() at panic+0x44 > >> pc = 0xffff00000036b274 lr = 0xffff00000036b018 > >> sp = 0xffff00006f21a430 fp = 0xffff00006f21a4e0 > >> > >> panic() at sbuf_clear+0xa0 > >> pc = 0xffff00000036b018 lr = 0xffff0000003c17c8 > >> sp = 0xffff00006f21a4f0 fp = 0xffff00006f21a4f0 > >> > >> sbuf_clear() at sbuf_cpy+0x58 > >> pc = 0xffff0000003c17c8 lr = 0xffff0000003c1ff0 > >> sp = 0xffff00006f21a500 fp = 0xffff00006f21a500 > >> > >> sbuf_cpy() at _gone_in_dev+0x560 > >> pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 > >> sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 > >> > >> _gone_in_dev() at sbuf_new_for_sysctl+0x170 > >> pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 > >> sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 > >> > >> sbuf_new_for_sysctl() at kernel_sysctl+0x36c > >> pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c > >> sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 > >> > > > > This traceback is all kinds of crazy. sbuf_new_for_sysctl doesn't call > > _gone_in_dev(), which doesn't do sbuf stuff at all. And neither does it > > call sbuf_cpy(). Though I get a crash that looks like: > > Tracing pid 66442 tid 101464 td 0xfffffe02f47b7c00 > > kdb_enter() at kdb_enter+0x37/frame 0xfffffe02f4ae3740 > > vpanic() at vpanic+0x19e/frame 0xfffffe02f4ae3790 > > panic() at panic+0x43/frame 0xfffffe02f4ae37f0 > > sbuf_clear() at sbuf_clear+0xac/frame 0xfffffe02f4ae3800 > > sbuf_cpy() at sbuf_cpy+0x5a/frame 0xfffffe02f4ae3820 > > device_sysctl_handler() at device_sysctl_handler+0x133/frame > > 0xfffffe02f4ae38a0 > > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame > > 0xfffffe02f4ae38f0 > > sysctl_root() at sysctl_root+0x20a/frame 0xfffffe02f4ae3970 > > userland_sysctl() at userland_sysctl+0x17d/frame 0xfffffe02f4ae3a20 > > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe02f4ae3ad0 > > amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe02f4ae3bf0 > > fast_syscall_common() at fast_syscall_common+0xf8/frame > 0xfffffe02f4ae3bf0 > > --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80042d50a, rsp = > > 0x7fffffffd458, rbp = 0x7fffffffd490 --- > > > > on a sysctl -a which I think makes more sense... I'll see if I can track > > it down... I think it's because sbuf_cpy does an unconditional clear, > which > > triggers this assert, which is likely bogus for this case. sbuf_cat > doesn't > > seem to have this issue... I'll confirm and commit. > > > > Warner > > Yeah, sorry. Local symbols are not available for netbooted kernel :(. > And i csan confirm that problem is cause by using sbuf_cpy() on sbuf > allocated by sbuf_new_for_sysctl() (thus with drain handler) in > device_sysctl_handler(). But pure replacing sbuf_cpy() by sbuf_cat() > gives me another panic: > panic: Assertion (sb->s_flags & SBUF_INCLUDENUL) == 0 failed at > /usr2/Meloun/git/pmap/sys/kern/subr_bus.c:4936 > (still as respose for sysctl dev.cpu) > OK. My bouncer system here has something wrong with /, but I changed the sbuf_cpy to sbuf_cat. Can you confirm that it works for you? Warner > > > > > >> kernel_sysctl() at userland_sysctl+0xf4 > >> pc = 0xffff00000037b63c lr = 0xffff00000037bc5c > >> sp = 0xffff00006f21a640 fp = 0xffff00006f21a6d0 > >> > >> userland_sysctl() at sys___sysctl+0x68 > >> pc = 0xffff00000037bc5c lr = 0xffff00000037bb28 > >> sp = 0xffff00006f21a6e0 fp = 0xffff00006f21a790 > >> > >> sys___sysctl() at do_el0_sync+0x4e0 > >> pc = 0xffff00000037bb28 lr = 0xffff000000697918 > >> sp = 0xffff00006f21a7a0 fp = 0xffff00006f21a830 > >> > >> do_el0_sync() at handle_el0_sync+0x90 > >> pc = 0xffff000000697918 lr = 0xffff00000067aa24 > >> sp = 0xffff00006f21a840 fp = 0xffff00006f21a980 > >> > >> handle_el0_sync() at 0x4047764c > >> pc = 0xffff00000067aa24 lr = 0x000000004047764c > >> sp = 0xffff00006f21a990 fp = 0x0000ffffffffc250 > >> > >> KDB: enter: panic > >> [ thread pid 1263 tid 100092 ] > >> Stopped at 0x40477fb4: undefined 54000042 > >> > >>> Warner > >>> > >> > >>> > >>>> atal trap 12: page fault while in kernel mode > >>>> cpuid = 0; apic id = 00 > >>>> fault virtual address = 0x0 > >>>> fault code = supervisor read data, page not present > >>>> instruction pointer = 0x20:0xffffffff805b0a7f > >>>> stack pointer = 0x28:0xfffffe002366a7f0 > >>>> frame pointer = 0x28:0xfffffe002366a7f0 > >>>> code segment = base 0x0, limit 0xfffff, type 0x1b > >>>> = DPL 0, pres 1, long 1, def32 0, gran 1 > >>>> processor eflags = interrupt enabled, resume, IOPL = 0 > >>>> current process = 89 (devmatch) > >>>> trap number = 12 > >>>> panic: page fault > >>>> cpuid = 0 > >>>> time = 1598692135 > >>>> KDB: stack backtrace: > >>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > >>>> 0xfffffe002366a4a0 > >>>> vpanic() at vpanic+0x182/frame 0xfffffe002366a4f0 > >>>> panic() at panic+0x43/frame 0xfffffe002366a550 > >>>> trap_fatal() at trap_fatal+0x387/frame 0xfffffe002366a5b0 > >>>> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe002366a610 > >>>> trap() at trap+0x27d/frame 0xfffffe002366a720 > >>>> calltrap() at calltrap+0x8/frame 0xfffffe002366a720 > >>>> --- trap 0xc, rip = 0xffffffff805b0a7f, rsp = 0xfffffe002366a7f0, rbp > >>>> = 0xfffffe002366a7f0 --- > >>>> strlen() at strlen+0x1f/frame 0xfffffe002366a7f0 > >>>> sbuf_cat() at sbuf_cat+0x15/frame 0xfffffe002366a810 > >>>> sysctl_devices() at sysctl_devices+0x104/frame 0xfffffe002366a8a0 > >>>> sysctl_root_handler_locked() at sysctl_root_handler_locked+0x91/frame > >>>> 0xfffffe002366a8f0 > >>>> sysctl_root() at sysctl_root+0x249/frame 0xfffffe002366a970 > >>>> userland_sysctl() at userland_sysctl+0x170/frame 0xfffffe002366aa20 > >>>> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe002366aad0 > >>>> amd64_syscall() at amd64_syscall+0x10c/frame 0xfffffe002366abf0 > >>>> fast_syscall_common() at fast_syscall_common+0xf8/frame > >> 0xfffffe002366abf0 > >>>> --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80041c0ea, rsp > >>>> = 0x7fffffffda78, rbp = 0x7fffffffdab0 --- > >>>> KDB: enter: panic > >>>> [ thread pid 89 tid 100067 ] > >>>> Stopped at kdb_enter+0x37: movq $0,0x7e2616(%rip) > >>>> > >>>> > >>>> On 8/29/20, Warner Losh wrote: > >>>>> Author: imp > >>>>> Date: Sat Aug 29 04:30:12 2020 > >>>>> New Revision: 364946 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/364946 > >>>>> > >>>>> Log: > >>>>> Move to using sbuf for some sysctl in newbus > >>>>> > >>>>> Convert two different sysctl to using sbuf. First, for all the > >> default > >>>>> sysctls we implement for each device driver that's attached. This > is > >> a > >>>>> pure sbuf conversion. > >>>>> > >>>>> Second, convert sysctl_devices to fill its buffer with sbuf rather > >>>>> than a hand-rolled crappy thing I wrote years ago. > >>>>> > >>>>> Reviewed by: cem, markj > >>>>> Differential Revision: https://reviews.freebsd.org/D26206 > >>>>> > >>>>> Modified: > >>>>> head/sys/kern/subr_bus.c > >>>>> > >>>>> Modified: head/sys/kern/subr_bus.c > >>>>> > >>>> > >> > ============================================================================== > >>>>> --- head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 > (r364945) > >>>>> +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:12 2020 > (r364946) > >>>>> @@ -260,36 +260,33 @@ enum { > >>>>> static int > >>>>> device_sysctl_handler(SYSCTL_HANDLER_ARGS) > >>>>> { > >>>>> + struct sbuf sb; > >>>>> device_t dev = (device_t)arg1; > >>>>> - const char *value; > >>>>> - char *buf; > >>>>> int error; > >>>>> > >>>>> - buf = NULL; > >>>>> + sbuf_new_for_sysctl(&sb, NULL, 1024, req); > >>>>> switch (arg2) { > >>>>> case DEVICE_SYSCTL_DESC: > >>>>> - value = dev->desc ? dev->desc : ""; > >>>>> + sbuf_cpy(&sb, dev->desc ? dev->desc : ""); > >>>>> break; > >>>>> case DEVICE_SYSCTL_DRIVER: > >>>>> - value = dev->driver ? dev->driver->name : ""; > >>>>> + sbuf_cpy(&sb, dev->driver ? dev->driver->name : ""); > >>>>> break; > >>>>> case DEVICE_SYSCTL_LOCATION: > >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>>>> - bus_child_location_str(dev, buf, 1024); > >>>>> + bus_child_location_sb(dev, &sb); > >>>>> break; > >>>>> case DEVICE_SYSCTL_PNPINFO: > >>>>> - value = buf = malloc(1024, M_BUS, M_WAITOK | M_ZERO); > >>>>> - bus_child_pnpinfo_str(dev, buf, 1024); > >>>>> + bus_child_pnpinfo_sb(dev, &sb); > >>>>> break; > >>>>> case DEVICE_SYSCTL_PARENT: > >>>>> - value = dev->parent ? dev->parent->nameunit : ""; > >>>>> + sbuf_cpy(&sb, dev->parent ? dev->parent->nameunit : > ""); > >>>>> break; > >>>>> default: > >>>>> + sbuf_delete(&sb); > >>>>> return (EINVAL); > >>>>> } > >>>>> - error = SYSCTL_OUT_STR(req, value); > >>>>> - if (buf != NULL) > >>>>> - free(buf, M_BUS); > >>>>> + error = sbuf_finish(&sb); > >>>>> + sbuf_delete(&sb); > >>>>> return (error); > >>>>> } > >>>>> > >>>>> @@ -5464,13 +5461,13 @@ SYSCTL_PROC(_hw_bus, OID_AUTO, info, > >>>> CTLTYPE_STRUCT > >>>>> | > >>>>> static int > >>>>> sysctl_devices(SYSCTL_HANDLER_ARGS) > >>>>> { > >>>>> + struct sbuf sb; > >>>>> int *name = (int *)arg1; > >>>>> u_int namelen = arg2; > >>>>> int index; > >>>>> device_t dev; > >>>>> struct u_device *udev; > >>>>> int error; > >>>>> - char *walker, *ep; > >>>>> > >>>>> if (namelen != 2) > >>>>> return (EINVAL); > >>>>> @@ -5501,34 +5498,21 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) > >>>>> udev->dv_devflags = dev->devflags; > >>>>> udev->dv_flags = dev->flags; > >>>>> udev->dv_state = dev->state; > >>>>> - walker = udev->dv_fields; > >>>>> - ep = walker + sizeof(udev->dv_fields); > >>>>> -#define CP(src) \ > >>>>> - if ((src) == NULL) \ > >>>>> - *walker++ = '\0'; \ > >>>>> - else { \ > >>>>> - strlcpy(walker, (src), ep - walker); \ > >>>>> - walker += strlen(walker) + 1; \ > >>>>> - } \ > >>>>> - if (walker >= ep) \ > >>>>> - break; > >>>>> - > >>>>> - do { > >>>>> - CP(dev->nameunit); > >>>>> - CP(dev->desc); > >>>>> - CP(dev->driver != NULL ? dev->driver->name : NULL); > >>>>> - bus_child_pnpinfo_str(dev, walker, ep - walker); > >>>>> - walker += strlen(walker) + 1; > >>>>> - if (walker >= ep) > >>>>> - break; > >>>>> - bus_child_location_str(dev, walker, ep - walker); > >>>>> - walker += strlen(walker) + 1; > >>>>> - if (walker >= ep) > >>>>> - break; > >>>>> - *walker++ = '\0'; > >>>>> - } while (0); > >>>>> -#undef CP > >>>>> - error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>>>> + sbuf_new(&sb, udev->dv_fields, sizeof(udev->dv_fields), > >>>> SBUF_FIXEDLEN); > >>>>> + sbuf_cat(&sb, dev->nameunit); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + sbuf_cat(&sb, dev->desc); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + sbuf_cat(&sb, dev->driver != NULL ? dev->driver->name : '\0'); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + bus_child_pnpinfo_sb(dev, &sb); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + bus_child_location_sb(dev, &sb); > >>>>> + sbuf_putc(&sb, '\0'); > >>>>> + error = sbuf_finish(&sb); > >>>>> + if (error == 0) > >>>>> + error = SYSCTL_OUT(req, udev, sizeof(*udev)); > >>>>> + sbuf_delete(&sb); > >>>>> free(udev, M_BUS); > >>>>> return (error); > >>>>> } > >>>>> > >>>> > >>>> > >>>> -- > >>>> Mateusz Guzik > >>>> > >>> > >> > > > From owner-svn-src-head@freebsd.org Sat Aug 29 11:39:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8747C3D5D44; Sat, 29 Aug 2020 11:39:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdvdk2zbHz4LhV; Sat, 29 Aug 2020 11:39:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A0B6250B7; Sat, 29 Aug 2020 11:39:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TBdsiL074266; Sat, 29 Aug 2020 11:39:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TBdsVO074265; Sat, 29 Aug 2020 11:39:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008291139.07TBdsVO074265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 29 Aug 2020 11:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364952 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 364952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:39:54 -0000 Author: manu Date: Sat Aug 29 11:39:53 2020 New Revision: 364952 URL: https://svnweb.freebsd.org/changeset/base/364952 Log: Fix arm64 build after r364927 Reported by: jenkins, dch Pointy hat to: manu Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Aug 29 11:18:10 2020 (r364951) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Aug 29 11:39:53 2020 (r364952) @@ -221,14 +221,14 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare if ((best < *fout) && ((flags & CLK_SET_ROUND_DOWN) == 0)) { *stop = 1; - printf("best freq (%llu) < requested freq(%llu)\n", + printf("best freq (%ju) < requested freq(%ju)\n", best, *fout); return (ERANGE); } if ((best > *fout) && ((flags & CLK_SET_ROUND_UP) == 0)) { *stop = 1; - printf("best freq (%llu) > requested freq(%llu)\n", + printf("best freq (%ju) > requested freq(%ju)\n", best, *fout); return (ERANGE); } From owner-svn-src-head@freebsd.org Sat Aug 29 11:46:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23C003D5FC4; Sat, 29 Aug 2020 11:46:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdvnk6sZYz4MNX; Sat, 29 Aug 2020 11:46:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEEF2250D9; Sat, 29 Aug 2020 11:46:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TBko6k080085; Sat, 29 Aug 2020 11:46:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TBkoD6080084; Sat, 29 Aug 2020 11:46:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008291146.07TBkoD6080084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 11:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364953 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 364953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 11:46:51 -0000 Author: imp Date: Sat Aug 29 11:46:50 2020 New Revision: 364953 URL: https://svnweb.freebsd.org/changeset/base/364953 Log: We don't need to INCLUDENUL, so turn it off to avoid assertion... sbuf_new_for_sysctl turns on INCLUDENUL, but we don't need it. And we assert for it in the new bus_pnpinfo_sb and bus_location_sb strings. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 11:39:53 2020 (r364952) +++ head/sys/kern/subr_bus.c Sat Aug 29 11:46:50 2020 (r364953) @@ -265,6 +265,7 @@ device_sysctl_handler(SYSCTL_HANDLER_ARGS) int error; sbuf_new_for_sysctl(&sb, NULL, 1024, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); switch (arg2) { case DEVICE_SYSCTL_DESC: sbuf_cat(&sb, dev->desc ? dev->desc : ""); From owner-svn-src-head@freebsd.org Sat Aug 29 12:04:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD0AE3D69FF; Sat, 29 Aug 2020 12:04:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bdw9n4ZGMz4NvS; Sat, 29 Aug 2020 12:04:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 803CA25998; Sat, 29 Aug 2020 12:04:13 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TC4D2b092607; Sat, 29 Aug 2020 12:04:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TC4DWZ092606; Sat, 29 Aug 2020 12:04:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202008291204.07TC4DWZ092606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 29 Aug 2020 12:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364954 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 364954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 12:04:13 -0000 Author: melifaro Date: Sat Aug 29 12:04:13 2020 New Revision: 364954 URL: https://svnweb.freebsd.org/changeset/base/364954 Log: Revert uma zone alignemnt cache unadvertenly committed in r364950. Modified: head/sys/net/route/route_ctl.c Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sat Aug 29 11:46:50 2020 (r364953) +++ head/sys/net/route/route_ctl.c Sat Aug 29 12:04:13 2020 (r364954) @@ -101,7 +101,7 @@ vnet_rtzone_init() { V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), - NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); } #ifdef VIMAGE From owner-svn-src-head@freebsd.org Sat Aug 29 14:44:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC6983B2299; Sat, 29 Aug 2020 14:44:57 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdzlF5Ysmz4Zgl; Sat, 29 Aug 2020 14:44:57 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9C2721963B; Sat, 29 Aug 2020 14:44:57 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 54D1727C005A; Sat, 29 Aug 2020 10:44:57 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Sat, 29 Aug 2020 10:44:57 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudefuddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder redtnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepteetleffuddvtddtuedv hfefheejvddvgfdvkedvfeethfegkedvkeelveeuvddunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsggurhgrghhonhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddtgedvfeehkeeigedqudekuddtkeehuddqsggurh grghhonheppefhrhgvvgeuufffrdhorhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id F3EB6C200A5; Sat, 29 Aug 2020 10:44:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-232-g4bdb081-fm-20200825.002-g4bdb081a Mime-Version: 1.0 Message-Id: <0b054da5-3d76-413c-b14f-58b819312c85@www.fastmail.com> In-Reply-To: References: <202008290430.07T4UCM4007928@repo.freebsd.org> <213fcb81-ceab-677f-98dc-e8cb33fef7d1@gmail.com> Date: Sat, 29 Aug 2020 09:44:37 -0500 From: "Brandon Bergren" To: "Warner Losh" , meloun.michal@gmail.com Cc: "Mateusz Guzik" , "Warner Losh" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r364946 - head/sys/kern Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 14:44:58 -0000 On Sat, Aug 29, 2020, at 6:34 AM, Warner Losh wrote: > > > On Sat, Aug 29, 2020 at 5:25 AM Michal Meloun wrote: > > Yeah, sorry. Local symbols are not available for netbooted kernel :(. > > And i csan confirm that problem is cause by using sbuf_cpy() on sbuf > > allocated by sbuf_new_for_sysctl() (thus with drain handler) in > > device_sysctl_handler(). But pure replacing sbuf_cpy() by sbuf_cat() > > gives me another panic: > > panic: Assertion (sb->s_flags & SBUF_INCLUDENUL) == 0 failed at > > /usr2/Meloun/git/pmap/sys/kern/subr_bus.c:4936 > > (still as respose for sysctl dev.cpu) > By the way, on powerpc*, we have a little hack in place to be able to load symbols even when loader isn't in use -- in petitboot, if you provide a second copy of the kernel as the initrd, it will be used at runtime to load symbols. (the powerpc code has special probing to skip attaching the initrd as a md device if it looks like an ELF file) And on powerpc32, you can actually netboot loader instead of netbooting the kernel (with a little dhcpd magic) and get symbols loaded the "normal" way. -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-head@freebsd.org Sat Aug 29 15:13:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1962B3B30EC; Sat, 29 Aug 2020 15:13:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf0Ml6vhWz4cQ1; Sat, 29 Aug 2020 15:13:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D048327B60; Sat, 29 Aug 2020 15:13:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TFD7ph010786; Sat, 29 Aug 2020 15:13:07 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TFD7gA010785; Sat, 29 Aug 2020 15:13:07 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008291513.07TFD7gA010785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 15:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364956 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 15:13:08 -0000 Author: gjb Date: Sat Aug 29 15:13:07 2020 New Revision: 364956 URL: https://svnweb.freebsd.org/changeset/base/364956 Log: Install devel/git from packages if NOPORTS is set in the release.sh configuration file. Reported by: Michael Butler Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 12:54:17 2020 (r364955) +++ head/release/release.sh Sat Aug 29 15:13:07 2020 (r364956) @@ -282,6 +282,11 @@ extra_chroot_setup() { WRKDIRPREFIX=/tmp/ports \ DISTDIR=/tmp/distfiles \ install clean distclean + else + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg install -y devel/git + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg clean -y fi if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right From owner-svn-src-head@freebsd.org Sat Aug 29 15:30:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C44F3B384A; Sat, 29 Aug 2020 15:30:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf0ld71jTz4dbW; Sat, 29 Aug 2020 15:30:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D586727A33; Sat, 29 Aug 2020 15:30:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TFUL7W017630; Sat, 29 Aug 2020 15:30:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TFULLm017629; Sat, 29 Aug 2020 15:30:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008291530.07TFULLm017629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 15:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364957 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 15:30:22 -0000 Author: gjb Date: Sat Aug 29 15:30:21 2020 New Revision: 364957 URL: https://svnweb.freebsd.org/changeset/base/364957 Log: Avoid the build from falling over if devel/git is not installed on the system. Set a null branch/hash in this case, to avoid undefined GITREV/GITBRANCH variables from falling over in other areas. Reported by: many Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/Makefile.inc1 Modified: head/release/Makefile.inc1 ============================================================================== --- head/release/Makefile.inc1 Sat Aug 29 15:13:07 2020 (r364956) +++ head/release/Makefile.inc1 Sat Aug 29 15:30:21 2020 (r364957) @@ -10,10 +10,8 @@ GIT_CMD= ${_P}/git . endif . endif .endfor -.if !defined(GIT_CMD) && empty(GIT_CMD) -. error "Git binary not found. Set GIT_CMD appropriately." -.endif +.if !empty(GIT_CMD) && exists(${GIT_CMD}) # Set the git branch and hash to export where needed. .if !defined(GITBRANCH) || empty(GITBRANCH) GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' @@ -21,6 +19,12 @@ GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbre .endif .if !defined(GITREV) || empty(GITREV) GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true +.export GITREV +.endif +.else +GITBRANCH= nullbranch +GITREV= nullhash +.export GITBRANCH .export GITREV .endif From owner-svn-src-head@freebsd.org Sat Aug 29 15:31:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E85833B3D02; Sat, 29 Aug 2020 15:31:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf0mq5vFTz4dnZ; Sat, 29 Aug 2020 15:31:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADB0D27CA4; Sat, 29 Aug 2020 15:31:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TFVNcF018465; Sat, 29 Aug 2020 15:31:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TFVNXF018464; Sat, 29 Aug 2020 15:31:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008291531.07TFVNXF018464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 15:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364958 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 15:31:24 -0000 Author: gjb Date: Sat Aug 29 15:31:23 2020 New Revision: 364958 URL: https://svnweb.freebsd.org/changeset/base/364958 Log: Indentation fixes. No functional changes. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/Makefile.inc1 Modified: head/release/Makefile.inc1 ============================================================================== --- head/release/Makefile.inc1 Sat Aug 29 15:30:21 2020 (r364957) +++ head/release/Makefile.inc1 Sat Aug 29 15:31:23 2020 (r364958) @@ -13,19 +13,19 @@ GIT_CMD= ${_P}/git .if !empty(GIT_CMD) && exists(${GIT_CMD}) # Set the git branch and hash to export where needed. -.if !defined(GITBRANCH) || empty(GITBRANCH) +. if !defined(GITBRANCH) || empty(GITBRANCH) GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' -.export GITBRANCH -.endif -.if !defined(GITREV) || empty(GITREV) +. export GITBRANCH +. endif +. if !defined(GITREV) || empty(GITREV) GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || true -.export GITREV -.endif +. export GITREV +. endif .else GITBRANCH= nullbranch GITREV= nullhash -.export GITBRANCH -.export GITREV +. export GITBRANCH +. export GITREV .endif # Set the build date, primarily for snapshot builds. From owner-svn-src-head@freebsd.org Sat Aug 29 15:50:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98A093B44A2; Sat, 29 Aug 2020 15:50:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf1Br39q4z4fr0; Sat, 29 Aug 2020 15:50:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 504F127EDB; Sat, 29 Aug 2020 15:50:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TFoSej029726; Sat, 29 Aug 2020 15:50:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TFoS7O029724; Sat, 29 Aug 2020 15:50:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008291550.07TFoS7O029724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 15:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364959 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 15:50:28 -0000 Author: gjb Date: Sat Aug 29 15:50:27 2020 New Revision: 364959 URL: https://svnweb.freebsd.org/changeset/base/364959 Log: Add a VCSUPDATE command to run 'git pull' instead of 'git clone' if the tree already exists. Reported by: Michael Butler Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 15:31:23 2020 (r364958) +++ head/release/release.sh Sat Aug 29 15:50:27 2020 (r364959) @@ -70,6 +70,7 @@ env_setup() { exit 1 fi VCSCMD="/usr/local/bin/git clone -q" + VCSUPDATE="/usr/local/bin/git pull -q" # The default git checkout server, and branches for src/, doc/, # and ports/. @@ -220,13 +221,25 @@ chroot_setup() { mkdir -p ${CHROOTDIR}/usr if [ -z "${SRC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src + if [ -d "${CHROOTDIR}/usr/src" ]; then + cd ${CHROOTDIR}/usr/src && ${VCSUPDATE} && cd - + else + ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src + fi fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc + if [ -d "${CHROOTDIR}/usr/doc" ]; then + cd ${CHROOTDIR}/usr/doc && ${VCSUPDATE} && cd - + else + ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc + fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports + if [ -d "${CHROOTDIR}/usr/ports" ]; then + cd ${CHROOTDIR}/usr/ports && ${VCSUPDATE} && cd - + else + ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports + fi fi if [ -z "${CHROOTBUILD_SKIP}" ]; then From owner-svn-src-head@freebsd.org Sat Aug 29 16:04:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D56B3B4D1A; Sat, 29 Aug 2020 16:04:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf1VW3fNDz3SSg; Sat, 29 Aug 2020 16:04:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6055D8397; Sat, 29 Aug 2020 16:04:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TG433c041727; Sat, 29 Aug 2020 16:04:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TG43bY041726; Sat, 29 Aug 2020 16:04:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008291604.07TG43bY041726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 16:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364960 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 16:04:03 -0000 Author: gjb Date: Sat Aug 29 16:04:02 2020 New Revision: 364960 URL: https://svnweb.freebsd.org/changeset/base/364960 Log: Refine the VCSUPDATE logic further: - Look for the .git directory instead of top-level directory. - Use 'git -C' instead of cd(1). Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 15:50:27 2020 (r364959) +++ head/release/release.sh Sat Aug 29 16:04:02 2020 (r364960) @@ -221,22 +221,22 @@ chroot_setup() { mkdir -p ${CHROOTDIR}/usr if [ -z "${SRC_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/src" ]; then - cd ${CHROOTDIR}/usr/src && ${VCSUPDATE} && cd - + if [ -d "${CHROOTDIR}/usr/src/.git" ]; then + ${VCSUPDATE} -C ${CHROOTDIR}/usr/src else ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src fi fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/doc" ]; then - cd ${CHROOTDIR}/usr/doc && ${VCSUPDATE} && cd - + if [ -d "${CHROOTDIR}/usr/doc/.git" ]; then + ${VCSUPDATE} -C ${CHROOTDIR}/usr/doc else ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/ports" ]; then - cd ${CHROOTDIR}/usr/ports && ${VCSUPDATE} && cd - + if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then + ${VCSUPDATE} -C ${CHROOTDIR}/usr/ports else ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi From owner-svn-src-head@freebsd.org Sat Aug 29 17:04:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EB8F3B6A63 for ; Sat, 29 Aug 2020 17:04:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf2rn6yRKz3Wmv for ; Sat, 29 Aug 2020 17:04:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1598720696; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Js5teUxyltSINvRkR8Q3tZPiNRCF2UegrYWtGvyl49q7aWYu+MmI4cw+IxkTk1II8WKpv1KHiG/eP qQKTp18D7SVOPM9tjwttvs6NOQp6YRBzjviOak6ZpdQeKe7dQXoJBkkFOXPB37G7wT2R5Uu1l7mDSv vCtkuHzJg1kOYQ8o8D3JP5WWAoR+pbhc+SsX4O8Mhw9ztqM+pOxDLNnTDsgHOn4W13cfnYWfV7JXc1 4F+5jhFHHJgjRj8taTX9m/1cnLHgTOnagEZHZp7SMnGppLlDQMm7BawX43tasghFJFLO7yypX4b8ZA /2TqAmA+zksDCywv+o1yNOzN059pxbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=VYq6hPTT70YeMAZ3R9B0riPxM+Udz7KFGVS536dwSCA=; b=HIVGrY48XQa7T5C+6k8FiWhJ6EerzzmtJttWKZW1Bg+4KSfOkSqmDKGJ391GF3eauh6bU1P0pWzng oTYq9dAH2Jbje8GC6qUlgNmDyUa6YBr7Hm5zy30gpIM59Rng3vAVGPcWSxIozoX1ANIYRnPUsKLYeX 43Ngleu6zNvNwSUNlLL4hxWMlD6XnUA9P6u69GdSdhpk+IQ51bxrYR/2ASYjwFRzv07Ax4iB6QObgB IDj9NOA42/eTv99jQ9jgGeqSORt+Kf+our7i9Wyq2zFiMH9n1M+hYsB5BxQdEE6tCZHXR4sjosqGCK u07Aozzx/WG8auCoUgwMqlOkBLYqEDg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=VYq6hPTT70YeMAZ3R9B0riPxM+Udz7KFGVS536dwSCA=; b=UtxOSV7uAupSk+4qwu1zVj8yAhS+k2WNnGiA/VwEQ6p96jG45ThYPxMzlukrF/3xfyh9pwruLzxYX ifxpdXj/NKGfljgIgODmQ6JB3XIc+Fh+I7/qQwtul2s1g0uQcwY++hlBvcQ+jlhuVulTxJcYUDHoOE 8w2UqQMba+0YDV0kNIIr5cAbBslVW3YWTx5c+3V0GU6e+CwdMXmYBHezW1Hp0r4gthU7yEGSVmVhwl 4S3diOe9RiP1B4GKvordD1GKN51GVGB+EtYGw+26BeC+PvlF4hFQN9FUOIqJXKpkb0RlQ0za8X5aYs ZBhk9dY/9DZkCsjbASxkXhErK3jS46Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: c1d63bad-ea19-11ea-b630-6b8aa7872eb8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c1d63bad-ea19-11ea-b630-6b8aa7872eb8; Sat, 29 Aug 2020 17:04:55 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 07TH4rOH030633; Sat, 29 Aug 2020 11:04:53 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <0799731356a4ccffedf3ac10048611bec72f7eba.camel@freebsd.org> Subject: Re: svn commit: r364946 - head/sys/kern From: Ian Lepore To: Warner Losh , meloun.michal@gmail.com Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head Date: Sat, 29 Aug 2020 11:04:53 -0600 In-Reply-To: References: <202008290430.07T4UCM4007928@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bf2rn6yRKz3Wmv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 17:04:58 -0000 On Sat, 2020-08-29 at 05:02 -0600, Warner Losh wrote: > > > > sbuf_cpy() at _gone_in_dev+0x560 > > pc = 0xffff0000003c1ff0 lr = 0xffff0000003a9078 > > sp = 0xffff00006f21a510 fp = 0xffff00006f21a570 > > > > _gone_in_dev() at sbuf_new_for_sysctl+0x170 > > pc = 0xffff0000003a9078 lr = 0xffff00000037c1a8 > > sp = 0xffff00006f21a580 fp = 0xffff00006f21a5a0 > > > > sbuf_new_for_sysctl() at kernel_sysctl+0x36c > > pc = 0xffff00000037c1a8 lr = 0xffff00000037b63c > > sp = 0xffff00006f21a5b0 fp = 0xffff00006f21a630 > > > > This traceback is all kinds of crazy. sbuf_new_for_sysctl doesn't call > _gone_in_dev(), which doesn't do sbuf stuff at all. And neither does it > call sbuf_cpy(). Though I get a crash that looks like: > Tracing pid 66442 tid 101464 td 0xfffffe02f47b7c00 > kdb_enter() at kdb_enter+0x37/frame 0xfffffe02f4ae3740 > vpanic() at vpanic+0x19e/frame 0xfffffe02f4ae3790 > panic() at panic+0x43/frame 0xfffffe02f4ae37f0 > sbuf_clear() at sbuf_clear+0xac/frame 0xfffffe02f4ae3800 > sbuf_cpy() at sbuf_cpy+0x5a/frame 0xfffffe02f4ae3820 > device_sysctl_handler() at device_sysctl_handler+0x133/frame > 0xfffffe02f4ae38a0 > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame > 0xfffffe02f4ae38f0 > sysctl_root() at sysctl_root+0x20a/frame 0xfffffe02f4ae3970 > userland_sysctl() at userland_sysctl+0x17d/frame 0xfffffe02f4ae3a20 > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe02f4ae3ad0 > amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe02f4ae3bf0 > fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe02f4ae3bf0 > --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x80042d50a, rsp = > 0x7fffffffd458, rbp = 0x7fffffffd490 --- > > on a sysctl -a which I think makes more sense... I'll see if I can track > it down... I think it's because sbuf_cpy does an unconditional clear, which > triggers this assert, which is likely bogus for this case. sbuf_cat doesn't > seem to have this issue... I'll confirm and commit. > > Warner This kind of crazy happens when the traceback just reports the name of the nearest global symbol it can find because static or other local symbols aren't available to it. The clue that that's what's going on tends to be in things like: sbuf_cpy() at _gone_in_dev+0x560 It's almost certain that _gone_in_dev() isn't a big enough function that an offset of 0x560 is still in that function, so it's really in some static function that got linked nearby but the symbols for statics got stripped. Usually you can use addr2line on kernel.full to get the real names for the pc and lr values. -- Ian From owner-svn-src-head@freebsd.org Sat Aug 29 19:26:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC5A03B9CFB; Sat, 29 Aug 2020 19:26:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf6085T7lz3frt; Sat, 29 Aug 2020 19:26:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE34A4ED; Sat, 29 Aug 2020 19:26:32 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TJQWmv065640; Sat, 29 Aug 2020 19:26:32 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TJQV3G065634; Sat, 29 Aug 2020 19:26:31 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202008291926.07TJQV3G065634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 29 Aug 2020 19:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364964 - in head: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 364964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 19:26:32 -0000 Author: wulf Date: Sat Aug 29 19:26:31 2020 New Revision: 364964 URL: https://svnweb.freebsd.org/changeset/base/364964 Log: LinuxKPI: Implement ksize() function. In Linux, ksize() gets the actual amount of memory allocated for a given object. This commit adds malloc_usable_size() to FreeBSD KPI which does the same. It also maps LinuxKPI ksize() to newly created function. ksize() function is used by drm-kmod. Reviewed by: hselasky, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26215 Modified: head/share/man/man9/malloc.9 head/sys/compat/linuxkpi/common/include/linux/slab.h head/sys/kern/kern_malloc.c head/sys/sys/malloc.h head/sys/vm/memguard.c head/sys/vm/memguard.h Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Sat Aug 29 18:11:37 2020 (r364963) +++ head/share/man/man9/malloc.9 Sat Aug 29 19:26:31 2020 (r364964) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd August 3, 2020 +.Dd August 28, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -55,6 +55,8 @@ .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags" .Ft void * .Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags" +.Ft size_t +.Fn malloc_usable_size "const void *addr" .Fn MALLOC_DECLARE type .In sys/param.h .In sys/malloc.h @@ -149,6 +151,13 @@ function is identical to .Fn realloc except that it will free the passed pointer when the requested memory cannot be allocated. +.Pp +The +.Fn malloc_usable_size +function returns the usable size of the allocation pointed to by +.Fa addr . +The return value may be larger than the size that was requested during +allocation. .Pp Unlike its standard C library counterpart .Pq Xr malloc 3 , Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sat Aug 29 18:11:37 2020 (r364963) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sat Aug 29 19:26:31 2020 (r364964) @@ -154,6 +154,12 @@ kfree(const void *ptr) free(__DECONST(void *, ptr), M_KMALLOC); } +static inline size_t +ksize(const void *ptr) +{ + return (malloc_usable_size(ptr)); +} + extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat Aug 29 18:11:37 2020 (r364963) +++ head/sys/kern/kern_malloc.c Sat Aug 29 19:26:31 2020 (r364964) @@ -938,6 +938,42 @@ reallocf(void *addr, size_t size, struct malloc_type * return (mem); } +/* + * malloc_usable_size: returns the usable size of the allocation. + */ +size_t +malloc_usable_size(const void *addr) +{ +#ifndef DEBUG_REDZONE + uma_zone_t zone; + uma_slab_t slab; +#endif + u_long size; + + if (addr == NULL) + return (0); + +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(__DECONST(void *, addr))) + return (memguard_get_req_size(addr)); +#endif + +#ifdef DEBUG_REDZONE + size = redzone_get_size(__DECONST(void *, addr)); +#else + vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); + if (slab == NULL) + panic("malloc_usable_size: address %p(%p) is not allocated.\n", + addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + + if (!malloc_large_slab(slab)) + size = zone->uz_size; + else + size = malloc_large_size(slab); +#endif + return (size); +} + CTASSERT(VM_KMEM_SIZE_SCALE >= 1); /* Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Sat Aug 29 18:11:37 2020 (r364963) +++ head/sys/sys/malloc.h Sat Aug 29 19:26:31 2020 (r364964) @@ -244,6 +244,7 @@ void malloc_type_allocated(struct malloc_type *type, u void malloc_type_freed(struct malloc_type *type, unsigned long size); void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); +size_t malloc_usable_size(const void *); void *realloc(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags) Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Sat Aug 29 18:11:37 2020 (r364963) +++ head/sys/vm/memguard.c Sat Aug 29 19:26:31 2020 (r364964) @@ -504,3 +504,9 @@ memguard_cmp_zone(uma_zone_t zone) */ return (strcmp(zone->uz_name, vm_memguard_desc) == 0); } + +unsigned long +memguard_get_req_size(const void *addr) +{ + return (*v2sizep(trunc_page((uintptr_t)addr))); +} Modified: head/sys/vm/memguard.h ============================================================================== --- head/sys/vm/memguard.h Sat Aug 29 18:11:37 2020 (r364963) +++ head/sys/vm/memguard.h Sat Aug 29 19:26:31 2020 (r364964) @@ -43,6 +43,7 @@ void memguard_init(struct vmem *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); void memguard_free(void *); +unsigned long memguard_get_req_size(const void *); int memguard_cmp_mtp(struct malloc_type *, unsigned long); int memguard_cmp_zone(uma_zone_t); int is_memguard_addr(void *); @@ -52,6 +53,7 @@ int is_memguard_addr(void *); #define memguard_alloc(size, flags) NULL #define memguard_realloc(a, s, mtp, f) NULL #define memguard_free(addr) do { } while (0) +#define memguard_get_req_size(addr) 0 #define memguard_cmp_mtp(mtp, size) 0 #define memguard_cmp_zone(zone) 0 #define is_memguard_addr(addr) 0 From owner-svn-src-head@freebsd.org Sat Aug 29 21:05:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20C393BC6B4; Sat, 29 Aug 2020 21:05:45 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf8Bd0748z43J0; Sat, 29 Aug 2020 21:05:45 +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 DCDF8BF84; Sat, 29 Aug 2020 21:05:44 +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 07TL5iZD028940; Sat, 29 Aug 2020 21:05:44 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TL5hQ2028933; Sat, 29 Aug 2020 21:05:43 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202008292105.07TL5hQ2028933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 29 Aug 2020 21:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364965 - in head/stand: common libsa X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/stand: common libsa X-SVN-Commit-Revision: 364965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 21:05:45 -0000 Author: sjg Date: Sat Aug 29 21:05:43 2020 New Revision: 364965 URL: https://svnweb.freebsd.org/changeset/base/364965 Log: zalloc_malloc:Free hexdump preceeding buffer when we detect overflow Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c (svn cp) Disable use of pager - causes linking issue for boot1 can be re-enabled by defining HEXDUMP_PAGER. Reviewed by: stevek, imp MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D26235 Added: head/stand/libsa/hexdump.c (contents, props changed) - copied, changed from r364346, head/stand/common/misc.c Modified: head/stand/common/bootstrap.h head/stand/common/misc.c head/stand/libsa/Makefile head/stand/libsa/pkgfs.c head/stand/libsa/stand.h head/stand/libsa/zalloc_malloc.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/common/bootstrap.h Sat Aug 29 21:05:43 2020 (r364965) @@ -68,7 +68,6 @@ int getrootmount(char *rootdev); /* misc.c */ char *unargv(int argc, char *argv[]); -void hexdump(caddr_t region, size_t len); size_t strlenout(vm_offset_t str); char *strdupout(vm_offset_t str); void kern_bzero(vm_offset_t dest, size_t len); Modified: head/stand/common/misc.c ============================================================================== --- head/stand/common/misc.c Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/common/misc.c Sat Aug 29 21:05:43 2020 (r364965) @@ -169,46 +169,6 @@ alloc_pread(readin_handle_t fd, off_t off, size_t len) return (buf); } -/* - * Display a region in traditional hexdump format. - */ -void -hexdump(caddr_t region, size_t len) -{ - caddr_t line; - int x, c; - char lbuf[80]; -#define emit(fmt, args...) {sprintf(lbuf, fmt , ## args); pager_output(lbuf);} - - pager_open(); - for (line = region; line < (region + len); line += 16) { - emit("%08lx ", (long) line); - - for (x = 0; x < 16; x++) { - if ((line + x) < (region + len)) { - emit("%02x ", *(uint8_t *)(line + x)); - } else { - emit("-- "); - } - if (x == 7) - emit(" "); - } - emit(" |"); - for (x = 0; x < 16; x++) { - if ((line + x) < (region + len)) { - c = *(uint8_t *)(line + x); - if ((c < ' ') || (c > '~')) /* !isprint(c) */ - c = '.'; - emit("%c", c); - } else { - emit(" "); - } - } - emit("|\n"); - } - pager_close(); -} - void dev_cleanup(void) { Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/libsa/Makefile Sat Aug 29 21:05:43 2020 (r364965) @@ -13,8 +13,9 @@ LIBSA_CPUARCH?=${MACHINE_CPUARCH} LIB?= sa # standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c abort.c assert.c bcd.c environment.c getopt.c gets.c \ - globals.c pager.c panic.c printf.c strdup.c strerror.c \ +SRCS+= gzguts.h zutil.h __main.c abort.c assert.c bcd.c environment.c \ + getopt.c gets.c globals.c \ + hexdump.c pager.c panic.c printf.c strdup.c strerror.c \ random.c sbrk.c twiddle.c zalloc.c zalloc_malloc.c # private (pruned) versions of libc string functions Copied and modified: head/stand/libsa/hexdump.c (from r364346, head/stand/common/misc.c) ============================================================================== --- head/stand/common/misc.c Tue Aug 18 14:17:14 2020 (r364346, copy source) +++ head/stand/libsa/hexdump.c Sat Aug 29 21:05:43 2020 (r364965) @@ -29,147 +29,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* - * Concatenate the (argc) elements of (argv) into a single string, and return - * a copy of same. - */ -char * -unargv(int argc, char *argv[]) -{ - size_t hlong; - int i; - char *cp; - - for (i = 0, hlong = 0; i < argc; i++) - hlong += strlen(argv[i]) + 2; - - if(hlong == 0) - return(NULL); - - cp = malloc(hlong); - cp[0] = 0; - for (i = 0; i < argc; i++) { - strcat(cp, argv[i]); - if (i < (argc - 1)) - strcat(cp, " "); - } - - return(cp); -} - -/* - * Get the length of a string in kernel space - */ -size_t -strlenout(vm_offset_t src) -{ - char c; - size_t len; - - for (len = 0; ; len++) { - archsw.arch_copyout(src++, &c, 1); - if (c == 0) - break; - } - return(len); -} - -/* - * Make a duplicate copy of a string in kernel space - */ -char * -strdupout(vm_offset_t str) -{ - char *result, *cp; - - result = malloc(strlenout(str) + 1); - for (cp = result; ;cp++) { - archsw.arch_copyout(str++, cp, 1); - if (*cp == 0) - break; - } - return(result); -} - -/* Zero a region in kernel space. */ -void -kern_bzero(vm_offset_t dest, size_t len) -{ - char buf[256]; - size_t chunk, resid; - - bzero(buf, sizeof(buf)); - resid = len; - while (resid > 0) { - chunk = min(sizeof(buf), resid); - archsw.arch_copyin(buf, dest, chunk); - resid -= chunk; - dest += chunk; - } -} - -/* - * Read the specified part of a file to kernel space. Unlike regular - * pread, the file pointer is advanced to the end of the read data, - * and it just returns 0 if successful. - */ -int -kern_pread(readin_handle_t fd, vm_offset_t dest, size_t len, off_t off) -{ - - if (VECTX_LSEEK(fd, off, SEEK_SET) == -1) { -#ifdef DEBUG - printf("\nlseek failed\n"); -#endif - return (-1); - } - if ((size_t)archsw.arch_readin(fd, dest, len) != len) { -#ifdef DEBUG - printf("\nreadin failed\n"); -#endif - return (-1); - } - return (0); -} - -/* - * Read the specified part of a file to a malloced buffer. The file - * pointer is advanced to the end of the read data. - */ -/* coverity[ -tainted_data_return ] */ -void * -alloc_pread(readin_handle_t fd, off_t off, size_t len) -{ - void *buf; - - buf = malloc(len); - if (buf == NULL) { -#ifdef DEBUG - printf("\nmalloc(%d) failed\n", (int)len); -#endif - errno = ENOMEM; - return (NULL); - } - if (VECTX_LSEEK(fd, off, SEEK_SET) == -1) { -#ifdef DEBUG - printf("\nlseek failed\n"); -#endif - free(buf); - return (NULL); - } - if ((size_t)VECTX_READ(fd, buf, len) != len) { -#ifdef DEBUG - printf("\nread failed\n"); -#endif - free(buf); - return (NULL); - } - return (buf); -} - -/* * Display a region in traditional hexdump format. */ void @@ -177,10 +38,16 @@ hexdump(caddr_t region, size_t len) { caddr_t line; int x, c; - char lbuf[80]; +#ifdef HEXDUMP_PAGER + /* pager causes linking issues for some apps */ #define emit(fmt, args...) {sprintf(lbuf, fmt , ## args); pager_output(lbuf);} + char lbuf[80]; pager_open(); +#else +#define emit(fmt, args...) printf(fmt, ## args) +#endif + for (line = region; line < (region + len); line += 16) { emit("%08lx ", (long) line); @@ -206,16 +73,7 @@ hexdump(caddr_t region, size_t len) } emit("|\n"); } +#ifdef HEXDUMP_PAGER pager_close(); -} - -void -dev_cleanup(void) -{ - int i; - - /* Call cleanup routines */ - for (i = 0; devsw[i] != NULL; ++i) - if (devsw[i]->dv_cleanup != NULL) - (devsw[i]->dv_cleanup)(); +#endif } Modified: head/stand/libsa/pkgfs.c ============================================================================== --- head/stand/libsa/pkgfs.c Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/libsa/pkgfs.c Sat Aug 29 21:05:43 2020 (r364965) @@ -60,7 +60,7 @@ struct fs_ops pkgfs_fsops = { }; #define PKG_BUFSIZE 512 -#define PKG_MAXCACHESZ (16384 * 3) +#define PKG_MAXCACHESZ (512 * 1024) #define PKG_FILEEXT ".tgz" Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/libsa/stand.h Sat Aug 29 21:05:43 2020 (r364965) @@ -470,4 +470,7 @@ extern void *reallocf(void *, size_t); */ caddr_t ptov(uintptr_t); +/* hexdump.c */ +void hexdump(caddr_t region, size_t len); + #endif /* STAND_H */ Modified: head/stand/libsa/zalloc_malloc.c ============================================================================== --- head/stand/libsa/zalloc_malloc.c Sat Aug 29 19:26:31 2020 (r364964) +++ head/stand/libsa/zalloc_malloc.c Sat Aug 29 21:05:43 2020 (r364965) @@ -52,6 +52,10 @@ void mallocstats(void); static void *Malloc_align(size_t, size_t); +#ifndef MIN +# define MIN(a,b) ((a) <= (b)) ? (a) : (b) +#endif + void * Malloc(size_t bytes, const char *file __unused, int line __unused) { @@ -119,9 +123,14 @@ Free(void *ptr, const char *file, int line) ptr, file, line); return; } - if (res->ga_Magic != GAMAGIC) + if (res->ga_Magic != GAMAGIC) { + size_t dump_bytes; + + dump_bytes = MIN((ptr - MallocPool.mp_Base), 512); + hexdump(ptr - dump_bytes, dump_bytes); panic("free: guard1 fail @ %p from %s:%d", ptr, file, line); + } res->ga_Magic = GAFREE; #endif #ifdef USEENDGUARD From owner-svn-src-head@freebsd.org Sat Aug 29 21:43:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 263CF3BDBAA; Sat, 29 Aug 2020 21:43:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf91c0H8Wz45ts; Sat, 29 Aug 2020 21:43:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1B42C3C2; Sat, 29 Aug 2020 21:42:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TLgxIw053201; Sat, 29 Aug 2020 21:42:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TLgxE1053200; Sat, 29 Aug 2020 21:42:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008292142.07TLgxE1053200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 21:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364966 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 21:43:00 -0000 Author: gjb Date: Sat Aug 29 21:42:59 2020 New Revision: 364966 URL: https://svnweb.freebsd.org/changeset/base/364966 Log: Remove the VCSUPDATE command, because git is too stupid to have the '-C ' after the subcommand. Meanwhile, hard-code 'git -C <...> pull' for now. Reported by: Michael Butler Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 21:05:43 2020 (r364965) +++ head/release/release.sh Sat Aug 29 21:42:59 2020 (r364966) @@ -70,7 +70,6 @@ env_setup() { exit 1 fi VCSCMD="/usr/local/bin/git clone -q" - VCSUPDATE="/usr/local/bin/git pull -q" # The default git checkout server, and branches for src/, doc/, # and ports/. @@ -222,21 +221,21 @@ chroot_setup() { if [ -z "${SRC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/src/.git" ]; then - ${VCSUPDATE} -C ${CHROOTDIR}/usr/src + git -C ${CHROOTDIR}/usr/src pull else ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src fi fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/doc/.git" ]; then - ${VCSUPDATE} -C ${CHROOTDIR}/usr/doc + git -C ${CHROOTDIR}/usr/doc pull else ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - ${VCSUPDATE} -C ${CHROOTDIR}/usr/ports + git -C ${CHROOTDIR}/usr/ports pull else ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi From owner-svn-src-head@freebsd.org Sat Aug 29 21:46:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6ADBB3BDF73; Sat, 29 Aug 2020 21:46:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf95l2F9qz466S; Sat, 29 Aug 2020 21:46:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C627C412; Sat, 29 Aug 2020 21:46:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TLkYde053483; Sat, 29 Aug 2020 21:46:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TLkYSK053482; Sat, 29 Aug 2020 21:46:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008292146.07TLkYSK053482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 21:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364967 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 21:46:35 -0000 Author: gjb Date: Sat Aug 29 21:46:34 2020 New Revision: 364967 URL: https://svnweb.freebsd.org/changeset/base/364967 Log: Restore the '-q' flag to the 'git pull' command. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 21:42:59 2020 (r364966) +++ head/release/release.sh Sat Aug 29 21:46:34 2020 (r364967) @@ -221,21 +221,21 @@ chroot_setup() { if [ -z "${SRC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/src/.git" ]; then - git -C ${CHROOTDIR}/usr/src pull + git -C ${CHROOTDIR}/usr/src -q pull else ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src fi fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/doc/.git" ]; then - git -C ${CHROOTDIR}/usr/doc pull + git -C ${CHROOTDIR}/usr/doc -q pull else ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - git -C ${CHROOTDIR}/usr/ports pull + git -C ${CHROOTDIR}/usr/ports -q pull else ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi From owner-svn-src-head@freebsd.org Sat Aug 29 21:47:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60C733BE2B2; Sat, 29 Aug 2020 21:47:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf97B21PBz46MD; Sat, 29 Aug 2020 21:47:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28242BF54; Sat, 29 Aug 2020 21:47:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TLloOi053594; Sat, 29 Aug 2020 21:47:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TLlow9053593; Sat, 29 Aug 2020 21:47:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202008292147.07TLlow9053593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 29 Aug 2020 21:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364968 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 364968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 21:47:50 -0000 Author: gjb Date: Sat Aug 29 21:47:49 2020 New Revision: 364968 URL: https://svnweb.freebsd.org/changeset/base/364968 Log: Fix ordering of the 'pull' subcommand and the '-q' flag. Pointyhat to: gjb (myself) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Sat Aug 29 21:46:34 2020 (r364967) +++ head/release/release.sh Sat Aug 29 21:47:49 2020 (r364968) @@ -221,21 +221,21 @@ chroot_setup() { if [ -z "${SRC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/src/.git" ]; then - git -C ${CHROOTDIR}/usr/src -q pull + git -C ${CHROOTDIR}/usr/src pull -q else ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src fi fi if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/doc/.git" ]; then - git -C ${CHROOTDIR}/usr/doc -q pull + git -C ${CHROOTDIR}/usr/doc pull -q else ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - git -C ${CHROOTDIR}/usr/ports -q pull + git -C ${CHROOTDIR}/usr/ports pull -q else ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi From owner-svn-src-head@freebsd.org Sat Aug 29 22:24:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 483523BF9B9; Sat, 29 Aug 2020 22:24:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bf9xk161Fz4BGN; Sat, 29 Aug 2020 22:24:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0944BCBD2; Sat, 29 Aug 2020 22:24:42 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07TMOfip077957; Sat, 29 Aug 2020 22:24:41 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07TMOfs2077956; Sat, 29 Aug 2020 22:24:41 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <202008292224.07TMOfs2077956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 29 Aug 2020 22:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364970 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 364970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2020 22:24:42 -0000 Author: jamie Date: Sat Aug 29 22:24:41 2020 New Revision: 364970 URL: https://svnweb.freebsd.org/changeset/base/364970 Log: Add __BEGIN_DECLS to jail.h to keep C++ happy. PR: 238928 Reported by: yuri@ Modified: head/sys/sys/jail.h Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sat Aug 29 22:09:36 2020 (r364969) +++ head/sys/sys/jail.h Sat Aug 29 22:24:41 2020 (r364970) @@ -110,11 +110,13 @@ struct xprison { struct iovec; +__BEGIN_DECLS int jail(struct jail *); int jail_set(struct iovec *, unsigned int, int); int jail_get(struct iovec *, unsigned int, int); int jail_attach(int); int jail_remove(int); +__END_DECLS #else /* _KERNEL */