From owner-svn-src-head@freebsd.org Sun Oct 14 00:29:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD0E610B7522; Sun, 14 Oct 2018 00:29:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82A918FD28; Sun, 14 Oct 2018 00:29:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EE7E1654E; Sun, 14 Oct 2018 00:29:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9E0TwvP013808; Sun, 14 Oct 2018 00:29:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9E0TwVS013807; Sun, 14 Oct 2018 00:29:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810140029.w9E0TwVS013807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 14 Oct 2018 00:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339352 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339352 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.27 Precedence: list List-Id: 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, 14 Oct 2018 00:29:59 -0000 Author: emaste Date: Sun Oct 14 00:29:57 2018 New Revision: 339352 URL: https://svnweb.freebsd.org/changeset/base/339352 Log: Makefile.inc1: clean up dependencies after r339348 r339348 switched bcopy from .s to .c. Add ad-hoc dependency cleanup as done for similar cases. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Oct 13 23:52:55 2018 (r339351) +++ head/Makefile.inc1 Sun Oct 14 00:29:57 2018 (r339352) @@ -939,6 +939,15 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181013 r339348 bcopy reimplemented as .c +.for f in bcopy memcpy memmove + @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ + egrep -qw 'bcopy\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ + echo "Removing stale dependencies for bcopy"; \ + rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ + fi +.endfor # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ From owner-svn-src-head@freebsd.org Sun Oct 14 05:09:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02BAC10C5060; Sun, 14 Oct 2018 05:09:45 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBC6792B4; Sun, 14 Oct 2018 05:09:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94FFB19ADB; Sun, 14 Oct 2018 05:09:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9E59iLF057621; Sun, 14 Oct 2018 05:09:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9E59iKD057619; Sun, 14 Oct 2018 05:09:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201810140509.w9E59iKD057619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sun, 14 Oct 2018 05:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339354 - in head/sys/dev: e1000 ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 ixgbe X-SVN-Commit-Revision: 339354 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.27 Precedence: list List-Id: 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, 14 Oct 2018 05:09:45 -0000 Author: erj Date: Sun Oct 14 05:09:43 2018 New Revision: 339354 URL: https://svnweb.freebsd.org/changeset/base/339354 Log: em/igb/ix(4): Port two Tx/Rx fixes made to ixl in r339338 - Fix assert/panic on receive when Jumbo Frames are enabled. From the commit I made to ixl: "It turns out that *_isc_rxd_available is supposed to return how many packets are available to be cleaned on the rx ring. This patch removes a section of code where if the budget argument is 1, the function would return one if there was a descriptor available, not necessarily a packet. This is okay in regular mtu 1500 traffic since the max frame size is less than the configured receive buffer size (2048), but this doesn't work when received packets can span more than one descriptor, as is the case when the mtu is 9000 and the receive buffer size is 4096." - Fix possible Tx hang because *_isc_txd_credits_update returns incorrect result From the commit by Krzysztof Galazka to ixl: "Function isc_txd_update_credits called with clear set to false should return 1 if there are TX descriptors already handled by HW. It was always returning 0 causing troubles with UDP TX traffic." PR: 231659 Reported by: lev@ Approved by: re (gjb@) Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/igb_txrx.c head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Sun Oct 14 01:16:48 2018 (r339353) +++ head/sys/dev/e1000/em_txrx.c Sun Oct 14 05:09:43 2018 (r339354) @@ -446,9 +446,14 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, b status = txr->tx_base[cur].upper.fields.status; updated = !!(status & E1000_TXD_STAT_DD); - if (clear == false || updated == 0) - return (updated); + if (!updated) + return (0); + /* If clear is false just let caller know that there + * are descriptors to reclaim */ + if (!clear) + return (1); + prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { @@ -553,22 +558,14 @@ lem_isc_rxd_available(void *arg, uint16_t rxqid, qidx_ u32 staterr = 0; int cnt, i; - if (budget == 1) { - rxd = (struct e1000_rx_desc *)&rxr->rx_base[idx]; - staterr = rxd->status; - return (staterr & E1000_RXD_STAT_DD); - } - for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { rxd = (struct e1000_rx_desc *)&rxr->rx_base[i]; staterr = rxd->status; if ((staterr & E1000_RXD_STAT_DD) == 0) break; - if (++i == scctx->isc_nrxd[0]) i = 0; - if (staterr & E1000_RXD_STAT_EOP) cnt++; } @@ -586,26 +583,16 @@ em_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t u32 staterr = 0; int cnt, i; - if (budget == 1) { - rxd = &rxr->rx_base[idx]; - staterr = le32toh(rxd->wb.upper.status_error); - return (staterr & E1000_RXD_STAT_DD); - } - for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { rxd = &rxr->rx_base[i]; staterr = le32toh(rxd->wb.upper.status_error); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - - if (++i == scctx->isc_nrxd[0]) { + if (++i == scctx->isc_nrxd[0]) i = 0; - } - if (staterr & E1000_RXD_STAT_EOP) cnt++; - } return (cnt); } Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Sun Oct 14 01:16:48 2018 (r339353) +++ head/sys/dev/e1000/igb_txrx.c Sun Oct 14 05:09:43 2018 (r339354) @@ -321,9 +321,14 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, status = ((union e1000_adv_tx_desc *)&txr->tx_base[cur])->wb.status; updated = !!(status & E1000_TXD_STAT_DD); - if (!clear || !updated) - return (updated); + if (!updated) + return (0); + /* If clear is false just let caller know that there + * are descriptors to reclaim */ + if (!clear) + return (1); + prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { @@ -392,28 +397,18 @@ igb_isc_rxd_available(void *arg, uint16_t rxqid, qidx_ struct rx_ring *rxr = &que->rxr; union e1000_adv_rx_desc *rxd; u32 staterr = 0; - int cnt, i, iter; + int cnt, i; - if (budget == 1) { - rxd = (union e1000_adv_rx_desc *)&rxr->rx_base[idx]; - staterr = le32toh(rxd->wb.upper.status_error); - return (staterr & E1000_RXD_STAT_DD); - } - - for (iter = cnt = 0, i = idx; iter < scctx->isc_nrxd[0] && iter <= budget;) { + for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { rxd = (union e1000_adv_rx_desc *)&rxr->rx_base[i]; staterr = le32toh(rxd->wb.upper.status_error); if ((staterr & E1000_RXD_STAT_DD) == 0) break; - - if (++i == scctx->isc_nrxd[0]) { + if (++i == scctx->isc_nrxd[0]) i = 0; - } - if (staterr & E1000_RXD_STAT_EOP) cnt++; - iter++; } return (cnt); } Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Sun Oct 14 01:16:48 2018 (r339353) +++ head/sys/dev/ixgbe/ix_txrx.c Sun Oct 14 05:09:43 2018 (r339354) @@ -285,9 +285,14 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid status = txr->tx_base[cur].wb.status; updated = !!(status & IXGBE_TXD_STAT_DD); - if (clear == false || updated == 0) - return (updated); + if (!updated) + return (0); + /* If clear is false just let caller know that there + * are descriptors to reclaim */ + if (!clear) + return (1); + prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { @@ -362,17 +367,8 @@ ixgbe_isc_rxd_available(void *arg, uint16_t qsidx, qid u32 staterr; int cnt, i, nrxd; - if (budget == 1) { - rxd = &rxr->rx_base[pidx]; - staterr = le32toh(rxd->wb.upper.status_error); - - return (staterr & IXGBE_RXD_STAT_DD); - } - nrxd = sc->shared->isc_nrxd[0]; - // em has cnt < nrxd. off by 1 here or there? -// for (cnt = 0, i = pidx; cnt < nrxd && cnt <= budget;) { - for (cnt = 0, i = pidx; cnt < nrxd-1 && cnt <= budget;) { + for (cnt = 0, i = pidx; cnt < nrxd && cnt <= budget;) { rxd = &rxr->rx_base[i]; staterr = le32toh(rxd->wb.upper.status_error); @@ -383,7 +379,6 @@ ixgbe_isc_rxd_available(void *arg, uint16_t qsidx, qid if (staterr & IXGBE_RXD_STAT_EOP) cnt++; } - return (cnt); } /* ixgbe_isc_rxd_available */ From owner-svn-src-head@freebsd.org Sun Oct 14 17:34:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E848810DC95F; Sun, 14 Oct 2018 17:34:47 +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 2614A93DEE; Sun, 14 Oct 2018 17:34:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id BkHpgLXhx5HxqBkHrgRj57; Sun, 14 Oct 2018 11:34:44 -0600 X-Authority-Analysis: v=2.3 cv=BMcHU2YG c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=smKx5t2vBNcA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=4Cvd4rCqXY8IQkmsnL4A:9 a=nPIZNYLz3_kZIvjP:21 a=QWIVYixRJyHsJuYc:21 a=QEXdDO2ut3YA:10 a=8msJMu4u7WDcyy4PkWUA:9 a=OxBtRJrlC-9Wvona:21 a=9ss-RqM5ZaIXugqW:21 a=gwKWubycPRIv2dC6:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [25.82.157.51] (unknown [24.244.29.129]) by spqr.komquats.com (Postfix) with ESMTPSA id 282E52DF8; Sun, 14 Oct 2018 10:34:41 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r339355 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Sun, 14 Oct 2018 11:34:50 -0600 To: Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <20181014173441.282E52DF8@spqr.komquats.com> X-CMAE-Envelope: MS4wfOckEMD+ZyhIbGaCoCjDmEargSpGhTWzB+GNanGA3BLHNO3O+dauvJQU3iN8GmcJwd5yugo7+LV3s8koXwcpcyaBl/WsxlkviMd8k7zAtjd3ufgO8aTb uD4/6cYP/5eWrQ5WCiaOxmpf1H3UuwAB30FAr3xWDPkcgNuVDxXLWdBSMfKeBweU+q7pDpz7R4NFkhWt3rhFzPdRu6k5Uigan7XDTOcHEeHLHaMteSsaHbMD rh8Jzj52FqrHq3MXJ0Y4ey6IxqlGsiGHtdD0n5PQ9Jyn3IQPsPd8clUcMoqR0AHA Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 14 Oct 2018 17:34:48 -0000 Thank you. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubert or The need of the many outweighs the greed of the few. --- -----Original Message----- From: Mateusz Guzik Sent: 14/10/2018 10:14 To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: svn commit: r339355 - head/sys/cddl/contrib/opensolaris/uts/common= /fs/zfs Author: mjg Date: Sun Oct 14 16:14:01 2018 New Revision: 339355 URL: https://svnweb.freebsd.org/changeset/base/339355 Log: zfs: fix a panic after failed mount =20 r338927("zfs: depessimize zfs_root with rmlocks") failed to error check the mount before caching root vnode. =20 Results in crashes in rrw_enter_read_impl tracing back to zfs_mount. =20 Reported by: Mike Tancsa Tested by: allanjude Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.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/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Oc= t 14 05:09:43 2018 (r339354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Oc= t 14 16:14:01 2018 (r339355) @@ -1929,7 +1929,8 @@ zfs_mount(vfs_t *vfsp) error =3D zfs_domount(vfsp, osname); PICKUP_GIANT(); =20 - zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data); + if (error =3D=3D 0) + zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data); =20 #ifdef illumos /* From owner-svn-src-head@freebsd.org Sun Oct 14 16:14:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EDB010D973D; Sun, 14 Oct 2018 16:14:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E96348E825; Sun, 14 Oct 2018 16:14:01 +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 E400120975; Sun, 14 Oct 2018 16:14:01 +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 w9EGE1JR000326; Sun, 14 Oct 2018 16:14:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9EGE1bv000325; Sun, 14 Oct 2018 16:14:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201810141614.w9EGE1bv000325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 14 Oct 2018 16:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339355 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 339355 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.27 Precedence: list List-Id: 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, 14 Oct 2018 16:14:02 -0000 Author: mjg Date: Sun Oct 14 16:14:01 2018 New Revision: 339355 URL: https://svnweb.freebsd.org/changeset/base/339355 Log: zfs: fix a panic after failed mount r338927("zfs: depessimize zfs_root with rmlocks") failed to error check the mount before caching root vnode. Results in crashes in rrw_enter_read_impl tracing back to zfs_mount. Reported by: Mike Tancsa Tested by: allanjude Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Oct 14 05:09:43 2018 (r339354) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Oct 14 16:14:01 2018 (r339355) @@ -1929,7 +1929,8 @@ zfs_mount(vfs_t *vfsp) error = zfs_domount(vfsp, osname); PICKUP_GIANT(); - zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data); + if (error == 0) + zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data); #ifdef illumos /* From owner-svn-src-head@freebsd.org Sun Oct 14 18:42:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400B710DEEBC; Sun, 14 Oct 2018 18:42:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E85AB96973; Sun, 14 Oct 2018 18:42:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E31F7222D7; Sun, 14 Oct 2018 18:42:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9EIgs7g083617; Sun, 14 Oct 2018 18:42:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9EIgso3083616; Sun, 14 Oct 2018 18:42:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810141842.w9EIgso3083616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 14 Oct 2018 18:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339356 - in head: lib/libc/sys share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/libc/sys share/man/man4 X-SVN-Commit-Revision: 339356 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.27 Precedence: list List-Id: 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, 14 Oct 2018 18:42:55 -0000 Author: trasz Date: Sun Oct 14 18:42:54 2018 New Revision: 339356 URL: https://svnweb.freebsd.org/changeset/base/339356 Log: Add .Xrs to kqueue(2) from pdfork(2) and procdesc(4), to make EVFILT_PROCDESC easier to find. Approved by: re (rgrimes) MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/lib/libc/sys/pdfork.2 head/share/man/man4/procdesc.4 Modified: head/lib/libc/sys/pdfork.2 ============================================================================== --- head/lib/libc/sys/pdfork.2 Sun Oct 14 16:14:01 2018 (r339355) +++ head/lib/libc/sys/pdfork.2 Sun Oct 14 18:42:54 2018 (r339356) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2017 +.Dd October 14, 2018 .Dt PDFORK 2 .Os .Sh NAME @@ -162,6 +162,7 @@ for .Xr fstat 2 , .Xr kill 2 , .Xr poll 2 , +.Xr kqueue 2 , .Xr wait4 2 , .Xr capsicum 4 , .Xr procdesc 4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Sun Oct 14 16:14:01 2018 (r339355) +++ head/share/man/man4/procdesc.4 Sun Oct 14 18:42:54 2018 (r339356) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2015 +.Dd October 14, 2018 .Dt PROCDESC 4 .Os .Sh NAME @@ -66,6 +66,7 @@ Given a process descriptor, it is possible to query it .Xr pdgetpid 2 , .Xr pdkill 2 , .Xr pdwait4 2 , +.Xr kqueue 2 , .Xr wait4 2 , .Xr capsicum 4 .Sh HISTORY From owner-svn-src-head@freebsd.org Mon Oct 15 09:43:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B2E10D5368; Mon, 15 Oct 2018 09:43:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 431A38CA97; Mon, 15 Oct 2018 09:43:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it1-f169.google.com with SMTP id c85-v6so4477068itd.1; Mon, 15 Oct 2018 02:43:49 -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=qZNaS7RMmRA5ohud4FjdpVP/A7U4LK9ORU4B88MKtjc=; b=dcQG6BiErWL3IWXEtZloGFwxXPCAYouxd5E/XpIMjoFuHTBXLKyikVs2b0RX+3Wpcl Mb6dY7J3q5Xf1pqjQmkdQg5A8fB1Eiq8q1gucpZG2IXdMw/bRRj0bX7abQxcQuOUW/4T UtZVoHBbkhHK0Ga0xECbfPl79xTCfIaKyadMM6sVAQZkPTdZu8D9p6TnWlQJteJtZM/v uS/FPRq4cZBkkmKjcpqSnfksB6YNLdI23SgY85RzGcsiJoZouo6YIzplorGM8su1JhSz N9WljjoBeYh/16+OjHU4+h9dq+BH/IwhpgvPhCJWQIvyFfpF1MbYwBGZ3Ud0U0IhdoCa f23Q== X-Gm-Message-State: ABuFfoi25gEiqg9ZGu16dnFA/8WQS2JhKczl+iic9cP6jz1SQ+rYIMvf GsyNL9sa7+VDVuPhrckSPjC8EaTDO6Zlc/mTDCZnBRif X-Google-Smtp-Source: ACcGV60S9B3rI8cRJ8FYL0uGklkTMkqd/MN2iooxnp8QaOXwHOBcDXFaJGJWlljtSegCpAdkgz6NsNMz+YMxx0DU5/Y= X-Received: by 2002:a24:fe86:: with SMTP id w128-v6mr9106482ith.84.1539596288854; Mon, 15 Oct 2018 02:38:08 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: <201810132126.w9DLQ73C022496@repo.freebsd.org> From: Antoine Brodin Date: Mon, 15 Oct 2018 11:37:57 +0200 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Ed Maste , re Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 15 Oct 2018 09:43:49 -0000 On Sat, Oct 13, 2018 at 11:26 PM Ed Maste wrote: > > Author: emaste > Date: Sat Oct 13 21:26:07 2018 > New Revision: 339350 > URL: https://svnweb.freebsd.org/changeset/base/339350 > > Log: > elfcopy: delete filter_reloc, it is broken and unnecessary > > elfcopy contained logic to filter individual relocations in STRIP_ALL > mode. However, this is not valid; relocations emitted by the linker are > required, unless they apply to an entire section being removed (which is > handled by other logic in elfcopy). > > Note that filter_reloc was also buggy: for RELA relocation sections it > operated on uninitialized rel.r_info resulting in invalid operation. > > The logic most likely needs to be inverted: instead of removing > relocations because their associated symbols are being removed, we must > keep symbols referenced by relocations. That said, in practice we do > not encounter this code path today: objects being stripped are either > dynamically linked binaries which retain .dynsym, or static binaries > with no relocations. > > Just remove filter_reloc. This fixes certain cases including statically > linked binaries containing ifuncs. Stripping binaries with relocations > referencing removed symbols was already broken, and after this change > may still be broken in a different way. > > PR: 232176 > Reviewed by: kaiw, kib, markj > Approved by: re (rgrimes) > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17519 > > Modified: > head/contrib/elftoolchain/elfcopy/sections.c Hi, This commit broke lang/gcc* : http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc48-4.8.5_9.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc49-4.9.4_8.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc5-5.5.0_5.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc7-7.3.0_5.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc8-8.2.0_1.log etc. Antoine From owner-svn-src-head@freebsd.org Mon Oct 15 10:25:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E35B10D64CB; Mon, 15 Oct 2018 10:25:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E69BF8E1E5; Mon, 15 Oct 2018 10:25:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E17D13F0F; Mon, 15 Oct 2018 10:25:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FAPYKk067661; Mon, 15 Oct 2018 10:25:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FAPYw5067660; Mon, 15 Oct 2018 10:25:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810151025.w9FAPYw5067660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 15 Oct 2018 10:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339357 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 339357 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.27 Precedence: list List-Id: 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, 15 Oct 2018 10:25:35 -0000 Author: ae Date: Mon Oct 15 10:25:34 2018 New Revision: 339357 URL: https://svnweb.freebsd.org/changeset/base/339357 Log: Add extra parentheses to fix "versrcreach" opcode, (oif != NULL) should not be used as condition for ternary operator. Submitted by: Tatsuki Makino Approved by: re (kib) MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sun Oct 14 18:42:54 2018 (r339356) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Oct 15 10:25:34 2018 (r339357) @@ -2355,13 +2355,13 @@ do { \ case O_VERSRCREACH: /* Outgoing packets automatically pass/match */ - match = (hlen > 0 && ((oif != NULL) || + match = (hlen > 0 && ((oif != NULL) || ( #ifdef INET6 is_ipv6 ? verify_path6(&(args->f_id.src_ip6), NULL, args->f_id.fib) : #endif - verify_path(src_ip, NULL, args->f_id.fib))); + verify_path(src_ip, NULL, args->f_id.fib)))); break; case O_ANTISPOOF: From owner-svn-src-head@freebsd.org Mon Oct 15 10:29:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB57D10D6664; Mon, 15 Oct 2018 10:29:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8788E5A6; Mon, 15 Oct 2018 10:29:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D1D83F1E; Mon, 15 Oct 2018 10:29:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FATUc4068149; Mon, 15 Oct 2018 10:29:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FATU8r068148; Mon, 15 Oct 2018 10:29:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810151029.w9FATU8r068148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Oct 2018 10:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339358 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 339358 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.27 Precedence: list List-Id: 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, 15 Oct 2018 10:29:31 -0000 Author: hselasky Date: Mon Oct 15 10:29:29 2018 New Revision: 339358 URL: https://svnweb.freebsd.org/changeset/base/339358 Log: Fix deadlock when destroying VLANs. Synchronizing the epoch before freeing the multicast addresses while holding the VLAN_XLOCK() might lead to a deadlock. Use deferred freeing of the VLAN multicast addresses to resolve deadlock. Backtrace: Thread1: epoch_block_handler_preempt() ck_epoch_synchronize_wait() epoch_wait_preempt() vlan_setmulti() vlan_ioctl() in6m_release_task() gtaskqueue_run_locked() gtaskqueue_thread_loop() fork_exit() fork_trampoline() Thread2: sleepq_switch() sleepq_wait() _sx_xlock_hard() _sx_xlock() in6_leavegroup() in6_purgeaddr() if_purgeaddrs() if_detach_internal() if_detach() vlan_clone_destroy() if_clone_destroyif() if_clone_destroy() ifioctl() kern_ioctl() sys_ioctl() amd64_syscall() fast_syscall_common() syscall() Differential revision: https://reviews.freebsd.org/D17496 Reviewed by: slavash, mmacy Approved by: re (kib) Sponsored by: Mellanox Technologies Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Oct 15 10:25:34 2018 (r339357) +++ head/sys/net/if_vlan.c Mon Oct 15 10:29:29 2018 (r339358) @@ -153,6 +153,7 @@ struct ifvlantrunk { struct vlan_mc_entry { struct sockaddr_dl mc_addr; CK_SLIST_ENTRY(vlan_mc_entry) mc_entries; + struct epoch_context mc_epoch_ctx; }; struct ifvlan { @@ -317,6 +318,13 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) static void +vlan_mc_free(struct epoch_context *ctx) +{ + struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); + free(mc, M_VLAN); +} + +static void vlan_inithash(struct ifvlantrunk *trunk) { int i, n; @@ -572,8 +580,7 @@ vlan_setmulti(struct ifnet *ifp) while ((mc = CK_SLIST_FIRST(&sc->vlan_mc_listhead)) != NULL) { CK_SLIST_REMOVE_HEAD(&sc->vlan_mc_listhead, mc_entries); (void)if_delmulti(ifp_p, (struct sockaddr *)&mc->mc_addr); - NET_EPOCH_WAIT(); - free(mc, M_VLAN); + epoch_call(net_epoch_preempt, &mc->mc_epoch_ctx, vlan_mc_free); } /* Now program new ones. */ @@ -1485,8 +1492,7 @@ vlan_unconfig_locked(struct ifnet *ifp, int departing) error); } CK_SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); - NET_EPOCH_WAIT(); - free(mc, M_VLAN); + epoch_call(net_epoch_preempt, &mc->mc_epoch_ctx, vlan_mc_free); } vlan_setflags(ifp, 0); /* clear special flags on parent */ From owner-svn-src-head@freebsd.org Mon Oct 15 11:13:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBCA10D7995; Mon, 15 Oct 2018 11:13:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435548FF77; Mon, 15 Oct 2018 11:13:22 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id e74-v6so27068479ita.2; Mon, 15 Oct 2018 04:13:22 -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=mvn0mSmFGV6psoLA+lFZiVN5UJrkPITBiRXXZFWvUJg=; b=g7S4WN07p+WHBdof78L30Y+83r9Du17TY5hTIof0395V4a+pX1BZrvGLY6KYPEu5V3 pqkbjSWfPtRXdO8YeVShupzGktppZuOaRlXDLgr4HtiHYarri0QltveHMojRHchAie+F cjA5QVQdJruPzx4smP3OCdPS5wPxuMspThgqUuj1Z9AXfnKgRs9VU4d4tD1NxHJ5GynT 8SE79VSEIGvBGEZaHrZEAsJyJzBfwbdLm+TTuEnLPP5pweazz+I2doYy9YySwGMEp/IX P07xCQvvbEkftfr9hEw1VcpQnWHKOnAu86rLp4MM+YZFaNNXSoZ0lUT3joLwPYEHU1ub rD3A== X-Gm-Message-State: ABuFfogg/4IJsXMT7fILJsiCTLGXcpqFzKZqc0jeKul8Hi0jU4PYQBAF lnreqqsJZO+MF0jLBr+Paq+JlqJC3tyzrH1EEwFyUFyj X-Google-Smtp-Source: ACcGV63pxIwm3Ruu1nD7mt2CmsdlAjmSVHhLITfbT23BJwoAngkog5us9Ic272QsiKbiNMhVlTQt/KoGEV4202UktS4= X-Received: by 2002:a24:7012:: with SMTP id f18-v6mr11655988itc.87.1539602000590; Mon, 15 Oct 2018 04:13:20 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 15 Oct 2018 07:13:04 -0400 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Antoine Brodin Cc: FreeBSD Release Engineering Team , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 15 Oct 2018 11:13:22 -0000 On Mon, 15 Oct 2018 at 05:43, Antoine Brodin wrote: > > On Sat, Oct 13, 2018 at 11:26 PM Ed Maste wrote: > > > > Author: emaste > > Date: Sat Oct 13 21:26:07 2018 > > New Revision: 339350 > > URL: https://svnweb.freebsd.org/changeset/base/339350 > > > > Log: > > elfcopy: delete filter_reloc, it is broken and unnecessary > > > Hi, > > This commit broke lang/gcc* : Hi Antoine, did you bisect to this rev or does it just look like the most probable candidate? Can you copy a pair of differing .o files (say, gcc/cc1plus-checksum.o) from the work dir to freefall? From owner-svn-src-head@freebsd.org Mon Oct 15 13:53:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B904010DC4C3; Mon, 15 Oct 2018 13:53:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 624B6756B4; Mon, 15 Oct 2018 13:53:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id 134-v6so28727508itz.2; Mon, 15 Oct 2018 06:53:37 -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=8RTlPaIF4kfDygHaKhxs0u48PYaeoacKZkQB8g6vxHM=; b=KK9PNjFb38SMl4A2fVVulADeLP66aVjaA2kstiW4ZcVUFLxhpCJY/D4/TWTmYZiwuk b+BRjyzxcWBmL1IZ/I2nxKDASLhO/wA9IECu74/hQgpEDXa9vCZixm/NjlXEBU9B3MKu Kk9jOp0qr6DHlSDi0KBX4eo2k0D9x4JvYYnDdeG3EBjwHen7J2FlQ8F4DVaw4NxpFs5W BkNmQ26EEKSGap2jxr5D9GoXNDjCy0qiSgNR7kDsWMpv51SNeqYEYxDpTHma+M/ky5OS imGY2RZkC1Nyj2s4r/PfWNQr4VvToGBNwOE+ZTiAvv36GkZn2MgwgKjOv9dC2GJxwxKL XCng== X-Gm-Message-State: ABuFfohQ1gfQWFi1yfcbnM0gTs0Jd9DC0u3JD0YCpoGMrQM7amxXiHUG NyFwQ7BOc9fNvKDrNC+sCYTeCywxtssXzAG3/PVYaA== X-Google-Smtp-Source: ACcGV60b22UB7VmYZn8567lnSc9YfW2lIHUAbV1eOrW4Z54U0CMu3NKIbRAo+8ljAeTrRUtG9WnXWh/BQzNjbCi0+XI= X-Received: by 2002:a24:7012:: with SMTP id f18-v6mr12085622itc.87.1539611610569; Mon, 15 Oct 2018 06:53:30 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 15 Oct 2018 05:54:34 -0400 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Antoine Brodin , gerald@freebsd.org Cc: FreeBSD Release Engineering Team , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 15 Oct 2018 13:53:37 -0000 On Mon, 15 Oct 2018 at 07:13, Ed Maste wrote: > > Hi Antoine, did you bisect to this rev or does it just look like the > most probable candidate? Can you copy a pair of differing .o files > (say, gcc/cc1plus-checksum.o) from the work dir to freefall? Antoine provided a tarball of the work dir to me, and pointed out that the *-checksum.o files are not interesting - they are warnings only and are present prior to the identified change. Comparing one of the other differing files, e.g. stage{2,3}-gcc/expmed.o, demonstrates the problem. Gcc's build machinery is reasonably obfuscated so I'm not sure of the exact set of operations, but I can infer that the stage2/stage3 comparison is running strip on the object files and then comparing the result. Gcc is encountering this part of my strip/objcopy change: > Stripping binaries with relocations > referencing removed symbols was already broken, and after this change > may still be broken in a different way. Stripping symbols and relocations from an object file is not a particularly useful operation, since the object then can't be linked or otherwise used. But it seems Gcc's stage comparison relies on this. I did try running "strip --strip-debug" on stage{2,3}-gcc/expmed.o (a reasonable operation on object files) and that produced identical output. It may well be that a further change to ELF Tool Chain's strip is warranted, but I suspect the most straightforward and reliable fix here will be to just have gcc use GNU strip. From owner-svn-src-head@freebsd.org Mon Oct 15 16:43:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EBF810C1A7E; Mon, 15 Oct 2018 16:43:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C82E57B6E4; Mon, 15 Oct 2018 16:43:07 +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 C321A7D81; Mon, 15 Oct 2018 16:43:07 +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 w9FGh7xQ062013; Mon, 15 Oct 2018 16:43:07 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FGh7KC062012; Mon, 15 Oct 2018 16:43:07 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201810151643.w9FGh7KC062012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 15 Oct 2018 16:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339360 - 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: 339360 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.27 Precedence: list List-Id: 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, 15 Oct 2018 16:43:08 -0000 Author: luporl Date: Mon Oct 15 16:43:07 2018 New Revision: 339360 URL: https://svnweb.freebsd.org/changeset/base/339360 Log: Initialize SPRG0 before its first possible use At early boot, PCPU_GET(), that obtains a pointer from SPRG0, was being used with SPRG0 not yet initialized. If it pointed to an invalid address, the machine would hang. Approved by: re(gjb), jhibbits(mentor) Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Mon Oct 15 10:50:04 2018 (r339359) +++ head/sys/powerpc/powerpc/machdep.c Mon Oct 15 16:43:07 2018 (r339360) @@ -383,12 +383,12 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if (platform_smp_get_bsp(&bsp) != 0) bsp.cr_cpuid = 0; pc = &__pcpu[bsp.cr_cpuid]; + __asm __volatile("mtsprg 0, %0" :: "r"(pc)); pcpu_init(pc, bsp.cr_cpuid, sizeof(struct pcpu)); pc->pc_curthread = &thread0; thread0.td_oncpu = bsp.cr_cpuid; pc->pc_cpuid = bsp.cr_cpuid; pc->pc_hwref = bsp.cr_hwref; - __asm __volatile("mtsprg 0, %0" :: "r"(pc)); /* * Init KDB From owner-svn-src-head@freebsd.org Mon Oct 15 17:16:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2746810C25D7; Mon, 15 Oct 2018 17:16:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C63147C83A; Mon, 15 Oct 2018 17:16:47 +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 BB87910281; Mon, 15 Oct 2018 17:16:47 +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 w9FHGlaK077763; Mon, 15 Oct 2018 17:16:47 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FHGlmF077762; Mon, 15 Oct 2018 17:16:47 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810151716.w9FHGlmF077762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 15 Oct 2018 17:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339361 - head X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339361 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.27 Precedence: list List-Id: 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, 15 Oct 2018 17:16:48 -0000 Author: gjb Date: Mon Oct 15 17:16:47 2018 New Revision: 339361 URL: https://svnweb.freebsd.org/changeset/base/339361 Log: Remove stale libcasper(3) shared libraries following the OpenSSL 1.1.1 update. Reported by: des Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 15 16:43:07 2018 (r339360) +++ head/ObsoleteFiles.inc Mon Oct 15 17:16:47 2018 (r339361) @@ -38,6 +38,19 @@ # xargs -n1 | sort | uniq -d; # done +# 20181015: Stale libcasper(3) files following 20181009: OpenSSL 1.1.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.0 +OLD_LIBS+=lib/casper/libcap_grp.so.0 +OLD_LIBS+=lib/casper/libcap_pwd.so.0 +OLD_LIBS+=lib/casper/libcap_random.so.0 +OLD_LIBS+=lib/casper/libcap_dns.so.0 +OLD_LIBS+=lib/casper/libcap_syslog.so.0 +OLD_LIBS+=usr/lib32/libcap_sysctl.so.0 +OLD_LIBS+=usr/lib32/libcap_grp.so.0 +OLD_LIBS+=usr/lib32/libcap_pwd.so.0 +OLD_LIBS+=usr/lib32/libcap_random.so.0 +OLD_LIBS+=usr/lib32/libcap_dns.so.0 +OLD_LIBS+=usr/lib32/libcap_syslog.so.0 # 20181009: OpenSSL 1.1.1 OLD_FILES+=usr/include/openssl/des_old.h OLD_FILES+=usr/include/openssl/dso.h From owner-svn-src-head@freebsd.org Mon Oct 15 17:23:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E100410C29FC; Mon, 15 Oct 2018 17:23:42 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 949E27CD33; Mon, 15 Oct 2018 17:23:42 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76AE410416; Mon, 15 Oct 2018 17:23:42 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FHNgCk082741; Mon, 15 Oct 2018 17:23:42 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FHNgLx082737; Mon, 15 Oct 2018 17:23:42 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201810151723.w9FHNgLx082737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 15 Oct 2018 17:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339362 - in head/sys: conf dev/ixl modules/iavf X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: conf dev/ixl modules/iavf X-SVN-Commit-Revision: 339362 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.27 Precedence: list List-Id: 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, 15 Oct 2018 17:23:43 -0000 Author: erj Date: Mon Oct 15 17:23:41 2018 New Revision: 339362 URL: https://svnweb.freebsd.org/changeset/base/339362 Log: iavf(4): Finish rename/rebrand internally Rename functions and variables from ixlv to iavf to match the user-facing name change. There shouldn't be any functional changes with this change, but this may help with browsing the source code and reducing diffs in the future. Submitted by: kbowling@ Reviewed by: erj@, sbruno@ Approved by: re (gjb@) Differential Revision: https://reviews.freebsd.org/D17544 Added: head/sys/dev/ixl/iavf.h - copied, changed from r339361, head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/iavf_vc.c - copied, changed from r339361, head/sys/dev/ixl/ixlvc.c head/sys/dev/ixl/if_iavf.c - copied, changed from r339361, head/sys/dev/ixl/if_ixlv.c Deleted: head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/conf/files.amd64 head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_debug.h head/sys/dev/ixl/ixl_pf_iov.c head/sys/modules/iavf/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Oct 15 17:16:47 2018 (r339361) +++ head/sys/conf/files.amd64 Mon Oct 15 17:23:41 2018 (r339362) @@ -271,9 +271,9 @@ dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_i2c.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/if_ixlv.c optional iavf pci \ +dev/ixl/if_iavf.c optional iavf pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixlvc.c optional iavf pci \ +dev/ixl/iavf_vc.c optional iavf pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_txrx.c optional ixl pci | iavf pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" Copied and modified: head/sys/dev/ixl/iavf.h (from r339361, head/sys/dev/ixl/ixlv.h) ============================================================================== --- head/sys/dev/ixl/ixlv.h Mon Oct 15 17:16:47 2018 (r339361, copy source) +++ head/sys/dev/ixl/iavf.h Mon Oct 15 17:23:41 2018 (r339362) @@ -33,40 +33,40 @@ /*$FreeBSD$*/ -#ifndef _IXLV_H_ -#define _IXLV_H_ +#ifndef _IAVF_H_ +#define _IAVF_H_ #include "ixl.h" -#define IXLV_AQ_MAX_ERR 200 -#define IXLV_MAX_FILTERS 128 -#define IXLV_MAX_QUEUES 16 -#define IXLV_AQ_TIMEOUT (1 * hz) +#define IAVF_AQ_MAX_ERR 200 +#define IAVF_MAX_FILTERS 128 +#define IAVF_MAX_QUEUES 16 +#define IAVF_AQ_TIMEOUT (1 * hz) -#define IXLV_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) -#define IXLV_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) -#define IXLV_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) -#define IXLV_FLAG_AQ_ADD_VLAN_FILTER (u32)(1 << 3) -#define IXLV_FLAG_AQ_DEL_MAC_FILTER (u32)(1 << 4) -#define IXLV_FLAG_AQ_DEL_VLAN_FILTER (u32)(1 << 5) -#define IXLV_FLAG_AQ_CONFIGURE_QUEUES (u32)(1 << 6) -#define IXLV_FLAG_AQ_MAP_VECTORS (u32)(1 << 7) -#define IXLV_FLAG_AQ_HANDLE_RESET (u32)(1 << 8) -#define IXLV_FLAG_AQ_CONFIGURE_PROMISC (u32)(1 << 9) -#define IXLV_FLAG_AQ_GET_STATS (u32)(1 << 10) -#define IXLV_FLAG_AQ_CONFIG_RSS_KEY (u32)(1 << 11) -#define IXLV_FLAG_AQ_SET_RSS_HENA (u32)(1 << 12) -#define IXLV_FLAG_AQ_GET_RSS_HENA_CAPS (u32)(1 << 13) -#define IXLV_FLAG_AQ_CONFIG_RSS_LUT (u32)(1 << 14) +#define IAVF_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) +#define IAVF_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) +#define IAVF_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) +#define IAVF_FLAG_AQ_ADD_VLAN_FILTER (u32)(1 << 3) +#define IAVF_FLAG_AQ_DEL_MAC_FILTER (u32)(1 << 4) +#define IAVF_FLAG_AQ_DEL_VLAN_FILTER (u32)(1 << 5) +#define IAVF_FLAG_AQ_CONFIGURE_QUEUES (u32)(1 << 6) +#define IAVF_FLAG_AQ_MAP_VECTORS (u32)(1 << 7) +#define IAVF_FLAG_AQ_HANDLE_RESET (u32)(1 << 8) +#define IAVF_FLAG_AQ_CONFIGURE_PROMISC (u32)(1 << 9) +#define IAVF_FLAG_AQ_GET_STATS (u32)(1 << 10) +#define IAVF_FLAG_AQ_CONFIG_RSS_KEY (u32)(1 << 11) +#define IAVF_FLAG_AQ_SET_RSS_HENA (u32)(1 << 12) +#define IAVF_FLAG_AQ_GET_RSS_HENA_CAPS (u32)(1 << 13) +#define IAVF_FLAG_AQ_CONFIG_RSS_LUT (u32)(1 << 14) /* printf %b flag args */ -#define IXLV_FLAGS \ +#define IAVF_FLAGS \ "\20\1ENABLE_QUEUES\2DISABLE_QUEUES\3ADD_MAC_FILTER" \ "\4ADD_VLAN_FILTER\5DEL_MAC_FILTER\6DEL_VLAN_FILTER" \ "\7CONFIGURE_QUEUES\10MAP_VECTORS\11HANDLE_RESET" \ "\12CONFIGURE_PROMISC\13GET_STATS\14CONFIG_RSS_KEY" \ "\15SET_RSS_HENA\16GET_RSS_HENA_CAPS\17CONFIG_RSS_LUT" -#define IXLV_PRINTF_VF_OFFLOAD_FLAGS \ +#define IAVF_PRINTF_VF_OFFLOAD_FLAGS \ "\20\1L2" \ "\2IWARP" \ "\3RSVD" \ @@ -82,34 +82,34 @@ "\26ENCAP_CSUM" \ "\27RX_ENCAP_CSUM" -MALLOC_DECLARE(M_IXLV); +MALLOC_DECLARE(M_IAVF); /* Driver state */ -enum ixlv_state_t { - IXLV_RESET_REQUIRED, - IXLV_RESET_PENDING, - IXLV_INIT_READY, - IXLV_RUNNING, +enum iavf_state_t { + IAVF_RESET_REQUIRED, + IAVF_RESET_PENDING, + IAVF_INIT_READY, + IAVF_RUNNING, }; /* Structs */ -struct ixlv_mac_filter { - SLIST_ENTRY(ixlv_mac_filter) next; +struct iavf_mac_filter { + SLIST_ENTRY(iavf_mac_filter) next; u8 macaddr[ETHER_ADDR_LEN]; u16 flags; }; -SLIST_HEAD(mac_list, ixlv_mac_filter); +SLIST_HEAD(mac_list, iavf_mac_filter); -struct ixlv_vlan_filter { - SLIST_ENTRY(ixlv_vlan_filter) next; +struct iavf_vlan_filter { + SLIST_ENTRY(iavf_vlan_filter) next; u16 vlan; u16 flags; }; -SLIST_HEAD(vlan_list, ixlv_vlan_filter); +SLIST_HEAD(vlan_list, iavf_vlan_filter); /* Software controller structure */ -struct ixlv_sc { +struct iavf_sc { struct ixl_vsi vsi; struct i40e_hw hw; @@ -118,7 +118,7 @@ struct ixlv_sc { struct resource *pci_mem; - enum ixlv_state_t init_state; + enum iavf_state_t init_state; struct ifmedia media; struct virtchnl_version_info version; @@ -159,7 +159,7 @@ struct ixlv_sc { ** unless the Admin on the Host has created one. */ static inline bool -ixlv_check_ether_addr(u8 *addr) +iavf_check_ether_addr(u8 *addr) { bool status = TRUE; @@ -170,49 +170,49 @@ ixlv_check_ether_addr(u8 *addr) } /* Debug printing */ -#define ixlv_dbg(sc, m, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, m, s, ##__VA_ARGS__) -#define ixlv_dbg_init(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IXLV_DBG_INIT, s, ##__VA_ARGS__) -#define ixlv_dbg_info(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IXLV_DBG_INFO, s, ##__VA_ARGS__) -#define ixlv_dbg_vc(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IXLV_DBG_VC, s, ##__VA_ARGS__) -#define ixlv_dbg_filter(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IXLV_DBG_FILTER, s, ##__VA_ARGS__) +#define iavf_dbg(sc, m, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, m, s, ##__VA_ARGS__) +#define iavf_dbg_init(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IAVF_DBG_INIT, s, ##__VA_ARGS__) +#define iavf_dbg_info(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IAVF_DBG_INFO, s, ##__VA_ARGS__) +#define iavf_dbg_vc(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IAVF_DBG_VC, s, ##__VA_ARGS__) +#define iavf_dbg_filter(sc, s, ...) ixl_debug_core(sc->dev, sc->dbg_mask, IAVF_DBG_FILTER, s, ##__VA_ARGS__) /* ** VF Common function prototypes */ -void ixlv_if_init(if_ctx_t ctx); +void iavf_if_init(if_ctx_t ctx); -int ixlv_send_api_ver(struct ixlv_sc *); -int ixlv_verify_api_ver(struct ixlv_sc *); -int ixlv_send_vf_config_msg(struct ixlv_sc *); -int ixlv_get_vf_config(struct ixlv_sc *); -void ixlv_init(void *); -int ixlv_reinit_locked(struct ixlv_sc *); -int ixlv_configure_queues(struct ixlv_sc *); -int ixlv_enable_queues(struct ixlv_sc *); -int ixlv_disable_queues(struct ixlv_sc *); -int ixlv_map_queues(struct ixlv_sc *); -void ixlv_enable_intr(struct ixl_vsi *); -void ixlv_disable_intr(struct ixl_vsi *); -int ixlv_add_ether_filters(struct ixlv_sc *); -int ixlv_del_ether_filters(struct ixlv_sc *); -int ixlv_request_stats(struct ixlv_sc *); -int ixlv_request_reset(struct ixlv_sc *); -void ixlv_vc_completion(struct ixlv_sc *, +int iavf_send_api_ver(struct iavf_sc *); +int iavf_verify_api_ver(struct iavf_sc *); +int iavf_send_vf_config_msg(struct iavf_sc *); +int iavf_get_vf_config(struct iavf_sc *); +void iavf_init(void *); +int iavf_reinit_locked(struct iavf_sc *); +int iavf_configure_queues(struct iavf_sc *); +int iavf_enable_queues(struct iavf_sc *); +int iavf_disable_queues(struct iavf_sc *); +int iavf_map_queues(struct iavf_sc *); +void iavf_enable_intr(struct ixl_vsi *); +void iavf_disable_intr(struct ixl_vsi *); +int iavf_add_ether_filters(struct iavf_sc *); +int iavf_del_ether_filters(struct iavf_sc *); +int iavf_request_stats(struct iavf_sc *); +int iavf_request_reset(struct iavf_sc *); +void iavf_vc_completion(struct iavf_sc *, enum virtchnl_ops, enum virtchnl_status_code, u8 *, u16); -int ixlv_add_ether_filter(struct ixlv_sc *); -int ixlv_add_vlans(struct ixlv_sc *); -int ixlv_del_vlans(struct ixlv_sc *); -void ixlv_update_stats_counters(struct ixlv_sc *, +int iavf_add_ether_filter(struct iavf_sc *); +int iavf_add_vlans(struct iavf_sc *); +int iavf_del_vlans(struct iavf_sc *); +void iavf_update_stats_counters(struct iavf_sc *, struct i40e_eth_stats *); -void ixlv_update_link_status(struct ixlv_sc *); -int ixlv_get_default_rss_key(u32 *, bool); -int ixlv_config_rss_key(struct ixlv_sc *); -int ixlv_set_rss_hena(struct ixlv_sc *); -int ixlv_config_rss_lut(struct ixlv_sc *); -int ixlv_config_promisc_mode(struct ixlv_sc *); +void iavf_update_link_status(struct iavf_sc *); +int iavf_get_default_rss_key(u32 *, bool); +int iavf_config_rss_key(struct iavf_sc *); +int iavf_set_rss_hena(struct iavf_sc *); +int iavf_config_rss_lut(struct iavf_sc *); +int iavf_config_promisc_mode(struct iavf_sc *); -int ixl_vc_send_cmd(struct ixlv_sc *sc, uint32_t request); -char *ixlv_vc_speed_to_string(enum virtchnl_link_speed link_speed); -void *ixl_vc_get_op_chan(struct ixlv_sc *sc, uint32_t request); -#endif /* _IXLV_H_ */ +int ixl_vc_send_cmd(struct iavf_sc *sc, uint32_t request); +char *iavf_vc_speed_to_string(enum virtchnl_link_speed link_speed); +void *ixl_vc_get_op_chan(struct iavf_sc *sc, uint32_t request); +#endif /* _IAVF_H_ */ Copied and modified: head/sys/dev/ixl/iavf_vc.c (from r339361, head/sys/dev/ixl/ixlvc.c) ============================================================================== --- head/sys/dev/ixl/ixlvc.c Mon Oct 15 17:16:47 2018 (r339361, copy source) +++ head/sys/dev/ixl/iavf_vc.c Mon Oct 15 17:23:41 2018 (r339362) @@ -39,19 +39,19 @@ */ #include "ixl.h" -#include "ixlv.h" +#include "iavf.h" /* busy wait delay in msec */ -#define IXLV_BUSY_WAIT_DELAY 10 -#define IXLV_BUSY_WAIT_COUNT 50 +#define IAVF_BUSY_WAIT_DELAY 10 +#define IAVF_BUSY_WAIT_COUNT 50 /* -** ixlv_send_pf_msg +** iavf_send_pf_msg ** ** Send message to PF and print status if failure. */ static int -ixlv_send_pf_msg(struct ixlv_sc *sc, +iavf_send_pf_msg(struct iavf_sc *sc, enum virtchnl_ops op, u8 *msg, u16 len) { struct i40e_hw *hw = &sc->hw; @@ -73,7 +73,7 @@ ixlv_send_pf_msg(struct ixlv_sc *sc, } if (op != VIRTCHNL_OP_GET_STATS) - ixlv_dbg_vc(sc, + iavf_dbg_vc(sc, "Sending msg (op=%s[%d]) to PF\n", ixl_vc_opcode_str(op), op); @@ -89,33 +89,33 @@ ixlv_send_pf_msg(struct ixlv_sc *sc, } /* -** ixlv_send_api_ver +** iavf_send_api_ver ** ** Send API version admin queue message to the PF. The reply is not checked ** in this function. Returns 0 if the message was successfully ** sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. */ int -ixlv_send_api_ver(struct ixlv_sc *sc) +iavf_send_api_ver(struct iavf_sc *sc) { struct virtchnl_version_info vvi; vvi.major = VIRTCHNL_VERSION_MAJOR; vvi.minor = VIRTCHNL_VERSION_MINOR; - return ixlv_send_pf_msg(sc, VIRTCHNL_OP_VERSION, + return iavf_send_pf_msg(sc, VIRTCHNL_OP_VERSION, (u8 *)&vvi, sizeof(vvi)); } /* -** ixlv_verify_api_ver +** iavf_verify_api_ver ** ** Compare API versions with the PF. Must be called after admin queue is ** initialized. Returns 0 if API versions match, EIO if ** they do not, or I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty. */ int -ixlv_verify_api_ver(struct ixlv_sc *sc) +iavf_verify_api_ver(struct iavf_sc *sc) { struct virtchnl_version_info *pf_vvi; struct i40e_hw *hw = &sc->hw; @@ -125,10 +125,10 @@ ixlv_verify_api_ver(struct ixlv_sc *sc) int retries = 0; event.buf_len = IXL_AQ_BUF_SZ; - event.msg_buf = malloc(event.buf_len, M_IXLV, M_WAITOK); + event.msg_buf = malloc(event.buf_len, M_IAVF, M_WAITOK); for (;;) { - if (++retries > IXLV_AQ_MAX_ERR) + if (++retries > IAVF_AQ_MAX_ERR) goto out_alloc; /* Initial delay here is necessary */ @@ -174,19 +174,19 @@ ixlv_verify_api_ver(struct ixlv_sc *sc) VIRTCHNL_VERSION_MAJOR, VIRTCHNL_VERSION_MINOR); out_alloc: - free(event.msg_buf, M_IXLV); + free(event.msg_buf, M_IAVF); return (err); } /* -** ixlv_send_vf_config_msg +** iavf_send_vf_config_msg ** ** Send VF configuration request admin queue message to the PF. The reply ** is not checked in this function. Returns 0 if the message was ** successfully sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. */ int -ixlv_send_vf_config_msg(struct ixlv_sc *sc) +iavf_send_vf_config_msg(struct iavf_sc *sc) { u32 caps; @@ -194,19 +194,19 @@ ixlv_send_vf_config_msg(struct ixlv_sc *sc) VIRTCHNL_VF_OFFLOAD_RSS_PF | VIRTCHNL_VF_OFFLOAD_VLAN; - ixlv_dbg_info(sc, "Sending offload flags: 0x%b\n", - caps, IXLV_PRINTF_VF_OFFLOAD_FLAGS); + iavf_dbg_info(sc, "Sending offload flags: 0x%b\n", + caps, IAVF_PRINTF_VF_OFFLOAD_FLAGS); if (sc->version.minor == VIRTCHNL_VERSION_MINOR_NO_VF_CAPS) - return ixlv_send_pf_msg(sc, VIRTCHNL_OP_GET_VF_RESOURCES, + return iavf_send_pf_msg(sc, VIRTCHNL_OP_GET_VF_RESOURCES, NULL, 0); else - return ixlv_send_pf_msg(sc, VIRTCHNL_OP_GET_VF_RESOURCES, + return iavf_send_pf_msg(sc, VIRTCHNL_OP_GET_VF_RESOURCES, (u8 *)&caps, sizeof(caps)); } /* -** ixlv_get_vf_config +** iavf_get_vf_config ** ** Get VF configuration from PF and populate hw structure. Must be called after ** admin queue is initialized. Busy waits until response is received from PF, @@ -214,7 +214,7 @@ ixlv_send_vf_config_msg(struct ixlv_sc *sc) ** processing by the caller. */ int -ixlv_get_vf_config(struct ixlv_sc *sc) +iavf_get_vf_config(struct iavf_sc *sc) { struct i40e_hw *hw = &sc->hw; device_t dev = sc->dev; @@ -227,12 +227,12 @@ ixlv_get_vf_config(struct ixlv_sc *sc) len = sizeof(struct virtchnl_vf_resource) + sizeof(struct virtchnl_vsi_resource); event.buf_len = len; - event.msg_buf = malloc(event.buf_len, M_IXLV, M_WAITOK); + event.msg_buf = malloc(event.buf_len, M_IAVF, M_WAITOK); for (;;) { err = i40e_clean_arq_element(hw, &event, NULL); if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) { - if (++retries <= IXLV_AQ_MAX_ERR) + if (++retries <= IAVF_AQ_MAX_ERR) i40e_msec_pause(10); } else if ((enum virtchnl_ops)le32toh(event.desc.cookie_high) != VIRTCHNL_OP_GET_VF_RESOURCES) { @@ -256,7 +256,7 @@ ixlv_get_vf_config(struct ixlv_sc *sc) break; } - if (retries > IXLV_AQ_MAX_ERR) { + if (retries > IAVF_AQ_MAX_ERR) { INIT_DBG_DEV(dev, "Did not receive response after %d tries.", retries); err = ETIMEDOUT; @@ -268,17 +268,17 @@ ixlv_get_vf_config(struct ixlv_sc *sc) i40e_vf_parse_hw_config(hw, sc->vf_res); out_alloc: - free(event.msg_buf, M_IXLV); + free(event.msg_buf, M_IAVF); return err; } /* -** ixlv_configure_queues +** iavf_configure_queues ** ** Request that the PF set up our queues. */ int -ixlv_configure_queues(struct ixlv_sc *sc) +iavf_configure_queues(struct iavf_sc *sc) { device_t dev = sc->dev; struct ixl_vsi *vsi = &sc->vsi; @@ -297,7 +297,7 @@ ixlv_configure_queues(struct ixlv_sc *sc) pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); len = sizeof(struct virtchnl_vsi_queue_config_info) + (sizeof(struct virtchnl_queue_pair_info) * pairs); - vqci = malloc(len, M_IXLV, M_NOWAIT | M_ZERO); + vqci = malloc(len, M_IAVF, M_NOWAIT | M_ZERO); if (!vqci) { device_printf(dev, "%s: unable to allocate memory\n", __func__); return (ENOMEM); @@ -336,20 +336,20 @@ ixlv_configure_queues(struct ixlv_sc *sc) vqpi->rxq.splithdr_enabled = 0; } - ixlv_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_VSI_QUEUES, + iavf_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_VSI_QUEUES, (u8 *)vqci, len); - free(vqci, M_IXLV); + free(vqci, M_IAVF); return (0); } /* -** ixlv_enable_queues +** iavf_enable_queues ** ** Request that the PF enable all of our queues. */ int -ixlv_enable_queues(struct ixlv_sc *sc) +iavf_enable_queues(struct iavf_sc *sc) { struct virtchnl_queue_select vqs; @@ -358,18 +358,18 @@ ixlv_enable_queues(struct ixlv_sc *sc) * every queue in VF VSI is enabled. */ vqs.tx_queues = (1 << sc->vsi.num_tx_queues) - 1; vqs.rx_queues = vqs.tx_queues; - ixlv_send_pf_msg(sc, VIRTCHNL_OP_ENABLE_QUEUES, + iavf_send_pf_msg(sc, VIRTCHNL_OP_ENABLE_QUEUES, (u8 *)&vqs, sizeof(vqs)); return (0); } /* -** ixlv_disable_queues +** iavf_disable_queues ** ** Request that the PF disable all of our queues. */ int -ixlv_disable_queues(struct ixlv_sc *sc) +iavf_disable_queues(struct iavf_sc *sc) { struct virtchnl_queue_select vqs; @@ -378,19 +378,19 @@ ixlv_disable_queues(struct ixlv_sc *sc) * every queue in VF VSI is disabled. */ vqs.tx_queues = (1 << sc->vsi.num_tx_queues) - 1; vqs.rx_queues = vqs.tx_queues; - ixlv_send_pf_msg(sc, VIRTCHNL_OP_DISABLE_QUEUES, + iavf_send_pf_msg(sc, VIRTCHNL_OP_DISABLE_QUEUES, (u8 *)&vqs, sizeof(vqs)); return (0); } /* -** ixlv_map_queues +** iavf_map_queues ** ** Request that the PF map queues to interrupt vectors. Misc causes, including ** admin queue, are always mapped to vector 0. */ int -ixlv_map_queues(struct ixlv_sc *sc) +iavf_map_queues(struct iavf_sc *sc) { struct virtchnl_irq_map_info *vm; int i, q, len; @@ -408,7 +408,7 @@ ixlv_map_queues(struct ixlv_sc *sc) len = sizeof(struct virtchnl_irq_map_info) + (scctx->isc_vectors * sizeof(struct virtchnl_vector_map)); - vm = malloc(len, M_IXLV, M_NOWAIT); + vm = malloc(len, M_IAVF, M_NOWAIT); if (!vm) { device_printf(dev, "%s: unable to allocate memory\n", __func__); return (ENOMEM); @@ -434,9 +434,9 @@ ixlv_map_queues(struct ixlv_sc *sc) vm->vecmap[i].rxitr_idx = 0; vm->vecmap[i].txitr_idx = 0; - ixlv_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_IRQ_MAP, + iavf_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_IRQ_MAP, (u8 *)vm, len); - free(vm, M_IXLV); + free(vm, M_IAVF); return (0); } @@ -447,10 +447,10 @@ ixlv_map_queues(struct ixlv_sc *sc) ** for handling. */ int -ixlv_add_vlans(struct ixlv_sc *sc) +iavf_add_vlans(struct iavf_sc *sc) { struct virtchnl_vlan_filter_list *v; - struct ixlv_vlan_filter *f, *ftmp; + struct iavf_vlan_filter *f, *ftmp; device_t dev = sc->dev; int len, i = 0, cnt = 0; @@ -472,7 +472,7 @@ ixlv_add_vlans(struct ixlv_sc *sc) return (EFBIG); } - v = malloc(len, M_IXLV, M_NOWAIT); + v = malloc(len, M_IAVF, M_NOWAIT); if (!v) { device_printf(dev, "%s: unable to allocate memory\n", __func__); @@ -493,8 +493,8 @@ ixlv_add_vlans(struct ixlv_sc *sc) break; } - ixlv_send_pf_msg(sc, VIRTCHNL_OP_ADD_VLAN, (u8 *)v, len); - free(v, M_IXLV); + iavf_send_pf_msg(sc, VIRTCHNL_OP_ADD_VLAN, (u8 *)v, len); + free(v, M_IAVF); /* add stats? */ return (0); } @@ -505,10 +505,10 @@ ixlv_add_vlans(struct ixlv_sc *sc) ** for handling. */ int -ixlv_del_vlans(struct ixlv_sc *sc) +iavf_del_vlans(struct iavf_sc *sc) { struct virtchnl_vlan_filter_list *v; - struct ixlv_vlan_filter *f, *ftmp; + struct iavf_vlan_filter *f, *ftmp; device_t dev = sc->dev; int len, i = 0, cnt = 0; @@ -530,7 +530,7 @@ ixlv_del_vlans(struct ixlv_sc *sc) return (EFBIG); } - v = malloc(len, M_IXLV, M_NOWAIT | M_ZERO); + v = malloc(len, M_IAVF, M_NOWAIT | M_ZERO); if (!v) { device_printf(dev, "%s: unable to allocate memory\n", __func__); @@ -545,15 +545,15 @@ ixlv_del_vlans(struct ixlv_sc *sc) if (f->flags & IXL_FILTER_DEL) { bcopy(&f->vlan, &v->vlan_id[i], sizeof(u16)); i++; - SLIST_REMOVE(sc->vlan_filters, f, ixlv_vlan_filter, next); - free(f, M_IXLV); + SLIST_REMOVE(sc->vlan_filters, f, iavf_vlan_filter, next); + free(f, M_IAVF); } if (i == cnt) break; } - ixlv_send_pf_msg(sc, VIRTCHNL_OP_DEL_VLAN, (u8 *)v, len); - free(v, M_IXLV); + iavf_send_pf_msg(sc, VIRTCHNL_OP_DEL_VLAN, (u8 *)v, len); + free(v, M_IAVF); /* add stats? */ return (0); } @@ -565,10 +565,10 @@ ixlv_del_vlans(struct ixlv_sc *sc) ** the filters in the hardware. */ int -ixlv_add_ether_filters(struct ixlv_sc *sc) +iavf_add_ether_filters(struct iavf_sc *sc) { struct virtchnl_ether_addr_list *a; - struct ixlv_mac_filter *f; + struct iavf_mac_filter *f; device_t dev = sc->dev; int len, j = 0, cnt = 0; enum i40e_status_code status; @@ -579,14 +579,14 @@ ixlv_add_ether_filters(struct ixlv_sc *sc) cnt++; } if (cnt == 0) { /* Should not happen... */ - ixlv_dbg_vc(sc, "%s: cnt == 0, exiting...\n", __func__); + iavf_dbg_vc(sc, "%s: cnt == 0, exiting...\n", __func__); return (ENOENT); } len = sizeof(struct virtchnl_ether_addr_list) + (cnt * sizeof(struct virtchnl_ether_addr)); - a = malloc(len, M_IXLV, M_NOWAIT | M_ZERO); + a = malloc(len, M_IAVF, M_NOWAIT | M_ZERO); if (a == NULL) { device_printf(dev, "%s: Failed to get memory for " "virtchnl_ether_addr_list\n", __func__); @@ -602,7 +602,7 @@ ixlv_add_ether_filters(struct ixlv_sc *sc) f->flags &= ~IXL_FILTER_ADD; j++; - ixlv_dbg_vc(sc, "ADD: " MAC_FORMAT "\n", + iavf_dbg_vc(sc, "ADD: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr)); } if (j == cnt) @@ -611,10 +611,10 @@ ixlv_add_ether_filters(struct ixlv_sc *sc) DDPRINTF(dev, "len %d, j %d, cnt %d", len, j, cnt); - status = ixlv_send_pf_msg(sc, + status = iavf_send_pf_msg(sc, VIRTCHNL_OP_ADD_ETH_ADDR, (u8 *)a, len); /* add stats? */ - free(a, M_IXLV); + free(a, M_IAVF); return (status); } @@ -624,10 +624,10 @@ ixlv_add_ether_filters(struct ixlv_sc *sc) ** to delete those filters in the hardware. */ int -ixlv_del_ether_filters(struct ixlv_sc *sc) +iavf_del_ether_filters(struct iavf_sc *sc) { struct virtchnl_ether_addr_list *d; - struct ixlv_mac_filter *f, *f_temp; + struct iavf_mac_filter *f, *f_temp; device_t dev = sc->dev; int len, j = 0, cnt = 0; @@ -637,14 +637,14 @@ ixlv_del_ether_filters(struct ixlv_sc *sc) cnt++; } if (cnt == 0) { - ixlv_dbg_vc(sc, "%s: cnt == 0, exiting...\n", __func__); + iavf_dbg_vc(sc, "%s: cnt == 0, exiting...\n", __func__); return (ENOENT); } len = sizeof(struct virtchnl_ether_addr_list) + (cnt * sizeof(struct virtchnl_ether_addr)); - d = malloc(len, M_IXLV, M_NOWAIT | M_ZERO); + d = malloc(len, M_IAVF, M_NOWAIT | M_ZERO); if (d == NULL) { device_printf(dev, "%s: Failed to get memory for " "virtchnl_ether_addr_list\n", __func__); @@ -657,28 +657,28 @@ ixlv_del_ether_filters(struct ixlv_sc *sc) SLIST_FOREACH_SAFE(f, sc->mac_filters, next, f_temp) { if (f->flags & IXL_FILTER_DEL) { bcopy(f->macaddr, d->list[j].addr, ETHER_ADDR_LEN); - ixlv_dbg_vc(sc, "DEL: " MAC_FORMAT "\n", + iavf_dbg_vc(sc, "DEL: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr)); j++; - SLIST_REMOVE(sc->mac_filters, f, ixlv_mac_filter, next); - free(f, M_IXLV); + SLIST_REMOVE(sc->mac_filters, f, iavf_mac_filter, next); + free(f, M_IAVF); } if (j == cnt) break; } - ixlv_send_pf_msg(sc, + iavf_send_pf_msg(sc, VIRTCHNL_OP_DEL_ETH_ADDR, (u8 *)d, len); /* add stats? */ - free(d, M_IXLV); + free(d, M_IAVF); return (0); } /* -** ixlv_request_reset +** iavf_request_reset ** Request that the PF reset this VF. No response is expected. */ int -ixlv_request_reset(struct ixlv_sc *sc) +iavf_request_reset(struct iavf_sc *sc) { /* ** Set the reset status to "in progress" before @@ -686,23 +686,23 @@ ixlv_request_reset(struct ixlv_sc *sc) ** a mistaken early detection of completion. */ wr32(&sc->hw, I40E_VFGEN_RSTAT, VIRTCHNL_VFR_INPROGRESS); - ixlv_send_pf_msg(sc, VIRTCHNL_OP_RESET_VF, NULL, 0); + iavf_send_pf_msg(sc, VIRTCHNL_OP_RESET_VF, NULL, 0); return (0); } /* -** ixlv_request_stats +** iavf_request_stats ** Request the statistics for this VF's VSI from PF. */ int -ixlv_request_stats(struct ixlv_sc *sc) +iavf_request_stats(struct iavf_sc *sc) { struct virtchnl_queue_select vqs; int error = 0; vqs.vsi_id = sc->vsi_res->vsi_id; /* Low priority, we don't need to error check */ - error = ixlv_send_pf_msg(sc, VIRTCHNL_OP_GET_STATS, + error = iavf_send_pf_msg(sc, VIRTCHNL_OP_GET_STATS, (u8 *)&vqs, sizeof(vqs)); if (error) device_printf(sc->dev, "Error sending stats request to PF: %d\n", error); @@ -714,7 +714,7 @@ ixlv_request_stats(struct ixlv_sc *sc) ** Updates driver's stats counters with VSI stats returned from PF. */ void -ixlv_update_stats_counters(struct ixlv_sc *sc, struct i40e_eth_stats *es) +iavf_update_stats_counters(struct iavf_sc *sc, struct i40e_eth_stats *es) { struct ixl_vsi *vsi = &sc->vsi; uint64_t tx_discards; @@ -747,7 +747,7 @@ ixlv_update_stats_counters(struct ixlv_sc *sc, struct } int -ixlv_config_rss_key(struct ixlv_sc *sc) +iavf_config_rss_key(struct iavf_sc *sc) { struct virtchnl_rss_key *rss_key_msg; int msg_len, key_length; @@ -763,7 +763,7 @@ ixlv_config_rss_key(struct ixlv_sc *sc) /* Send the fetched key */ key_length = IXL_RSS_KEY_SIZE; msg_len = sizeof(struct virtchnl_rss_key) + (sizeof(u8) * key_length) - 1; - rss_key_msg = malloc(msg_len, M_IXLV, M_NOWAIT | M_ZERO); + rss_key_msg = malloc(msg_len, M_IAVF, M_NOWAIT | M_ZERO); if (rss_key_msg == NULL) { device_printf(sc->dev, "Unable to allocate msg memory for RSS key msg.\n"); return (ENOMEM); @@ -773,18 +773,18 @@ ixlv_config_rss_key(struct ixlv_sc *sc) rss_key_msg->key_len = key_length; bcopy(rss_seed, &rss_key_msg->key[0], key_length); - ixlv_dbg_vc(sc, "config_rss: vsi_id %d, key_len %d\n", + iavf_dbg_vc(sc, "config_rss: vsi_id %d, key_len %d\n", rss_key_msg->vsi_id, rss_key_msg->key_len); - ixlv_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_RSS_KEY, + iavf_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_RSS_KEY, (u8 *)rss_key_msg, msg_len); - free(rss_key_msg, M_IXLV); + free(rss_key_msg, M_IAVF); return (0); } int -ixlv_set_rss_hena(struct ixlv_sc *sc) +iavf_set_rss_hena(struct iavf_sc *sc) { struct virtchnl_rss_hena hena; struct i40e_hw *hw = &sc->hw; @@ -794,13 +794,13 @@ ixlv_set_rss_hena(struct ixlv_sc *sc) else hena.hena = IXL_DEFAULT_RSS_HENA_XL710; - ixlv_send_pf_msg(sc, VIRTCHNL_OP_SET_RSS_HENA, + iavf_send_pf_msg(sc, VIRTCHNL_OP_SET_RSS_HENA, (u8 *)&hena, sizeof(hena)); return (0); } int -ixlv_config_rss_lut(struct ixlv_sc *sc) +iavf_config_rss_lut(struct iavf_sc *sc) { struct virtchnl_rss_lut *rss_lut_msg; int msg_len; @@ -810,7 +810,7 @@ ixlv_config_rss_lut(struct ixlv_sc *sc) lut_length = IXL_RSS_VSI_LUT_SIZE; msg_len = sizeof(struct virtchnl_rss_lut) + (lut_length * sizeof(u8)) - 1; - rss_lut_msg = malloc(msg_len, M_IXLV, M_NOWAIT | M_ZERO); + rss_lut_msg = malloc(msg_len, M_IAVF, M_NOWAIT | M_ZERO); if (rss_lut_msg == NULL) { device_printf(sc->dev, "Unable to allocate msg memory for RSS lut msg.\n"); return (ENOMEM); @@ -837,42 +837,42 @@ ixlv_config_rss_lut(struct ixlv_sc *sc) rss_lut_msg->lut[i] = lut; } - ixlv_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_RSS_LUT, + iavf_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_RSS_LUT, (u8 *)rss_lut_msg, msg_len); - free(rss_lut_msg, M_IXLV); + free(rss_lut_msg, M_IAVF); return (0); } int -ixlv_config_promisc_mode(struct ixlv_sc *sc) +iavf_config_promisc_mode(struct iavf_sc *sc) { struct virtchnl_promisc_info pinfo; pinfo.vsi_id = sc->vsi_res->vsi_id; pinfo.flags = sc->promisc_flags; - ixlv_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, + iavf_send_pf_msg(sc, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, (u8 *)&pinfo, sizeof(pinfo)); return (0); } /* -** ixlv_vc_completion +** iavf_vc_completion ** ** Asynchronous completion function for admin queue messages. Rather than busy ** wait, we fire off our requests and assume that no errors will be returned. ** This function handles the reply messages. */ void -ixlv_vc_completion(struct ixlv_sc *sc, +iavf_vc_completion(struct iavf_sc *sc, enum virtchnl_ops v_opcode, enum virtchnl_status_code v_retval, u8 *msg, u16 msglen) { device_t dev = sc->dev; if (v_opcode != VIRTCHNL_OP_GET_STATS) - ixlv_dbg_vc(sc, "%s: opcode %s\n", __func__, + iavf_dbg_vc(sc, "%s: opcode %s\n", __func__, ixl_vc_opcode_str(v_opcode)); if (v_opcode == VIRTCHNL_OP_EVENT) { @@ -881,22 +881,22 @@ ixlv_vc_completion(struct ixlv_sc *sc, switch (vpe->event) { case VIRTCHNL_EVENT_LINK_CHANGE: - ixlv_dbg_vc(sc, "Link change: status %d, speed %s\n", + iavf_dbg_vc(sc, "Link change: status %d, speed %s\n", vpe->event_data.link_event.link_status, - ixlv_vc_speed_to_string(vpe->event_data.link_event.link_speed)); + iavf_vc_speed_to_string(vpe->event_data.link_event.link_speed)); sc->link_up = vpe->event_data.link_event.link_status; sc->link_speed = vpe->event_data.link_event.link_speed; - ixlv_update_link_status(sc); + iavf_update_link_status(sc); break; case VIRTCHNL_EVENT_RESET_IMPENDING: device_printf(dev, "PF initiated reset!\n"); - sc->init_state = IXLV_RESET_PENDING; - ixlv_if_init(sc->vsi.ctx); + sc->init_state = IAVF_RESET_PENDING; + iavf_if_init(sc->vsi.ctx); break; default: - ixlv_dbg_vc(sc, "Unknown event %d from AQ\n", + iavf_dbg_vc(sc, "Unknown event %d from AQ\n", vpe->event); break; } @@ -913,7 +913,7 @@ ixlv_vc_completion(struct ixlv_sc *sc, switch (v_opcode) { case VIRTCHNL_OP_GET_STATS: - ixlv_update_stats_counters(sc, (struct i40e_eth_stats *)msg); + iavf_update_stats_counters(sc, (struct i40e_eth_stats *)msg); break; case VIRTCHNL_OP_ADD_ETH_ADDR: if (v_retval) { @@ -948,7 +948,7 @@ ixlv_vc_completion(struct ixlv_sc *sc, case VIRTCHNL_OP_CONFIG_RSS_LUT: break; default: - ixlv_dbg_vc(sc, + iavf_dbg_vc(sc, "Received unexpected message %s from PF.\n", ixl_vc_opcode_str(v_opcode)); break; @@ -956,57 +956,57 @@ ixlv_vc_completion(struct ixlv_sc *sc, } int -ixl_vc_send_cmd(struct ixlv_sc *sc, uint32_t request) +ixl_vc_send_cmd(struct iavf_sc *sc, uint32_t request) { switch (request) { - case IXLV_FLAG_AQ_MAP_VECTORS: - return ixlv_map_queues(sc); + case IAVF_FLAG_AQ_MAP_VECTORS: + return iavf_map_queues(sc); - case IXLV_FLAG_AQ_ADD_MAC_FILTER: - return ixlv_add_ether_filters(sc); + case IAVF_FLAG_AQ_ADD_MAC_FILTER: + return iavf_add_ether_filters(sc); - case IXLV_FLAG_AQ_ADD_VLAN_FILTER: - return ixlv_add_vlans(sc); + case IAVF_FLAG_AQ_ADD_VLAN_FILTER: + return iavf_add_vlans(sc); - case IXLV_FLAG_AQ_DEL_MAC_FILTER: - return ixlv_del_ether_filters(sc); + case IAVF_FLAG_AQ_DEL_MAC_FILTER: + return iavf_del_ether_filters(sc); - case IXLV_FLAG_AQ_DEL_VLAN_FILTER: - return ixlv_del_vlans(sc); + case IAVF_FLAG_AQ_DEL_VLAN_FILTER: + return iavf_del_vlans(sc); - case IXLV_FLAG_AQ_CONFIGURE_QUEUES: - return ixlv_configure_queues(sc); + case IAVF_FLAG_AQ_CONFIGURE_QUEUES: + return iavf_configure_queues(sc); - case IXLV_FLAG_AQ_DISABLE_QUEUES: - return ixlv_disable_queues(sc); + case IAVF_FLAG_AQ_DISABLE_QUEUES: + return iavf_disable_queues(sc); - case IXLV_FLAG_AQ_ENABLE_QUEUES: - return ixlv_enable_queues(sc); + case IAVF_FLAG_AQ_ENABLE_QUEUES: + return iavf_enable_queues(sc); - case IXLV_FLAG_AQ_CONFIG_RSS_KEY: - return ixlv_config_rss_key(sc); + case IAVF_FLAG_AQ_CONFIG_RSS_KEY: + return iavf_config_rss_key(sc); - case IXLV_FLAG_AQ_SET_RSS_HENA: - return ixlv_set_rss_hena(sc); + case IAVF_FLAG_AQ_SET_RSS_HENA: + return iavf_set_rss_hena(sc); - case IXLV_FLAG_AQ_CONFIG_RSS_LUT: - return ixlv_config_rss_lut(sc); + case IAVF_FLAG_AQ_CONFIG_RSS_LUT: + return iavf_config_rss_lut(sc); - case IXLV_FLAG_AQ_CONFIGURE_PROMISC: - return ixlv_config_promisc_mode(sc); + case IAVF_FLAG_AQ_CONFIGURE_PROMISC: + return iavf_config_promisc_mode(sc); } return (0); } void * -ixl_vc_get_op_chan(struct ixlv_sc *sc, uint32_t request) +ixl_vc_get_op_chan(struct iavf_sc *sc, uint32_t request) { switch (request) { - case IXLV_FLAG_AQ_ENABLE_QUEUES: + case IAVF_FLAG_AQ_ENABLE_QUEUES: return (&sc->enable_queues_chan); - case IXLV_FLAG_AQ_DISABLE_QUEUES: + case IAVF_FLAG_AQ_DISABLE_QUEUES: return (&sc->disable_queues_chan); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 15 17:50:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 238ED10C3346; Mon, 15 Oct 2018 17:50:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 813A37DAFA; Mon, 15 Oct 2018 17:50:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77D68107B7; Mon, 15 Oct 2018 17:50:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FHo34Y093721; Mon, 15 Oct 2018 17:50:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FHo34R093720; Mon, 15 Oct 2018 17:50:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810151750.w9FHo34R093720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Oct 2018 17:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339363 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 339363 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.27 Precedence: list List-Id: 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, 15 Oct 2018 17:50:04 -0000 Author: trasz Date: Mon Oct 15 17:50:02 2018 New Revision: 339363 URL: https://svnweb.freebsd.org/changeset/base/339363 Log: Don't call dlopen(3) for built-in NSS types - "cache", "compat", "dns", "files", "db", and "nis". It saves some path lookups during binary startup. Reviewed by: markj Approved by: re (gjb, kib) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17557 Modified: head/lib/libc/net/nsdispatch.3 head/lib/libc/net/nsdispatch.c Modified: head/lib/libc/net/nsdispatch.3 ============================================================================== --- head/lib/libc/net/nsdispatch.3 Mon Oct 15 17:23:41 2018 (r339362) +++ head/lib/libc/net/nsdispatch.3 Mon Oct 15 17:50:02 2018 (r339363) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2010 +.Dd October 15, 2018 .Dt NSDISPATCH 3 .Os .Sh NAME @@ -112,10 +112,7 @@ which case they are selected using the and .Fa method_name arguments along with the configured source. -(The methods supplied via -.Fa dtab -take priority over those implemented in NSS modules in the event -of a conflict.) +Modules must use source names different from the built-in ones. .Pp .Va defaults contains a list of default sources to try if Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Mon Oct 15 17:23:41 2018 (r339362) +++ head/lib/libc/net/nsdispatch.c Mon Oct 15 17:50:02 2018 (r339363) @@ -486,9 +486,19 @@ nss_load_module(const char *source, nss_module_registe */ mod.handle = nss_builtin_handle; fn = reg_fn; - } else if (!is_dynamic()) + } else if (!is_dynamic()) { goto fin; - else { + } else if (strcmp(source, NSSRC_CACHE) == 0 || + strcmp(source, NSSRC_COMPAT) == 0 || + strcmp(source, NSSRC_DB) == 0 || + strcmp(source, NSSRC_DNS) == 0 || + strcmp(source, NSSRC_FILES) == 0 || + strcmp(source, NSSRC_NIS) == 0) { + /* + * Avoid calling dlopen(3) for built-in modules. + */ + goto fin; + } else { if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name, NSS_MODULE_INTERFACE_VERSION) >= (int)sizeof(buf)) goto fin; From owner-svn-src-head@freebsd.org Mon Oct 15 18:12:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AFFD10C3C54; Mon, 15 Oct 2018 18:12:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 116127E9AA; Mon, 15 Oct 2018 18:12:26 +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 0BE6710C85; Mon, 15 Oct 2018 18:12:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FICP5J008494; Mon, 15 Oct 2018 18:12:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FICP0s008493; Mon, 15 Oct 2018 18:12:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810151812.w9FICP0s008493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Oct 2018 18:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339364 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 339364 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.27 Precedence: list List-Id: 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, 15 Oct 2018 18:12:26 -0000 Author: jhb Date: Mon Oct 15 18:12:25 2018 New Revision: 339364 URL: https://svnweb.freebsd.org/changeset/base/339364 Log: Reload the LDT selector after an AMD-v #VMEXIT. cpu_switch() always reloads the LDT, so this can only affect the hypervisor process itself. Fix this by explicitly reloading the host LDT selector after each #VMEXIT. The stock bhyve process on FreeBSD never uses a custom LDT, so this change is cosmetic. Reviewed by: kib Tested by: Mike Tancsa Approved by: re (gjb) MFC after: 2 weeks Modified: head/sys/amd64/vmm/amd/svm.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon Oct 15 17:50:02 2018 (r339363) +++ head/sys/amd64/vmm/amd/svm.c Mon Oct 15 18:12:25 2018 (r339364) @@ -1940,6 +1940,7 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t struct vm *vm; uint64_t vmcb_pa; int handled; + uint16_t ldt_sel; svm_sc = arg; vm = svm_sc->vm; @@ -2024,6 +2025,15 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t break; } + /* + * #VMEXIT resumes the host with the guest LDTR, so + * save the current LDT selector so it can be restored + * after an exit. The userspace hypervisor probably + * doesn't use a LDT, but save and restore it to be + * safe. + */ + ldt_sel = sldt(); + svm_inj_interrupts(svm_sc, vcpu, vlapic); /* Activate the nested pmap on 'curcpu' */ @@ -2053,6 +2063,9 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t * to be restored explicitly. */ restore_host_tss(); + + /* Restore host LDTR. */ + lldt(ldt_sel); /* #VMEXIT disables interrupts so re-enable them here. */ enable_gintr(); From owner-svn-src-head@freebsd.org Mon Oct 15 18:28:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2FB410C4228; Mon, 15 Oct 2018 18:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6F517F672; Mon, 15 Oct 2018 18:28: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 9CB7D10E38; Mon, 15 Oct 2018 18:28: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 w9FISYbs014160; Mon, 15 Oct 2018 18:28:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FISYPr014159; Mon, 15 Oct 2018 18:28:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810151828.w9FISYPr014159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Oct 2018 18:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339365 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 339365 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.27 Precedence: list List-Id: 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, 15 Oct 2018 18:28:35 -0000 Author: markj Date: Mon Oct 15 18:28:34 2018 New Revision: 339365 URL: https://svnweb.freebsd.org/changeset/base/339365 Log: Typo. Submitted by: Fred Schlechter Approved by: re (gjb) MFC after: 3 days Modified: head/share/man/man4/dtrace_ip.4 Modified: head/share/man/man4/dtrace_ip.4 ============================================================================== --- head/share/man/man4/dtrace_ip.4 Mon Oct 15 18:12:25 2018 (r339364) +++ head/share/man/man4/dtrace_ip.4 Mon Oct 15 18:28:34 2018 (r339365) @@ -235,7 +235,7 @@ This script will print some details of each IP packet by the kernel: .Bd -literal -offset indent #pragma D option quiet -#pramga D option switchrate=10Hz +#pragma D option switchrate=10Hz dtrace:::BEGIN { From owner-svn-src-head@freebsd.org Mon Oct 15 18:39:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAEFD10C452A; Mon, 15 Oct 2018 18:39:34 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2EC7FC6D; Mon, 15 Oct 2018 18:39:34 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 659F410FC9; Mon, 15 Oct 2018 18:39:34 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FIdYbf019137; Mon, 15 Oct 2018 18:39:34 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FIdXtF019134; Mon, 15 Oct 2018 18:39:33 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201810151839.w9FIdXtF019134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 15 Oct 2018 18:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339366 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 339366 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.27 Precedence: list List-Id: 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, 15 Oct 2018 18:39:35 -0000 Author: davidcs Date: Mon Oct 15 18:39:33 2018 New Revision: 339366 URL: https://svnweb.freebsd.org/changeset/base/339366 Log: Add support for Error Recovery Submitted by:Vaishali.Kulkarni@cavium.com Approved by:re(kib) MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Oct 15 18:28:34 2018 (r339365) +++ head/sys/dev/bxe/bxe.c Mon Oct 15 18:39:33 2018 (r339366) @@ -202,6 +202,7 @@ static int bxe_attach(device_t); static int bxe_detach(device_t); static int bxe_shutdown(device_t); + /* * FreeBSD KLD module/device interface event handler method. */ @@ -705,6 +706,9 @@ static void bxe_interrupt_detach(struct bxe_softc * static void bxe_set_rx_mode(struct bxe_softc *sc); static int bxe_init_locked(struct bxe_softc *sc); static int bxe_stop_locked(struct bxe_softc *sc); +static void bxe_sp_err_timeout_task(void *arg, int pending); +void bxe_parity_recover(struct bxe_softc *sc); +void bxe_handle_error(struct bxe_softc *sc); static __noinline int bxe_nic_load(struct bxe_softc *sc, int load_mode); static __noinline int bxe_nic_unload(struct bxe_softc *sc, @@ -3486,16 +3490,12 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } BXE_FP_TX_UNLOCK(fp); + BXE_SET_ERROR_BIT(sc, BXE_ERR_TXQ_STUCK); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); - return (-1); } @@ -4250,6 +4250,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = &sc->fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4265,20 +4266,22 @@ bxe_nic_unload(struct bxe_softc *sc, if (IS_PF(sc) && sc->recovery_state != BXE_RECOVERY_DONE && (sc->state == BXE_STATE_CLOSED || sc->state == BXE_STATE_ERROR)) { - /* - * We can get here if the driver has been unloaded - * during parity error recovery and is either waiting for a - * leader to complete or for other functions to unload and - * then ifconfig down has been issued. In this case we want to - * unload and let other functions to complete a recovery - * process. - */ - sc->recovery_state = BXE_RECOVERY_DONE; - sc->is_leader = 0; - bxe_release_leader_lock(sc); - mb(); - BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + if(CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) { + /* + * We can get here if the driver has been unloaded + * during parity error recovery and is either waiting for a + * leader to complete or for other functions to unload and + * then ifconfig down has been issued. In this case we want to + * unload and let other functions to complete a recovery + * process. + */ + sc->recovery_state = BXE_RECOVERY_DONE; + sc->is_leader = 0; + bxe_release_leader_lock(sc); + mb(); + BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + } BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); @@ -7570,6 +7573,10 @@ bxe_parity_attn(struct bxe_softc *sc, if (print) BLOGI(sc, "\n"); + if( *global == TRUE ) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + } + return (TRUE); } @@ -7584,6 +7591,9 @@ bxe_chk_parity_attn(struct bxe_softc *sc, struct attn_route attn = { {0} }; int port = SC_PORT(sc); + if(sc->state != BXE_STATE_OPEN) + return FALSE; + attn.sig[0] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); attn.sig[1] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_2_FUNC_0 + port*4); attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); @@ -7610,10 +7620,12 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, uint32_t attn) { uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_PGLUE_HW_INTERRUPT) { val = REG_RD(sc, PGLUE_B_REG_PGLUE_B_INT_STS_CLR); BLOGE(sc, "PGLUE hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n"); if (val & PGLUE_B_PGLUE_B_INT_STS_REG_INCORRECT_RCV_BEHAVIOR) @@ -7637,6 +7649,7 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, if (attn & AEU_INPUTS_ATTN_BITS_ATC_HW_INTERRUPT) { val = REG_RD(sc, ATC_REG_ATC_INT_STS_CLR); BLOGE(sc, "ATC hw attention 0x%08x\n", val); + err_flg = TRUE; if (val & ATC_ATC_INT_STS_REG_ADDRESS_ERROR) BLOGE(sc, "ATC_ATC_INT_STS_REG_ADDRESS_ERROR\n"); if (val & ATC_ATC_INT_STS_REG_ATC_TCPL_TO_NOT_PEND) @@ -7656,7 +7669,14 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, BLOGE(sc, "FATAL parity attention set4 0x%08x\n", (uint32_t)(attn & (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR))); + err_flg = TRUE; } + if (err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8011,14 +8031,21 @@ bxe_attn_int_deasserted3(struct bxe_softc *sc, REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_9, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_8, 0); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_7, 0); - bxe_panic(sc, ("MC assert!\n")); - + bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MC_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } else if (attn & BXE_MCP_ASSERT) { BLOGE(sc, "MCP assert!\n"); REG_WR(sc, MISC_REG_AEU_GENERAL_ATTN_11, 0); - // XXX bxe_fw_dump(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_MCP_ASSERT); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_int_disable(sc); /*avoid repetive assert alert */ + } else { BLOGE(sc, "Unknown HW assert! (attn 0x%08x)\n", attn); } @@ -8046,6 +8073,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, int reg_offset; uint32_t val0, mask0, val1, mask1; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_CFC_HW_INTERRUPT) { val = REG_RD(sc, CFC_REG_CFC_INT_STS_CLR); @@ -8053,6 +8081,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* CFC error attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from CFC\n"); + err_flg = TRUE; } } @@ -8062,11 +8091,13 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, /* RQ_USDMDP_FIFO_OVERFLOW */ if (val & 0x18000) { BLOGE(sc, "FATAL error from PXP\n"); + err_flg = TRUE; } if (!CHIP_IS_E1x(sc)) { val = REG_RD(sc, PXP_REG_PXP_INT_STS_CLR_1); BLOGE(sc, "PXP hw attention-1 0x%08x\n", val); + err_flg = TRUE; } } @@ -8103,6 +8134,7 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, */ if (val0 & PXP2_EOP_ERROR_BIT) { BLOGE(sc, "PXP2_WR_PGLUE_EOP_ERROR\n"); + err_flg = TRUE; /* * if only PXP2_PXP2_INT_STS_0_REG_WR_PGLUE_EOP_ERROR is @@ -8125,8 +8157,15 @@ bxe_attn_int_deasserted2(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set2 0x%x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_2)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set2\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8136,6 +8175,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, int port = SC_PORT(sc); int reg_offset; uint32_t val; + boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_DOORBELLQ_HW_INTERRUPT) { val = REG_RD(sc, DORQ_REG_DORQ_INT_STS_CLR); @@ -8143,6 +8183,7 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, /* DORQ discard attention */ if (val & 0x2) { BLOGE(sc, "FATAL error from DORQ\n"); + err_flg = TRUE; } } @@ -8156,8 +8197,15 @@ bxe_attn_int_deasserted1(struct bxe_softc *sc, BLOGE(sc, "FATAL HW block attention set1 0x%08x\n", (uint32_t)(attn & HW_INTERRUT_ASSERT_SET_1)); + err_flg = TRUE; bxe_panic(sc, ("HW block attention set1\n")); } + if(err_flg) { + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + } + } static void @@ -8194,6 +8242,11 @@ bxe_attn_int_deasserted0(struct bxe_softc *sc, val &= ~(attn & HW_INTERRUT_ASSERT_SET_0); REG_WR(sc, reg_offset, val); + + BXE_SET_ERROR_BIT(sc, BXE_ERR_MISC); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + bxe_panic(sc, ("FATAL HW block attention set0 0x%lx\n", (attn & HW_INTERRUT_ASSERT_SET_0))); } @@ -8223,10 +8276,12 @@ bxe_attn_int_deasserted(struct bxe_softc *sc, * In case of parity errors don't handle attentions so that * other function would "see" parity errors. */ - sc->recovery_state = BXE_RECOVERY_INIT; // XXX schedule a recovery task... /* disable HW interrupts */ bxe_int_disable(sc); + BXE_SET_ERROR_BIT(sc, BXE_ERR_PARITY); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); bxe_release_alr(sc); return; } @@ -12356,6 +12411,259 @@ bxe_periodic_stop(struct bxe_softc *sc) callout_drain(&sc->periodic_callout); } +void +bxe_parity_recover(struct bxe_softc *sc) +{ + uint8_t global = FALSE; + uint32_t error_recovered, error_unrecovered; + bool is_parity; + + + if ((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running! " + "Please reboot/power cycle the system.\n"); + return; + } + + while (1) { + BLOGD(sc, DBG_SP, + "%s sc=%p state=0x%x rec_state=0x%x error_status=%x\n", + __func__, sc, sc->state, sc->recovery_state, sc->error_status); + + switch(sc->recovery_state) { + + case BXE_RECOVERY_INIT: + is_parity = bxe_chk_parity_attn(sc, &global, FALSE); + + if ((CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) || + (sc->error_status & BXE_ERR_MCP_ASSERT) || + (sc->error_status & BXE_ERR_GLOBAL)) { + + BXE_CORE_LOCK(sc); + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + bxe_nic_unload(sc, UNLOAD_RECOVERY, false); + sc->state = BXE_STATE_ERROR; + sc->recovery_state = BXE_RECOVERY_FAILED; + BLOGE(sc, " No Recovery tried for error 0x%x" + " stack notified driver is NOT running!" + " Please reboot/power cycle the system.\n", + sc->error_status); + BXE_CORE_UNLOCK(sc); + return; + } + + + /* Try to get a LEADER_LOCK HW lock */ + if (bxe_trylock_leader_lock(sc)) { + + bxe_set_reset_in_progress(sc); + /* + * Check if there is a global attention and if + * there was a global attention, set the global + * reset bit. + */ + if (global) { + bxe_set_reset_global(sc); + } + sc->is_leader = 1; + } + + /* If interface has been removed - break */ + + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { + bxe_periodic_stop(sc); + } + + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc,UNLOAD_RECOVERY, false); + sc->recovery_state = BXE_RECOVERY_WAIT; + BXE_CORE_UNLOCK(sc); + + /* + * Ensure "is_leader", MCP command sequence and + * "recovery_state" update values are seen on other + * CPUs. + */ + mb(); + break; + case BXE_RECOVERY_WAIT: + + if (sc->is_leader) { + int other_engine = SC_PATH(sc) ? 0 : 1; + bool other_load_status = + bxe_get_load_status(sc, other_engine); + bool load_status = + bxe_get_load_status(sc, SC_PATH(sc)); + global = bxe_reset_is_global(sc); + + /* + * In case of a parity in a global block, let + * the first leader that performs a + * leader_reset() reset the global blocks in + * order to clear global attentions. Otherwise + * the gates will remain closed for that + * engine. + */ + if (load_status || + (global && other_load_status)) { + /* + * Wait until all other functions get + * down. + */ + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } else { + /* + * If all other functions got down + * try to bring the chip back to + * normal. In any case it's an exit + * point for a leader. + */ + if (bxe_leader_reset(sc)) { + BLOGE(sc, "RECOVERY failed, " + "stack notified driver is NOT running!\n"); + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + mb(); + return; + } + + /* + * If we are here, means that the + * leader has succeeded and doesn't + * want to be a leader any more. Try + * to continue as a none-leader. + */ + break; + } + + } else { /* non-leader */ + if (!bxe_reset_is_done(sc, SC_PATH(sc))) { + /* + * Try to get a LEADER_LOCK HW lock as + * long as a former leader may have + * been unloaded by the user or + * released a leadership by another + * reason. + */ + if (bxe_trylock_leader_lock(sc)) { + /* + * I'm a leader now! Restart a + * switch case. + */ + sc->is_leader = 1; + break; + } + + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + + } else { + /* + * If there was a global attention, wait + * for it to be cleared. + */ + if (bxe_reset_is_global(sc)) { + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); + return; + } + + error_recovered = + sc->eth_stats.recoverable_error; + error_unrecovered = + sc->eth_stats.unrecoverable_error; + BXE_CORE_LOCK(sc); + sc->recovery_state = + BXE_RECOVERY_NIC_LOADING; + if (bxe_nic_load(sc, LOAD_NORMAL)) { + error_unrecovered++; + sc->recovery_state = BXE_RECOVERY_FAILED; + sc->state = BXE_STATE_ERROR; + BLOGE(sc, "Recovery is NOT successfull, " + " state=0x%x recovery_state=0x%x error=%x\n", + sc->state, sc->recovery_state, sc->error_status); + sc->error_status = 0; + } else { + sc->recovery_state = + BXE_RECOVERY_DONE; + error_recovered++; + BLOGI(sc, "Recovery is successfull from errors %x," + " state=0x%x" + " recovery_state=0x%x \n", sc->error_status, + sc->state, sc->recovery_state); + mb(); + } + sc->error_status = 0; + BXE_CORE_UNLOCK(sc); + sc->eth_stats.recoverable_error = + error_recovered; + sc->eth_stats.unrecoverable_error = + error_unrecovered; + + return; + } + } + default: + return; + } + } +} +void +bxe_handle_error(struct bxe_softc * sc) +{ + + if(sc->recovery_state == BXE_RECOVERY_WAIT) { + return; + } + if(sc->error_status) { + if (sc->state == BXE_STATE_OPEN) { + bxe_int_disable(sc); + } + if (sc->link_vars.link_up) { + if_link_state_change(sc->ifp, LINK_STATE_DOWN); + } + sc->recovery_state = BXE_RECOVERY_INIT; + BLOGI(sc, "bxe%d: Recovery started errors 0x%x recovery state 0x%x\n", + sc->unit, sc->error_status, sc->recovery_state); + bxe_parity_recover(sc); + } +} + +static void +bxe_sp_err_timeout_task(void *arg, int pending) +{ + + struct bxe_softc *sc = (struct bxe_softc *)arg; + + BLOGD(sc, DBG_SP, + "%s state = 0x%x rec state=0x%x error_status=%x\n", + __func__, sc->state, sc->recovery_state, sc->error_status); + + if((sc->recovery_state == BXE_RECOVERY_FAILED) && + (sc->state == BXE_STATE_ERROR)) { + return; + } + /* if can be taken */ + if ((sc->error_status) && (sc->trigger_grcdump)) { + bxe_grc_dump(sc); + } + if (sc->recovery_state != BXE_RECOVERY_DONE) { + bxe_handle_error(sc); + bxe_parity_recover(sc); + } else if (sc->error_status) { + bxe_handle_error(sc); + } + + return; +} + /* start the controller */ static __noinline int bxe_nic_load(struct bxe_softc *sc, @@ -12637,6 +12945,15 @@ bxe_init_locked(struct bxe_softc *sc) return (0); } + if((sc->state == BXE_STATE_ERROR) && + (sc->recovery_state == BXE_RECOVERY_FAILED)) { + BLOGE(sc, "Initialization not done, " + "as previous recovery failed." + "Reboot/Power-cycle the system\n" ); + return (ENXIO); + } + + bxe_set_power_state(sc, PCI_PM_D0); /* @@ -16037,6 +16354,10 @@ bxe_attach(device_t dev) taskqueue_start_threads(&sc->chip_tq, 1, PWAIT, /* lower priority */ "%s", sc->chip_tq_name); + TIMEOUT_TASK_INIT(taskqueue_thread, + &sc->sp_err_timeout_task, 0, bxe_sp_err_timeout_task, sc); + + /* get device info and set params */ if (bxe_get_device_info(sc) != 0) { BLOGE(sc, "getting device info\n"); @@ -16212,6 +16533,8 @@ bxe_detach(device_t dev) taskqueue_drain(sc->chip_tq, &sc->chip_tq_task); taskqueue_free(sc->chip_tq); sc->chip_tq = NULL; + taskqueue_drain_timeout(taskqueue_thread, + &sc->sp_err_timeout_task); } /* stop and reset the controller if it was open */ Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Mon Oct 15 18:28:34 2018 (r339365) +++ head/sys/dev/bxe/bxe.h Mon Oct 15 18:39:33 2018 (r339366) @@ -478,6 +478,10 @@ struct bxe_device_type #define BXE_FW_RX_ALIGN_END (1 << BXE_RX_ALIGN_SHIFT) #define BXE_PXP_DRAM_ALIGN (BXE_RX_ALIGN_SHIFT - 5) /* XXX ??? */ +#define BXE_SET_ERROR_BIT(sc, error) \ +{ \ + (sc)->error_status |= (error); \ +} struct bxe_bar { struct resource *resource; @@ -1391,6 +1395,8 @@ struct bxe_softc { struct taskqueue *chip_tq; char chip_tq_name[32]; + struct timeout_task sp_err_timeout_task; + /* slowpath interrupt taskqueue */ struct task sp_tq_task; struct taskqueue *sp_tq; @@ -1544,6 +1550,16 @@ struct bxe_softc { #define BXE_RECOVERY_WAIT 3 #define BXE_RECOVERY_FAILED 4 #define BXE_RECOVERY_NIC_LOADING 5 + +#define BXE_ERR_TXQ_STUCK 0x1 /* Tx queue stuck detected by driver. */ +#define BXE_ERR_MISC 0x2 /* MISC ERR */ +#define BXE_ERR_PARITY 0x4 /* Parity error detected. */ +#define BXE_ERR_STATS_TO 0x8 /* Statistics timeout detected. */ +#define BXE_ERR_MC_ASSERT 0x10 /* MC assert attention received. */ +#define BXE_ERR_PANIC 0x20 /* Driver asserted. */ +#define BXE_ERR_MCP_ASSERT 0x40 /* MCP assert attention received. No Recovery*/ +#define BXE_ERR_GLOBAL 0x80 /* PCIe/PXP/IGU/MISC/NIG device blocks error- needs PCIe/Fundamental reset */ + uint32_t error_status; uint32_t rx_mode; #define BXE_RX_MODE_NONE 0 Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Mon Oct 15 18:28:34 2018 (r339365) +++ head/sys/dev/bxe/bxe_stats.c Mon Oct 15 18:39:33 2018 (r339366) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #define BITS_PER_LONG 64 #endif -extern int bxe_grc_dump(struct bxe_softc *sc); static inline long bxe_hilo(uint32_t *hiref) @@ -238,11 +237,11 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); break; + } cnt--; @@ -925,6 +924,7 @@ bxe_hw_stats_update(struct bxe_softc *sc) nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); if (nig_timer_max != estats->nig_timer_max) { estats->nig_timer_max = nig_timer_max; + /*NOTE: not setting error bit */ BLOGE(sc, "invalid NIG timer max (%u)\n", estats->nig_timer_max); } @@ -1318,12 +1318,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { - if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); - } - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + BLOGE(sc, "Storm stats not updated for 3 times, resetting\n"); + BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); + taskqueue_enqueue_timeout(taskqueue_thread, + &sc->sp_err_timeout_task, hz/10); } } return; From owner-svn-src-head@freebsd.org Mon Oct 15 18:56:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C852910C4D27; Mon, 15 Oct 2018 18:56:56 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CBFB806A3; Mon, 15 Oct 2018 18:56:56 +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 76DF211318; Mon, 15 Oct 2018 18:56:56 +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 w9FIuuG9029391; Mon, 15 Oct 2018 18:56:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FIusEQ029384; Mon, 15 Oct 2018 18:56:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810151856.w9FIusEQ029384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Oct 2018 18:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339367 - in head/sys: cddl/dev/fbt/riscv riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: cddl/dev/fbt/riscv riscv/include riscv/riscv X-SVN-Commit-Revision: 339367 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.27 Precedence: list List-Id: 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, 15 Oct 2018 18:56:57 -0000 Author: jhb Date: Mon Oct 15 18:56:54 2018 New Revision: 339367 URL: https://svnweb.freebsd.org/changeset/base/339367 Log: Various fixes for TLB management on RISC-V. - Remove the arm64-specific cpu_*cache* and cpu_tlb_flush* functions. Instead, add RISC-V specific inline functions in cpufunc.h for the fence.i and sfence.vma instructions. - Catch up to changes in the arm64 pmap and remove all the cpu_dcache_* calls, pmap_is_current, pmap_l3_valid_cacheable, and PTE_NEXT bits from pmap. - Remove references to the unimplemented riscv_setttb(). - Remove unused cpu_nullop. - Add a link to the SBI doc to sbi.h. - Add support for a 4th argument in SBI calls. It's not documented but it seems implied for the asid argument to SBI_REMOVE_SFENCE_VMA_ASID. - Pass the arguments from sbi_remote_sfence*() to the SEE. BBL ignores them so this is just cosmetic. - Flush icaches on other CPUs when they resume from kdb in case the debugger wrote any breakpoints while the CPUs were paused in the IPI_STOP handler. - Add SMP vs UP versions of pmap_invalidate_* similar to amd64. The UP versions just use simple fences. The SMP versions use the sbi_remove_sfence*() functions to perform TLB shootdowns. Since we don't have a valid pm_active field in the riscv pmap, just IPI all CPUs for all invalidations for now. - Remove an extraneous TLB flush from the end of pmap_bootstrap(). - Don't do a TLB flush when writing new mappings in pmap_enter(), only if modifying an existing mapping. Note that for COW faults a TLB flush is only performed after explicitly clearing the old mapping as is done in other pmaps. - Sync the i-cache on all harts before updating the PTE for executable mappings in pmap_enter and pmap_enter_quick. Previously the i-cache was only sync'd after updating the PTE in pmap_enter. - Use sbi_remote_fence() instead of smp_rendezvous in pmap_sync_icache(). Reviewed by: markj Approved by: re (gjb, kib) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17414 Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c head/sys/riscv/include/cpufunc.h head/sys/riscv/include/kdb.h head/sys/riscv/include/sbi.h head/sys/riscv/riscv/cpufunc_asm.S head/sys/riscv/riscv/db_interface.c head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/pmap.c Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/riscv/fbt_isa.c Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/cddl/dev/fbt/riscv/fbt_isa.c Mon Oct 15 18:56:54 2018 (r339367) @@ -78,11 +78,11 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t switch(fbt->fbtp_patchval) { case FBT_C_PATCHVAL: *(uint16_t *)fbt->fbtp_patchpoint = (uint16_t)val; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 2); + fence_i(); break; case FBT_PATCHVAL: *fbt->fbtp_patchpoint = val; - cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4); + fence_i(); break; }; } Modified: head/sys/riscv/include/cpufunc.h ============================================================================== --- head/sys/riscv/include/cpufunc.h Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/include/cpufunc.h Mon Oct 15 18:56:54 2018 (r339367) @@ -81,29 +81,32 @@ intr_enable(void) ); } -#define cpu_nullop() riscv_nullop() -#define cpufunc_nullop() riscv_nullop() -#define cpu_setttb(a) riscv_setttb(a) +/* NB: fence() is defined as a macro in . */ -#define cpu_tlb_flushID() riscv_tlb_flushID() -#define cpu_tlb_flushID_SE(e) riscv_tlb_flushID_SE(e) +static __inline void +fence_i(void) +{ -#define cpu_dcache_wbinv_range(a, s) riscv_dcache_wbinv_range((a), (s)) -#define cpu_dcache_inv_range(a, s) riscv_dcache_inv_range((a), (s)) -#define cpu_dcache_wb_range(a, s) riscv_dcache_wb_range((a), (s)) + __asm __volatile("fence.i" ::: "memory"); +} -#define cpu_idcache_wbinv_range(a, s) riscv_idcache_wbinv_range((a), (s)) -#define cpu_icache_sync_range(a, s) riscv_icache_sync_range((a), (s)) +static __inline void +sfence_vma(void) +{ + __asm __volatile("sfence.vma" ::: "memory"); +} + +static __inline void +sfence_vma_page(uintptr_t addr) +{ + + __asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); +} + +#define cpufunc_nullop() riscv_nullop() + void riscv_nullop(void); -void riscv_setttb(vm_offset_t); -void riscv_tlb_flushID(void); -void riscv_tlb_flushID_SE(vm_offset_t); -void riscv_icache_sync_range(vm_offset_t, vm_size_t); -void riscv_idcache_wbinv_range(vm_offset_t, vm_size_t); -void riscv_dcache_wbinv_range(vm_offset_t, vm_size_t); -void riscv_dcache_inv_range(vm_offset_t, vm_size_t); -void riscv_dcache_wb_range(vm_offset_t, vm_size_t); #endif /* _KERNEL */ #endif /* _MACHINE_CPUFUNC_H_ */ Modified: head/sys/riscv/include/kdb.h ============================================================================== --- head/sys/riscv/include/kdb.h Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/include/kdb.h Mon Oct 15 18:56:54 2018 (r339367) @@ -47,7 +47,11 @@ static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) { - cpu_icache_sync_range((vm_offset_t)addr, size); + /* + * Other CPUs flush their instruction cache when resuming from + * IPI_STOP. + */ + fence_i(); } static __inline void Modified: head/sys/riscv/include/sbi.h ============================================================================== --- head/sys/riscv/include/sbi.h Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/include/sbi.h Mon Oct 15 18:56:54 2018 (r339367) @@ -47,18 +47,25 @@ #define SBI_REMOTE_SFENCE_VMA_ASID 7 #define SBI_SHUTDOWN 8 +/* + * Documentation available at + * https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.md + */ + static __inline uint64_t -sbi_call(uint64_t arg7, uint64_t arg0, uint64_t arg1, uint64_t arg2) +sbi_call(uint64_t arg7, uint64_t arg0, uint64_t arg1, uint64_t arg2, + uint64_t arg3) { - register uintptr_t a0 __asm ("a0") = (uintptr_t)(arg0); register uintptr_t a1 __asm ("a1") = (uintptr_t)(arg1); register uintptr_t a2 __asm ("a2") = (uintptr_t)(arg2); + register uintptr_t a3 __asm ("a3") = (uintptr_t)(arg3); register uintptr_t a7 __asm ("a7") = (uintptr_t)(arg7); + __asm __volatile( \ "ecall" \ :"+r"(a0) \ - :"r"(a1), "r"(a2), "r"(a7) \ + :"r"(a1), "r"(a2), "r" (a3), "r"(a7) \ :"memory"); return (a0); @@ -68,49 +75,49 @@ static __inline void sbi_console_putchar(int ch) { - sbi_call(SBI_CONSOLE_PUTCHAR, ch, 0, 0); + sbi_call(SBI_CONSOLE_PUTCHAR, ch, 0, 0, 0); } static __inline int sbi_console_getchar(void) { - return (sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)); + return (sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0, 0)); } static __inline void sbi_set_timer(uint64_t val) { - sbi_call(SBI_SET_TIMER, val, 0, 0); + sbi_call(SBI_SET_TIMER, val, 0, 0, 0); } static __inline void sbi_shutdown(void) { - sbi_call(SBI_SHUTDOWN, 0, 0, 0); + sbi_call(SBI_SHUTDOWN, 0, 0, 0, 0); } static __inline void sbi_clear_ipi(void) { - sbi_call(SBI_CLEAR_IPI, 0, 0, 0); + sbi_call(SBI_CLEAR_IPI, 0, 0, 0, 0); } static __inline void sbi_send_ipi(const unsigned long *hart_mask) { - sbi_call(SBI_SEND_IPI, (uint64_t)hart_mask, 0, 0); + sbi_call(SBI_SEND_IPI, (uint64_t)hart_mask, 0, 0, 0); } static __inline void sbi_remote_fence_i(const unsigned long *hart_mask) { - sbi_call(SBI_REMOTE_FENCE_I, (uint64_t)hart_mask, 0, 0); + sbi_call(SBI_REMOTE_FENCE_I, (uint64_t)hart_mask, 0, 0, 0); } static __inline void @@ -118,7 +125,7 @@ sbi_remote_sfence_vma(const unsigned long *hart_mask, unsigned long start, unsigned long size) { - sbi_call(SBI_REMOTE_SFENCE_VMA, (uint64_t)hart_mask, 0, 0); + sbi_call(SBI_REMOTE_SFENCE_VMA, (uint64_t)hart_mask, start, size, 0); } static __inline void @@ -127,7 +134,8 @@ sbi_remote_sfence_vma_asid(const unsigned long *hart_m unsigned long asid) { - sbi_call(SBI_REMOTE_SFENCE_VMA_ASID, (uint64_t)hart_mask, 0, 0); + sbi_call(SBI_REMOTE_SFENCE_VMA_ASID, (uint64_t)hart_mask, start, size, + asid); } #endif /* !_MACHINE_SBI_H_ */ Modified: head/sys/riscv/riscv/cpufunc_asm.S ============================================================================== --- head/sys/riscv/riscv/cpufunc_asm.S Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/riscv/cpufunc_asm.S Mon Oct 15 18:56:54 2018 (r339367) @@ -33,70 +33,11 @@ */ #include -#include __FBSDID("$FreeBSD$"); .text .align 2 -.Lpage_mask: - .word PAGE_MASK - ENTRY(riscv_nullop) ret END(riscv_nullop) - -/* - * Generic functions to read/modify/write the internal coprocessor registers - */ - -ENTRY(riscv_tlb_flushID) - sfence.vma - ret -END(riscv_tlb_flushID) - -ENTRY(riscv_tlb_flushID_SE) - sfence.vma - ret -END(riscv_tlb_flushID_SE) - -/* - * void riscv_dcache_wb_range(vm_offset_t, vm_size_t) - */ -ENTRY(riscv_dcache_wb_range) - sfence.vma - ret -END(riscv_dcache_wb_range) - -/* - * void riscv_dcache_wbinv_range(vm_offset_t, vm_size_t) - */ -ENTRY(riscv_dcache_wbinv_range) - sfence.vma - ret -END(riscv_dcache_wbinv_range) - -/* - * void riscv_dcache_inv_range(vm_offset_t, vm_size_t) - */ -ENTRY(riscv_dcache_inv_range) - sfence.vma - ret -END(riscv_dcache_inv_range) - -/* - * void riscv_idcache_wbinv_range(vm_offset_t, vm_size_t) - */ -ENTRY(riscv_idcache_wbinv_range) - fence.i - sfence.vma - ret -END(riscv_idcache_wbinv_range) - -/* - * void riscv_icache_sync_range(vm_offset_t, vm_size_t) - */ -ENTRY(riscv_icache_sync_range) - fence.i - ret -END(riscv_icache_sync_range) Modified: head/sys/riscv/riscv/db_interface.c ============================================================================== --- head/sys/riscv/riscv/db_interface.c Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/riscv/db_interface.c Mon Oct 15 18:56:54 2018 (r339367) @@ -151,11 +151,8 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da while (size-- > 0) *dst++ = *data++; - fence(); - - /* Clean D-cache and invalidate I-cache */ - cpu_dcache_wb_range(addr, (vm_size_t)size); - cpu_icache_sync_range(addr, (vm_size_t)size); + /* Invalidate I-cache */ + fence_i(); } (void)kdb_jmpbuf(prev_jb); Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/riscv/mp_machdep.c Mon Oct 15 18:56:54 2018 (r339367) @@ -328,6 +328,12 @@ ipi_handler(void *arg) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); CTR0(KTR_SMP, "IPI_STOP (restart)"); + + /* + * The kernel debugger might have set a breakpoint, + * so flush the instruction cache. + */ + fence_i(); break; case IPI_HARDCLOCK: CTR1(KTR_SMP, "%s: IPI_HARDCLOCK", __func__); Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Oct 15 18:39:33 2018 (r339366) +++ head/sys/riscv/riscv/pmap.c Mon Oct 15 18:56:54 2018 (r339367) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define NPDEPG (PAGE_SIZE/(sizeof (pd_entry_t))) #define NUPDE (NPDEPG * NPDEPG) @@ -364,31 +365,12 @@ pmap_is_write(pt_entry_t entry) } static __inline int -pmap_is_current(pmap_t pmap) -{ - - return ((pmap == pmap_kernel()) || - (pmap == curthread->td_proc->p_vmspace->vm_map.pmap)); -} - -static __inline int pmap_l3_valid(pt_entry_t l3) { return (l3 & PTE_V); } -static __inline int -pmap_l3_valid_cacheable(pt_entry_t l3) -{ - - /* TODO */ - - return (0); -} - -#define PTE_SYNC(pte) cpu_dcache_wb_range((vm_offset_t)pte, sizeof(*pte)) - static inline int pmap_page_accessed(pt_entry_t pte) { @@ -514,14 +496,13 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi dmap_phys_max = pa; dmap_max_addr = va; - cpu_dcache_wb_range((vm_offset_t)l1, PAGE_SIZE); - cpu_tlb_flushID(); + sfence_vma(); } static vm_offset_t pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm_offset_t l3_start) { - vm_offset_t l2pt, l3pt; + vm_offset_t l3pt; pt_entry_t entry; pd_entry_t *l2; vm_paddr_t pa; @@ -532,7 +513,6 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm l2 = pmap_l2(kernel_pmap, va); l2 = (pd_entry_t *)((uintptr_t)l2 & ~(PAGE_SIZE - 1)); - l2pt = (vm_offset_t)l2; l2_slot = pmap_l2_index(va); l3pt = l3_start; @@ -550,10 +530,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm /* Clean the L2 page table */ memset((void *)l3_start, 0, l3pt - l3_start); - cpu_dcache_wb_range(l3_start, l3pt - l3_start); - cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); - return (l3pt); } @@ -676,7 +653,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, freemempos = pmap_bootstrap_l3(l1pt, VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); - cpu_tlb_flushID(); + sfence_vma(); #define alloc_pages(var, np) \ (var) = freemempos; \ @@ -732,8 +709,6 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, * called something like "Maxphyspage". */ Maxmem = atop(phys_avail[avail_slot - 1]); - - cpu_tlb_flushID(); } /* @@ -769,43 +744,99 @@ pmap_init(void) rw_init(&pv_list_locks[i], "pmap pv list"); } +#ifdef SMP /* - * Normal, non-SMP, invalidation functions. - * We inline these within pmap.c for speed. + * For SMP, these functions have to use IPIs for coherence. + * + * In general, the calling thread uses a plain fence to order the + * writes to the page tables before invoking an SBI callback to invoke + * sfence_vma() on remote CPUs. + * + * Since the riscv pmap does not yet have a pm_active field, IPIs are + * sent to all CPUs in the system. */ -PMAP_INLINE void +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { + cpuset_t mask; - /* TODO */ - sched_pin(); - __asm __volatile("sfence.vma %0" :: "r" (va) : "memory"); + mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &mask); + fence(); + sbi_remote_sfence_vma(mask.__bits, va, 1); + sfence_vma_page(va); sched_unpin(); } -PMAP_INLINE void +static void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { + cpuset_t mask; - /* TODO */ - sched_pin(); - __asm __volatile("sfence.vma"); + mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &mask); + fence(); + sbi_remote_sfence_vma(mask.__bits, sva, eva - sva + 1); + + /* + * Might consider a loop of sfence_vma_page() for a small + * number of pages in the future. + */ + sfence_vma(); sched_unpin(); } -PMAP_INLINE void +static void pmap_invalidate_all(pmap_t pmap) { + cpuset_t mask; - /* TODO */ - sched_pin(); - __asm __volatile("sfence.vma"); + mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &mask); + fence(); + + /* + * XXX: The SBI doc doesn't detail how to specify x0 as the + * address to perform a global fence. BBL currently treats + * all sfence_vma requests as global however. + */ + sbi_remote_sfence_vma(mask.__bits, 0, 0); sched_unpin(); } +#else +/* + * Normal, non-SMP, invalidation functions. + * We inline these within pmap.c for speed. + */ +static __inline void +pmap_invalidate_page(pmap_t pmap, vm_offset_t va) +{ + sfence_vma_page(va); +} + +static __inline void +pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ + + /* + * Might consider a loop of sfence_vma_page() for a small + * number of pages in the future. + */ + sfence_vma(); +} + +static __inline void +pmap_invalidate_all(pmap_t pmap) +{ + + sfence_vma(); +} +#endif + /* * Routine: pmap_extract * Function: @@ -937,8 +968,6 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); - PTE_SYNC(l3); - va += PAGE_SIZE; pa += PAGE_SIZE; size -= PAGE_SIZE; @@ -958,11 +987,9 @@ pmap_kremove(vm_offset_t va) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - if (pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(va, L3_SIZE); pmap_load_clear(l3); - PTE_SYNC(l3); - pmap_invalidate_page(kernel_pmap, va); + + sfence_vma(); } void @@ -981,11 +1008,11 @@ pmap_kremove_device(vm_offset_t sva, vm_size_t size) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); pmap_load_clear(l3); - PTE_SYNC(l3); va += PAGE_SIZE; size -= PAGE_SIZE; } + pmap_invalidate_range(kernel_pmap, sva, va); } @@ -1039,7 +1066,6 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); - PTE_SYNC(l3); va += L3_SIZE; } pmap_invalidate_range(kernel_pmap, sva, va); @@ -1063,10 +1089,7 @@ pmap_qremove(vm_offset_t sva, int count) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - if (pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(va, L3_SIZE); pmap_load_clear(l3); - PTE_SYNC(l3); va += PAGE_SIZE; } @@ -1127,13 +1150,11 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t l1 = pmap_l1(pmap, va); pmap_load_clear(l1); pmap_distribute_l1(pmap, pmap_l1_index(va), 0); - PTE_SYNC(l1); } else { /* PTE page */ pd_entry_t *l2; l2 = pmap_l2(pmap, va); pmap_load_clear(l2); - PTE_SYNC(l2); } pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { @@ -1279,9 +1300,6 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str entry |= (pn << PTE_PPN0_S); pmap_load_store(l1, entry); pmap_distribute_l1(pmap, l1index, entry); - - PTE_SYNC(l1); - } else { vm_pindex_t l1index; pd_entry_t *l1, *l2; @@ -1310,8 +1328,6 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str entry = (PTE_V); entry |= (pn << PTE_PPN0_S); pmap_load_store(l2, entry); - - PTE_SYNC(l2); } pmap_resident_count_inc(pmap, 1); @@ -1445,8 +1461,6 @@ pmap_growkernel(vm_offset_t addr) pmap_load_store(l1, entry); pmap_distribute_l1(kernel_pmap, pmap_l1_index(kernel_vm_end), entry); - - PTE_SYNC(l1); continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); @@ -1474,7 +1488,6 @@ pmap_growkernel(vm_offset_t addr) entry |= (pn << PTE_PPN0_S); pmap_load_store(l2, entry); - PTE_SYNC(l2); pmap_invalidate_page(kernel_pmap, kernel_vm_end); kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; @@ -1754,10 +1767,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ vm_page_t m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(va, L3_SIZE); old_l3 = pmap_load_clear(l3); - PTE_SYNC(l3); pmap_invalidate_page(pmap, va); if (old_l3 & PTE_SW_WIRED) pmap->pm_stats.wired_count -= 1; @@ -1913,11 +1923,7 @@ pmap_remove_all(vm_page_t m) "a block in %p's pv list", m)); l3 = pmap_l2_to_l3(l2, pv->pv_va); - if (pmap_is_current(pmap) && - pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(pv->pv_va, L3_SIZE); tl3 = pmap_load_clear(l3); - PTE_SYNC(l3); pmap_invalidate_page(pmap, pv->pv_va); if (tl3 & PTE_SW_WIRED) pmap->pm_stats.wired_count--; @@ -1947,7 +1953,7 @@ pmap_remove_all(vm_page_t m) void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - vm_offset_t va, va_next; + vm_offset_t va_next; pd_entry_t *l1, *l2; pt_entry_t *l3p, l3; pt_entry_t entry; @@ -1986,7 +1992,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if (va_next > eva) va_next = eva; - va = va_next; for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { l3 = pmap_load(l3p); @@ -1994,7 +1999,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t entry = pmap_load(l3p); entry &= ~(PTE_W); pmap_load_store(l3p, entry); - PTE_SYNC(l3p); /* XXX: Use pmap_invalidate_range */ pmap_invalidate_page(pmap, sva); } @@ -2092,8 +2096,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v entry |= (l2_pn << PTE_PPN0_S); pmap_load_store(l1, entry); pmap_distribute_l1(pmap, pmap_l1_index(va), entry); - PTE_SYNC(l1); - l2 = pmap_l1_to_l2(l1, va); } @@ -2112,7 +2114,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v entry = (PTE_V); entry |= (l3_pn << PTE_PPN0_S); pmap_load_store(l2, entry); - PTE_SYNC(l2); l3 = pmap_l2_to_l3(l2, va); } pmap_invalidate_page(pmap, va); @@ -2163,10 +2164,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v goto validate; } - /* Flush the cache, there might be uncommitted data in it */ - if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(orig_l3)) - cpu_dcache_wb_range(va, L3_SIZE); - /* * The physical page has changed. Temporarily invalidate * the mapping. This ensures that all threads sharing the @@ -2225,13 +2222,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v vm_page_aflag_set(m, PGA_WRITEABLE); } +validate: /* + * Sync the i-cache on all harts before updating the PTE + * if the new PTE is executable. + */ + if (prot & VM_PROT_EXECUTE) + pmap_sync_icache(pmap, va, PAGE_SIZE); + + /* * Update the L3 entry. */ if (orig_l3 != 0) { -validate: orig_l3 = pmap_load_store(l3, new_l3); - PTE_SYNC(l3); + pmap_invalidate_page(pmap, va); KASSERT(PTE_TO_PHYS(orig_l3) == pa, ("pmap_enter: invalid update")); if (pmap_page_dirty(orig_l3) && @@ -2239,11 +2243,7 @@ validate: vm_page_dirty(m); } else { pmap_load_store(l3, new_l3); - PTE_SYNC(l3); } - pmap_invalidate_page(pmap, va); - if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) - cpu_icache_sync_range(va, PAGE_SIZE); if (lock != NULL) rw_wunlock(lock); @@ -2423,9 +2423,16 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ if ((m->oflags & VPO_UNMANAGED) == 0) entry |= PTE_SW_MANAGED; + + /* + * Sync the i-cache on all harts before updating the PTE + * if the new PTE is executable. + */ + if (prot & VM_PROT_EXECUTE) + pmap_sync_icache(pmap, va, PAGE_SIZE); + pmap_load_store(l3, entry); - PTE_SYNC(l3); pmap_invalidate_page(pmap, va); return (mpte); } @@ -2766,11 +2773,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad l3 %#jx", (uintmax_t)tl3)); - if (pmap_is_current(pmap) && - pmap_l3_valid_cacheable(pmap_load(l3))) - cpu_dcache_wb_range(pv->pv_va, L3_SIZE); pmap_load_clear(l3); - PTE_SYNC(l3); pmap_invalidate_page(pmap, pv->pv_va); /* @@ -3244,16 +3247,10 @@ pmap_activate(struct thread *td) critical_exit(); } -static void -pmap_sync_icache_one(void *arg __unused) -{ - - __asm __volatile("fence.i"); -} - void pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { + cpuset_t mask; /* * From the RISC-V User-Level ISA V2.2: @@ -3263,8 +3260,12 @@ pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t * before requesting that all remote RISC-V harts execute a * FENCE.I." */ - __asm __volatile("fence"); - smp_rendezvous(NULL, pmap_sync_icache_one, NULL, NULL); + sched_pin(); + mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &mask); + fence(); + sbi_remote_fence_i(mask.__bits); + sched_unpin(); } /* From owner-svn-src-head@freebsd.org Mon Oct 15 19:19:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFA210C64E8; Mon, 15 Oct 2018 19:19:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 020B5815D8; Mon, 15 Oct 2018 19:19:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w9FJJOwI093783 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Oct 2018 12:19:24 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w9FJJOTm093782; Mon, 15 Oct 2018 12:19:24 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 15 Oct 2018 12:19:24 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339349 - in head/sys/amd64: amd64 include Message-ID: <20181015191924.GF1044@FreeBSD.org> References: <201810132118.w9DLIW3R017391@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810132118.w9DLIW3R017391@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 15 Oct 2018 19:19:26 -0000 Mateusz, On Sat, Oct 13, 2018 at 09:18:32PM +0000, Mateusz Guzik wrote: M> Return is almost always 0. The change replaces 3 branches with 1 in the common M> case. This isn't true. For a webserver working with blocking sockets returning EAGAIN for a very large number of syscalls is normal. I just dtraced on a random Netflix server and in our case we get 12% of syscalls with non zero error. But our clients are special, they request data in small chunks. I believe a regular web server that serves mostly open ended requests will have a greater ratio of non-zero returns, up to 50%. Here is script: #!/usr/sbin/dtrace -s fbt::cpu_set_syscall_retval:entry { @[args[1]] = count(); } I would be interested if anybody reports results on a busy web server running nginx. So, I doubt that using __predict_true() is an optimisation here. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Mon Oct 15 19:48:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F90A10C7215; Mon, 15 Oct 2018 19:48:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24A7E8249D; Mon, 15 Oct 2018 19:48:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A1C811B2F; Mon, 15 Oct 2018 19:48:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FJmanN054879; Mon, 15 Oct 2018 19:48:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FJmaER054878; Mon, 15 Oct 2018 19:48:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810151948.w9FJmaER054878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 15 Oct 2018 19:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339368 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 339368 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.27 Precedence: list List-Id: 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, 15 Oct 2018 19:48:37 -0000 Author: trasz Date: Mon Oct 15 19:48:36 2018 New Revision: 339368 URL: https://svnweb.freebsd.org/changeset/base/339368 Log: Prevent flex(1) from generating calls to isatty(3) - and, in turn, TIOCGETA ioctls - when parsing nsswitch.conf(5). Reviewed by: imp, markj Approved by: re (gjb) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17564 Modified: head/lib/libc/net/nslexer.l Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Mon Oct 15 18:56:54 2018 (r339367) +++ head/lib/libc/net/nslexer.l Mon Oct 15 19:48:36 2018 (r339368) @@ -50,6 +50,7 @@ static char *rcsid = %} +%option never-interactive %option noinput %option nounput %option yylineno From owner-svn-src-head@freebsd.org Mon Oct 15 19:52:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 357DF10C75FA; Mon, 15 Oct 2018 19:52:16 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8C1F828D1; Mon, 15 Oct 2018 19:52:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x833.google.com with SMTP id e22-v6so22953635qto.6; Mon, 15 Oct 2018 12:52:15 -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=Z8XHKU8FtxPiDtnUIKDRQwFisS324bTp06c7mVMkuD4=; b=LE9+O4oErRgZUyS/+kK3sq35NGAK5b7v+RRemLu2rAWVPFiDVXl7VBfzDi2SmwBhNo T5WZ9U7F3s98drxHcumynq7juQMib0LrJqln3DgSORR/vNB91+Ex+k0lBpJeybtRzfZ7 OsAgNaMtmwhdD2x8N1rp75J2F2p809Vy3p9nedHOpuwUedhXmtRullh+vLc72GwAXPF5 skilANJRDIBlOsw79EgEqu9LmtFpJTHzyxK2jkV9lUjchLlXr5b+GxDGhr3q9B0mQDoJ ZorHXJkfOx5P5UfVtffCTldfEfHXBSKpiaZhqfD3IDEq+39YD7hKRZPTAiAcqQDv5CK1 1nMw== 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=Z8XHKU8FtxPiDtnUIKDRQwFisS324bTp06c7mVMkuD4=; b=O+DcO/X5H6by8Y1e4wmXdYM139FTxcyK851uFPAs3MxI77c2T8A4hKi/IO53S2v79n GC07hT98GEfdGak8j4IJM1A90uTQUKPyAxKom4xVa7XcRF2ObHJ7UcIcJSyzFHSPQHZ4 Ea+qFziNwDkSGRCCpT5eI8kFpCoOXN5dSHnPFRMALFds+wYemihdeNgXhP6+7wtDIVBs n5dz63hiAGADPMGhi79aMWoV8EoT7dUMweH09z3cCsoRSIjHJbDoEEDpaJv+Wtb9IrhF gAszKL3+7iIV+wvq6nnVccqghIBFQf18ke0VZv/A8vQxZP9RbCVytpCndeD3PLWCYCvt JcAw== X-Gm-Message-State: ABuFfoiyHcQzIJuTm0aEi6LzyuEL9EI9uD5DGm7IqvqaanHnAXrI6tJ0 oUbf/7/Rifwz9oTqUV90WfobUaLUFJ/R3ff+GJ7ZSg== X-Google-Smtp-Source: ACcGV60f+WY/dmUi9AL/8WfOo9+FxonXJHWWvsnZbGI7T150oS1r6EaVGktp+orTl3/2TbrImFvWX1PN/+F20jgR5fM= X-Received: by 2002:a0c:8545:: with SMTP id n63-v6mr18188749qva.205.1539633134992; Mon, 15 Oct 2018 12:52:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac8:362e:0:0:0:0:0 with HTTP; Mon, 15 Oct 2018 12:52:14 -0700 (PDT) In-Reply-To: <20181015191924.GF1044@FreeBSD.org> References: <201810132118.w9DLIW3R017391@repo.freebsd.org> <20181015191924.GF1044@FreeBSD.org> From: Mateusz Guzik Date: Mon, 15 Oct 2018 21:52:14 +0200 Message-ID: Subject: Re: svn commit: r339349 - in head/sys/amd64: amd64 include To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 15 Oct 2018 19:52:16 -0000 On 10/15/18, Gleb Smirnoff wrote: > Mateusz, > > On Sat, Oct 13, 2018 at 09:18:32PM +0000, Mateusz Guzik wrote: > M> Return is almost always 0. The change replaces 3 branches with 1 in the > common > M> case. > > This isn't true. For a webserver working with blocking sockets > returning EAGAIN for a very large number of syscalls is normal. > > I just dtraced on a random Netflix server and in our case we > get 12% of syscalls with non zero error. But our clients are > special, they request data in small chunks. I believe a regular > web server that serves mostly open ended requests will have a > greater ratio of non-zero returns, up to 50%. > > Here is script: > > #!/usr/sbin/dtrace -s > > fbt::cpu_set_syscall_retval:entry > { > @[args[1]] = count(); > } > > I would be interested if anybody reports results on a busy > web server running nginx. > > So, I doubt that using __predict_true() is an optimisation here. This should be a win even for your somewhat degenerate case. Code handling all cases is disjoint - regardless of my change it has to jump over something. The previous code tests 3 conditions. The case o errno EAGAIN or similar is handled by the last. So returning zero requires 3 tests and 0 jumps. Returning EAGAIN requires 3 tests and 1 jump. With the committed patch returning zero requires 1 test and 0 jumps. Returning EAGAIN requires 3 tests and 2 jumps. Given how much more frequent returning zero is, I think it's a net win. However, the code can be further modified to just get rid of the second jump. Either way, the entire syscall path is extremely pessimized. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Oct 15 20:11:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B026C10C7DD7; Mon, 15 Oct 2018 20:11:54 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63007832AC; Mon, 15 Oct 2018 20:11:54 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DF4C11FD1; Mon, 15 Oct 2018 20:11:54 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FKBswY068490; Mon, 15 Oct 2018 20:11:54 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FKBrgQ068303; Mon, 15 Oct 2018 20:11:53 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810152011.w9FKBrgQ068303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 15 Oct 2018 20:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339369 - head/usr.sbin/pw X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.sbin/pw X-SVN-Commit-Revision: 339369 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.27 Precedence: list List-Id: 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, 15 Oct 2018 20:11:54 -0000 Author: yuripv Date: Mon Oct 15 20:11:53 2018 New Revision: 339369 URL: https://svnweb.freebsd.org/changeset/base/339369 Log: pw: respect path specified using -V when writing pw.conf, and -C is not explicitly specified. -V path is already used to determine which file to read default values from, so it's only logical to write them to the same file. PR: 231653 Reviewed by: eugen, bapt Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17566 Modified: head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_utils.c Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Mon Oct 15 19:48:36 2018 (r339368) +++ head/usr.sbin/pw/pw.h Mon Oct 15 20:11:53 2018 (r339369) @@ -64,6 +64,7 @@ enum _which }; #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) +#define _PW_CONF "pw.conf" #define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Mon Oct 15 19:48:36 2018 (r339368) +++ head/usr.sbin/pw/pw_conf.c Mon Oct 15 20:11:53 2018 (r339369) @@ -417,9 +417,13 @@ write_userconfig(struct userconf *cnf, const char *fil int i, j; struct sbuf *buf; FILE *fp; + char cfgfile[MAXPATHLEN]; - if (file == NULL) - file = _PATH_PW_CONF; + if (file == NULL) { + snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, + conf.etcpath); + file = cfgfile; + } if ((fd = open(file, O_CREAT|O_RDWR|O_TRUNC|O_EXLOCK, 0644)) == -1) return (0); Modified: head/usr.sbin/pw/pw_utils.c ============================================================================== --- head/usr.sbin/pw/pw_utils.c Mon Oct 15 19:48:36 2018 (r339368) +++ head/usr.sbin/pw/pw_utils.c Mon Oct 15 20:11:53 2018 (r339369) @@ -71,7 +71,7 @@ get_userconfig(const char *config) if (config != NULL) return (read_userconfig(config)); - snprintf(defaultcfg, sizeof(defaultcfg), "%s/pw.conf", conf.etcpath); + snprintf(defaultcfg, sizeof(defaultcfg), "%s/" _PW_CONF, conf.etcpath); return (read_userconfig(defaultcfg)); } From owner-svn-src-head@freebsd.org Mon Oct 15 20:20:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB7AD10C8138; Mon, 15 Oct 2018 20:20:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 612088374B; Mon, 15 Oct 2018 20:20:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDAB1203B; Mon, 15 Oct 2018 20:20:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FKKwps072718; Mon, 15 Oct 2018 20:20:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FKKwbL072717; Mon, 15 Oct 2018 20:20:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810152020.w9FKKwbL072717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 15 Oct 2018 20:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339370 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 339370 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.27 Precedence: list List-Id: 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, 15 Oct 2018 20:20:58 -0000 Author: glebius Date: Mon Oct 15 20:20:57 2018 New Revision: 339370 URL: https://svnweb.freebsd.org/changeset/base/339370 Log: Avoid OOB reads in memmem(3). commit 51bdcdc424bd7169c8cccdc2de7cad17f5ea0f70 Author: Alexander Monakov Date: Fri Jun 30 00:35:33 2017 +0300 fix OOB reads in Xbyte_memmem Reported by Leah Neukirchen. Reviewed by: emaste Approved by: re (kib) Modified: head/lib/libc/string/memmem.c Modified: head/lib/libc/string/memmem.c ============================================================================== --- head/lib/libc/string/memmem.c Mon Oct 15 20:11:53 2018 (r339369) +++ head/lib/libc/string/memmem.c Mon Oct 15 20:20:57 2018 (r339370) @@ -31,27 +31,27 @@ __FBSDID("$FreeBSD$"); static char *twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint16_t nw = n[0]<<8 | n[1], hw = h[0]<<8 | h[1]; - for (h++, k--; k; k--, hw = hw<<8 | *++h) - if (hw == nw) return (char *)h-1; - return 0; + for (h+=2, k-=2; k; k--, hw = hw<<8 | *h++) + if (hw == nw) return (char *)h-2; + return hw == nw ? (char *)h-2 : 0; } static char *threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8; uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8; - for (h+=2, k-=2; k; k--, hw = (hw|*++h)<<8) - if (hw == nw) return (char *)h-2; - return 0; + for (h+=3, k-=3; k; k--, hw = (hw|*h++)<<8) + if (hw == nw) return (char *)h-3; + return hw == nw ? (char *)h-3 : 0; } static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) { uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3]; uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3]; - for (h+=3, k-=3; k; k--, hw = hw<<8 | *++h) - if (hw == nw) return (char *)h-3; - return 0; + for (h+=4, k-=4; k; k--, hw = hw<<8 | *h++) + if (hw == nw) return (char *)h-4; + return hw == nw ? (char *)h-4 : 0; } #define MAX(a,b) ((a)>(b)?(a):(b)) From owner-svn-src-head@freebsd.org Mon Oct 15 21:35:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8B7010C9F4E; Mon, 15 Oct 2018 21:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA0E86948; Mon, 15 Oct 2018 21:35: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 891E912D04; Mon, 15 Oct 2018 21:35: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 w9FLZweA013530; Mon, 15 Oct 2018 21:35:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FLZwbh013529; Mon, 15 Oct 2018 21:35:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201810152135.w9FLZwbh013529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 15 Oct 2018 21:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339371 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 339371 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.27 Precedence: list List-Id: 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, 15 Oct 2018 21:35:59 -0000 Author: kevans Date: Mon Oct 15 21:35:57 2018 New Revision: 339371 URL: https://svnweb.freebsd.org/changeset/base/339371 Log: Correct COMPAT* macro names in syscalls.master Both ^/sys/compat/freebsd32/syscalls.master and ^/sys/kern/syscalls.master cited "COMPAT[n] #ifdef" instead of "COMPAT_FREEBSD[n] #ifdef" in places. Approved by: re (glebius) Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Oct 15 20:20:57 2018 (r339370) +++ head/sys/compat/freebsd32/syscalls.master Mon Oct 15 21:35:57 2018 (r339371) @@ -26,11 +26,11 @@ ; types: ; STD always included ; COMPAT included on COMPAT #ifdef -; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) -; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) -; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) -; COMPAT10 included on COMPAT10 #ifdef (FreeBSD 10 compat) -; COMPAT11 included on COMPAT11 #ifdef (FreeBSD 11 compat) +; COMPAT4 included on COMPAT_FREEBSD4 #ifdef (FreeBSD 4 compat) +; COMPAT6 included on COMPAT_FREEBSD6 #ifdef (FreeBSD 6 compat) +; COMPAT7 included on COMPAT_FREEBSD7 #ifdef (FreeBSD 7 compat) +; COMPAT10 included on COMPAT_FREEBSD10 #ifdef (FreeBSD 10 compat) +; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Oct 15 20:20:57 2018 (r339370) +++ head/sys/kern/syscalls.master Mon Oct 15 21:35:57 2018 (r339371) @@ -29,7 +29,7 @@ ; COMPAT6 included on COMPAT_FREEBSD6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT_FREEBSD7 #ifdef (FreeBSD 7 compat) ; COMPAT10 included on COMPAT_FREEBSD10 #ifdef (FreeBSD 10 compat) -; COMPAT11 included on COMPAT11 #ifdef (FreeBSD 11 compat) +; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically From owner-svn-src-head@freebsd.org Mon Oct 15 21:59:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490CA10CA71F; Mon, 15 Oct 2018 21:59:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFE818745B; Mon, 15 Oct 2018 21:59:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6A8013025; Mon, 15 Oct 2018 21:59:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9FLxOus024545; Mon, 15 Oct 2018 21:59:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9FLxO1Y024544; Mon, 15 Oct 2018 21:59:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201810152159.w9FLxO1Y024544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 15 Oct 2018 21:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339372 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 339372 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.27 Precedence: list List-Id: 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, 15 Oct 2018 21:59:25 -0000 Author: mav Date: Mon Oct 15 21:59:24 2018 New Revision: 339372 URL: https://svnweb.freebsd.org/changeset/base/339372 Log: Skip VDEV_IO_DONE stage only for ZIO_TYPE_FREE. Device removal code uses zio_vdev_child_io() with ZIO_TYPE_NULL parent, that never happened before. It confused FreeBSD-specific TRIM code, which does not use VDEV_IO_DONE for logical ZIO_TYPE_FREE ZIOs. As result of that stage being skipped device removal ZIOs leaked references and memory that supposed to be freed by VDEV_IO_DONE, making it stuck. It is a quick patch rather then a nice fix, but hopefully we'll be able to drop it all together when alternative TRIM implementation finally get landed. PR: 228750, 229007 Discussed with: allanjude, avg, smh Approved by: re (delphij) MFC after: 5 days Sponsored by: iXsystems, Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Oct 15 21:35:57 2018 (r339371) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Oct 15 21:59:24 2018 (r339372) @@ -1180,7 +1180,8 @@ zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd } /* Not all IO types require vdev io done stage e.g. free */ - if (!(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE)) + if (type == ZIO_TYPE_FREE && + !(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE)) pipeline &= ~ZIO_STAGE_VDEV_IO_DONE; if (vd->vdev_ops->vdev_op_leaf) { From owner-svn-src-head@freebsd.org Tue Oct 16 02:30:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A7FE10D8FDE; Tue, 16 Oct 2018 02:30:14 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF17373BA2; Tue, 16 Oct 2018 02:30:13 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C35AE162C5; Tue, 16 Oct 2018 02:30:13 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9G2UD5v064686; Tue, 16 Oct 2018 02:30:13 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9G2UD4P064685; Tue, 16 Oct 2018 02:30:13 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201810160230.w9G2UD4P064685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 16 Oct 2018 02:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339375 - head/sys/contrib/ck/src X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/contrib/ck/src X-SVN-Commit-Revision: 339375 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.27 Precedence: list List-Id: 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, 16 Oct 2018 02:30:14 -0000 Author: jtl Date: Tue Oct 16 02:30:13 2018 New Revision: 339375 URL: https://svnweb.freebsd.org/changeset/base/339375 Log: Import CK as of commit 5221ae2f3722a78c7fc41e47069ad94983d3bccb. This fixes two problems, one where epoch calls could occur before all the readers had exited the epoch section, and one where the epoch calls could be unnecessarily delayed. Approved by: re (glebius) Modified: head/sys/contrib/ck/src/ck_epoch.c Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/src/ck_epoch.c ============================================================================== --- head/sys/contrib/ck/src/ck_epoch.c Tue Oct 16 00:50:00 2018 (r339374) +++ head/sys/contrib/ck/src/ck_epoch.c Tue Oct 16 02:30:13 2018 (r339375) @@ -127,6 +127,14 @@ */ #define CK_EPOCH_GRACE 3U +/* + * CK_EPOCH_LENGTH must be a power-of-2 (because (CK_EPOCH_LENGTH - 1) is used + * as a mask, and it must be at least 3 (see comments above). + */ +#if (CK_EPOCH_LENGTH < 3 || (CK_EPOCH_LENGTH & (CK_EPOCH_LENGTH - 1)) != 0) +#error "CK_EPOCH_LENGTH must be a power of 2 and >= 3" +#endif + enum { CK_EPOCH_STATE_USED = 0, CK_EPOCH_STATE_FREE = 1 @@ -348,7 +356,7 @@ ck_epoch_scan(struct ck_epoch *global, return NULL; } -static void +static unsigned int ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e, ck_stack_t *deferred) { unsigned int epoch = e & (CK_EPOCH_LENGTH - 1); @@ -366,6 +374,7 @@ ck_epoch_dispatch(struct ck_epoch_record *record, unsi ck_stack_push_spnc(deferred, &entry->stack_entry); else entry->function(entry); + i++; } @@ -381,7 +390,7 @@ ck_epoch_dispatch(struct ck_epoch_record *record, unsi ck_pr_sub_uint(&record->n_pending, i); } - return; + return i; } /* @@ -560,16 +569,28 @@ ck_epoch_poll_deferred(struct ck_epoch_record *record, unsigned int epoch; struct ck_epoch_record *cr = NULL; struct ck_epoch *global = record->global; + unsigned int n_dispatch; epoch = ck_pr_load_uint(&global->epoch); /* Serialize epoch snapshots with respect to global epoch. */ ck_pr_fence_memory(); + + /* + * At this point, epoch is the current global epoch value. + * There may or may not be active threads which observed epoch - 1. + * (ck_epoch_scan() will tell us that). However, there should be + * no active threads which observed epoch - 2. + * + * Note that checking epoch - 2 is necessary, as race conditions can + * allow another thread to increment the global epoch before this + * thread runs. + */ + n_dispatch = ck_epoch_dispatch(record, epoch - 2, deferred); + cr = ck_epoch_scan(global, cr, epoch, &active); - if (cr != NULL) { - record->epoch = epoch; - return false; - } + if (cr != NULL) + return (n_dispatch > 0); /* We are at a grace period if all threads are inactive. */ if (active == false) { @@ -580,10 +601,17 @@ ck_epoch_poll_deferred(struct ck_epoch_record *record, return true; } - /* If an active thread exists, rely on epoch observation. */ + /* + * If an active thread exists, rely on epoch observation. + * + * All the active threads entered the epoch section during + * the current epoch. Therefore, we can now run the handlers + * for the immediately preceding epoch and attempt to + * advance the epoch if it hasn't been already. + */ (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); - ck_epoch_dispatch(record, epoch + 1, deferred); + ck_epoch_dispatch(record, epoch - 1, deferred); return true; } From owner-svn-src-head@freebsd.org Tue Oct 16 05:39:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B747C10E24DE; Tue, 16 Oct 2018 05:39:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7787BE46; Tue, 16 Oct 2018 05:39:45 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it1-f175.google.com with SMTP id p64-v6so30756022itp.0; Mon, 15 Oct 2018 22:39:45 -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=p1PHhgKni2d8CiurkQcGUC1AeSCnM4QC/G2lhwjKzGU=; b=bPLvi5pNM+Mhn9aqoIfQuti44EVlTyYq+Kop0kNcb5GzgIOklh4ZhaNkKfArd3h0lr xAjrnR6IZLpln4hcpqh2iimCEGGQgECgtKgBiWLl/TRZ+Fn0iRbt4imSR8T8MR8x0dQ7 d32UTLlSLg8i1yAzdGA5r/Jzj4l552po9MlRTrlJlDjSYalDnCheMtfPxPmMS+/4Vrd0 gkmktWlhW2MLOf768SkPap/EVGWJs/axeb1j2P5n7Jmug7B9Dc0vJFcP8M6GRcPa/HwT nwbdnNcdG4rXNp7dXFFLRg8nx6duf4S9qcH6r9/syEJ+R8ZFxmTab8fnFY1Fo1Xpjwo6 J1Wg== X-Gm-Message-State: ABuFfog6zA947AO/VAZHbKUFO8tAQ4sZOWD0cZTIkyH6MnGsQfU/712+ TF6vezLy/6bI+qM0sm8Z/j8WIr4RSTmO0Y07rVKhWw== X-Google-Smtp-Source: ACcGV63NMSh8Mqt9/c4TqtILhYlfUEZxxbCWZsNYQnZY0yZ4bvgMhqs8FSlQoPTn4P2hvfFB/8zx8yTHgKFrQW5NN9s= X-Received: by 2002:a24:fe86:: with SMTP id w128-v6mr11808716ith.84.1539668384097; Mon, 15 Oct 2018 22:39:44 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Tue, 16 Oct 2018 07:39:32 +0200 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Ed Maste Cc: Gerald Pfeifer , re , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: multipart/mixed; boundary="0000000000001b5a93057851fb83" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 16 Oct 2018 05:39:46 -0000 --0000000000001b5a93057851fb83 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 15, 2018 at 3:53 PM Ed Maste wrote: > On Mon, 15 Oct 2018 at 07:13, Ed Maste wrote: > > Hi Antoine, did you bisect to this rev or does it just look like the > > most probable candidate? Can you copy a pair of differing .o files > > (say, gcc/cc1plus-checksum.o) from the work dir to freefall? > > Antoine provided a tarball of the work dir to me, and pointed out that > the *-checksum.o files are not interesting - they are warnings only > and are present prior to the identified change. > > Comparing one of the other differing files, e.g. > stage{2,3}-gcc/expmed.o, demonstrates the problem. Gcc's build > machinery is reasonably obfuscated so I'm not sure of the exact set of > operations, but I can infer that the stage2/stage3 comparison is > running strip on the object files and then comparing the result. Gcc > is encountering this part of my strip/objcopy change: > > > Stripping binaries with relocations > > referencing removed symbols was already broken, and after this change > > may still be broken in a different way. > > Stripping symbols and relocations from an object file is not a > particularly useful operation, since the object then can't be linked > or otherwise used. But it seems Gcc's stage comparison relies on this. > I did try running "strip --strip-debug" on stage{2,3}-gcc/expmed.o (a > reasonable operation on object files) and that produced identical > output. > > It may well be that a further change to ELF Tool Chain's strip is > warranted, but I suspect the most straightforward and reliable fix > here will be to just have gcc use GNU strip. The attached patch for the gcc ports fixes the failures for me. Antoine --0000000000001b5a93057851fb83 Content-Type: text/x-patch; charset="US-ASCII"; name="gcc-strip.diff" Content-Disposition: attachment; filename="gcc-strip.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jnbarwaf0 SW5kZXg6IGxhbmcvZ2NjNDgvTWFrZWZpbGUKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGFuZy9nY2M0OC9NYWtl ZmlsZQkocmV2aXNpb24gNDgyMTY1KQorKysgbGFuZy9nY2M0OC9NYWtlZmlsZQkod29ya2luZyBj b3B5KQpAQCAtMzMsNiArMzMsNyBAQAogU1VGRklYPQkJJHtQT1JUVkVSU0lPTjpDLyhbMC05XSsp LihbMC05XSspLiovXDFcMi99CiBVU0VTPQkJY29tcGlsZXIgY3BlIGdtYWtlIGljb252IGxpYnRv b2wgbWFrZWluZm8gcGVybDUgdGFyOmJ6aXAyCiBVU0VfQklOVVRJTFM9CXllcworQklOQVJZX0FM SUFTPQlzdHJpcD0ke0xPQ0FMQkFTRX0vYmluL3N0cmlwCiBVU0VfUEVSTDU9CWJ1aWxkCiBTU1Bf VU5TQUZFPQl5ZXMKIApJbmRleDogbGFuZy9nY2M0OS9NYWtlZmlsZQo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBs YW5nL2djYzQ5L01ha2VmaWxlCShyZXZpc2lvbiA0ODIxNjUpCisrKyBsYW5nL2djYzQ5L01ha2Vm aWxlCSh3b3JraW5nIGNvcHkpCkBAIC0zMyw2ICszMyw3IEBACiBTVUZGSVg9CQkke1BPUlRWRVJT SU9OOkMvKFswLTldKykuKFswLTldKykuKi9cMVwyL30KIFVTRVM9CQljb21waWxlciBjcGUgZ21h a2UgaWNvbnYgbGlidG9vbCBtYWtlaW5mbyBwZXJsNSB0YXI6YnppcDIKIFVTRV9CSU5VVElMUz0J eWVzCitCSU5BUllfQUxJQVM9CXN0cmlwPSR7TE9DQUxCQVNFfS9iaW4vc3RyaXAKIFVTRV9QRVJM NT0JYnVpbGQKIFNTUF9VTlNBRkU9CXllcwogCkluZGV4OiBsYW5nL2djYzUvTWFrZWZpbGUKPT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQotLS0gbGFuZy9nY2M1L01ha2VmaWxlCShyZXZpc2lvbiA0ODIxNjUpCisrKyBsYW5n L2djYzUvTWFrZWZpbGUJKHdvcmtpbmcgY29weSkKQEAgLTM0LDYgKzM0LDcgQEAKIFNVRkZJWD0J CSR7UE9SVFZFUlNJT046Qy8oWzAtOV0rKS4qL1wxL30KIFVTRVM9CQljb21waWxlciBjcGUgZ21h a2UgaWNvbnYgbGlidG9vbCBtYWtlaW5mbyBwZXJsNSB0YXI6eHoKIFVTRV9CSU5VVElMUz0JeWVz CitCSU5BUllfQUxJQVM9CXN0cmlwPSR7TE9DQUxCQVNFfS9iaW4vc3RyaXAKIFVTRV9QRVJMNT0J YnVpbGQKIFNTUF9VTlNBRkU9CXllcwogCkluZGV4OiBsYW5nL2djYzYvTWFrZWZpbGUKPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PQotLS0gbGFuZy9nY2M2L01ha2VmaWxlCShyZXZpc2lvbiA0ODIxNjUpCisrKyBsYW5nL2dj YzYvTWFrZWZpbGUJKHdvcmtpbmcgY29weSkKQEAgLTM1LDYgKzM1LDcgQEAKIFNVRkZJWD0JCSR7 UE9SVFZFUlNJT046Qy8oWzAtOV0rKS4qL1wxL30KIFVTRVM9CQljb21waWxlciBjcGUgZ21ha2Ug aWNvbnYgbGlidG9vbCBtYWtlaW5mbyBwZXJsNSB0YXI6eHoKIFVTRV9CSU5VVElMUz0JeWVzCitC SU5BUllfQUxJQVM9CXN0cmlwPSR7TE9DQUxCQVNFfS9iaW4vc3RyaXAKIFVTRV9QRVJMNT0JYnVp bGQKIFNTUF9VTlNBRkU9CXllcwogQ0ZMQUdTOj0JJHtDRkxBR1M6Ti1tcmV0cG9saW5lfQpJbmRl eDogbGFuZy9nY2M2LWRldmVsL01ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxhbmcvZ2NjNi1kZXZl bC9NYWtlZmlsZQkocmV2aXNpb24gNDgyMTY1KQorKysgbGFuZy9nY2M2LWRldmVsL01ha2VmaWxl CSh3b3JraW5nIGNvcHkpCkBAIC00MCw2ICs0MCw3IEBACiBTVUZGSVg9CQkke1BPUlRWRVJTSU9O OkMvKFswLTldKykuKi9cMS99CiBVU0VTPQkJY29tcGlsZXIgY3BlIGdtYWtlIGljb252IGxpYnRv b2wgbWFrZWluZm8gcGVybDUgdGFyOnh6CiBVU0VfQklOVVRJTFM9CXllcworQklOQVJZX0FMSUFT PQlzdHJpcD0ke0xPQ0FMQkFTRX0vYmluL3N0cmlwCiBVU0VfUEVSTDU9CWJ1aWxkCiBTU1BfVU5T QUZFPQl5ZXMKIApJbmRleDogbGFuZy9nY2M3L01ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxhbmcv Z2NjNy9NYWtlZmlsZQkocmV2aXNpb24gNDgyMTY1KQorKysgbGFuZy9nY2M3L01ha2VmaWxlCSh3 b3JraW5nIGNvcHkpCkBAIC0zNCw2ICszNCw3IEBACiBTVUZGSVg9CQkke1BPUlRWRVJTSU9OOkMv KFswLTldKykuKi9cMS99CiBVU0VTPQkJY29tcGlsZXIgY3BlIGdtYWtlIGljb252IGxpYnRvb2wg bWFrZWluZm8gcGVybDUgdGFyOnh6CiBVU0VfQklOVVRJTFM9CXllcworQklOQVJZX0FMSUFTPQlz dHJpcD0ke0xPQ0FMQkFTRX0vYmluL3N0cmlwCiBVU0VfUEVSTDU9CWJ1aWxkCiBTU1BfVU5TQUZF PQl5ZXMKIENGTEFHUzo9CSR7Q0ZMQUdTOk4tbXJldHBvbGluZX0KSW5kZXg6IGxhbmcvZ2NjNy1k ZXZlbC9NYWtlZmlsZQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsYW5nL2djYzctZGV2ZWwvTWFrZWZpbGUJKHJl dmlzaW9uIDQ4MjE2NSkKKysrIGxhbmcvZ2NjNy1kZXZlbC9NYWtlZmlsZQkod29ya2luZyBjb3B5 KQpAQCAtNDAsNiArNDAsNyBAQAogU1VGRklYPQkJJHtQT1JUVkVSU0lPTjpDLyhbMC05XSspLiov XDEvfQogVVNFUz0JCWNvbXBpbGVyIGNwZSBnbWFrZSBpY29udiBsaWJ0b29sIG1ha2VpbmZvIHBl cmw1IHRhcjp4egogVVNFX0JJTlVUSUxTPQl5ZXMKK0JJTkFSWV9BTElBUz0Jc3RyaXA9JHtMT0NB TEJBU0V9L2Jpbi9zdHJpcAogVVNFX1BFUkw1PQlidWlsZAogU1NQX1VOU0FGRT0JeWVzCiAKSW5k ZXg6IGxhbmcvZ2NjOC9NYWtlZmlsZQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsYW5nL2djYzgvTWFrZWZpbGUJ KHJldmlzaW9uIDQ4MjE2NSkKKysrIGxhbmcvZ2NjOC9NYWtlZmlsZQkod29ya2luZyBjb3B5KQpA QCAtMzQsNiArMzQsNyBAQAogU1VGRklYPQkJJHtQT1JUVkVSU0lPTjpDLyhbMC05XSspLiovXDEv fQogVVNFUz0JCWNvbXBpbGVyIGNwZSBnbWFrZSBpY29udiBsaWJ0b29sIG1ha2VpbmZvIHBlcmw1 IHRhcjp4egogVVNFX0JJTlVUSUxTPQl5ZXMKK0JJTkFSWV9BTElBUz0Jc3RyaXA9JHtMT0NBTEJB U0V9L2Jpbi9zdHJpcAogVVNFX1BFUkw1PQlidWlsZAogU1NQX1VOU0FGRT0JeWVzCiBDRkxBR1M6 PQkke0NGTEFHUzpOLW1yZXRwb2xpbmV9CkluZGV4OiBsYW5nL2djYzgtZGV2ZWwvTWFrZWZpbGUK PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PQotLS0gbGFuZy9nY2M4LWRldmVsL01ha2VmaWxlCShyZXZpc2lvbiA0ODIxNjUp CisrKyBsYW5nL2djYzgtZGV2ZWwvTWFrZWZpbGUJKHdvcmtpbmcgY29weSkKQEAgLTQwLDYgKzQw LDcgQEAKIFNVRkZJWD0JCSR7UE9SVFZFUlNJT046Qy8oWzAtOV0rKS4qL1wxL30KIFVTRVM9CQlj b21waWxlciBjcGUgZ21ha2UgaWNvbnYgbGlidG9vbCBtYWtlaW5mbyBwZXJsNSB0YXI6eHoKIFVT RV9CSU5VVElMUz0JeWVzCitCSU5BUllfQUxJQVM9CXN0cmlwPSR7TE9DQUxCQVNFfS9iaW4vc3Ry aXAKIFVTRV9QRVJMNT0JYnVpbGQKIFNTUF9VTlNBRkU9CXllcwogCkluZGV4OiBsYW5nL2djYzkt ZGV2ZWwvTWFrZWZpbGUKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGFuZy9nY2M5LWRldmVsL01ha2VmaWxlCShy ZXZpc2lvbiA0ODIxNjUpCisrKyBsYW5nL2djYzktZGV2ZWwvTWFrZWZpbGUJKHdvcmtpbmcgY29w eSkKQEAgLTM4LDYgKzM4LDcgQEAKIFNVRkZJWD0JCSR7UE9SVFZFUlNJT046Qy8oWzAtOV0rKS4q L1wxL30KIFVTRVM9CQljb21waWxlciBjcGUgZ21ha2UgaWNvbnYgbGlidG9vbCBtYWtlaW5mbyBw ZXJsNSB0YXI6eHoKIFVTRV9CSU5VVElMUz0JeWVzCitCSU5BUllfQUxJQVM9CXN0cmlwPSR7TE9D QUxCQVNFfS9iaW4vc3RyaXAKIFVTRV9QRVJMNT0JYnVpbGQKIFNTUF9VTlNBRkU9CXllcwogCg== --0000000000001b5a93057851fb83-- From owner-svn-src-head@freebsd.org Tue Oct 16 07:26:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFF210E4A08; Tue, 16 Oct 2018 07:26:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A014F7F0DE; Tue, 16 Oct 2018 07:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w9G7QEEB012929 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Oct 2018 10:26:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w9G7QEEB012929 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w9G7QE2m012928; Tue, 16 Oct 2018 10:26:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Oct 2018 10:26:14 +0300 From: Konstantin Belousov To: Antoine Brodin Cc: Ed Maste , Gerald Pfeifer , re , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy Message-ID: <20181016072614.GO5335@kib.kiev.ua> References: <201810132126.w9DLQ73C022496@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=1.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED,SORTED_RECIPS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 16 Oct 2018 07:26:27 -0000 On Tue, Oct 16, 2018 at 07:39:32AM +0200, Antoine Brodin wrote: > On Mon, Oct 15, 2018 at 3:53 PM Ed Maste wrote: > > On Mon, 15 Oct 2018 at 07:13, Ed Maste wrote: > > > Hi Antoine, did you bisect to this rev or does it just look like the > > > most probable candidate? Can you copy a pair of differing .o files > > > (say, gcc/cc1plus-checksum.o) from the work dir to freefall? > > > > Antoine provided a tarball of the work dir to me, and pointed out that > > the *-checksum.o files are not interesting - they are warnings only > > and are present prior to the identified change. > > > > Comparing one of the other differing files, e.g. > > stage{2,3}-gcc/expmed.o, demonstrates the problem. Gcc's build > > machinery is reasonably obfuscated so I'm not sure of the exact set of > > operations, but I can infer that the stage2/stage3 comparison is > > running strip on the object files and then comparing the result. Gcc > > is encountering this part of my strip/objcopy change: > > > > > Stripping binaries with relocations > > > referencing removed symbols was already broken, and after this change > > > may still be broken in a different way. > > > > Stripping symbols and relocations from an object file is not a > > particularly useful operation, since the object then can't be linked > > or otherwise used. But it seems Gcc's stage comparison relies on this. > > I did try running "strip --strip-debug" on stage{2,3}-gcc/expmed.o (a > > reasonable operation on object files) and that produced identical > > output. > > > > It may well be that a further change to ELF Tool Chain's strip is > > warranted, but I suspect the most straightforward and reliable fix > > here will be to just have gcc use GNU strip. > > The attached patch for the gcc ports fixes the failures for me. > > Antoine > Index: lang/gcc48/Makefile > =================================================================== > --- lang/gcc48/Makefile (revision 482165) > +++ lang/gcc48/Makefile (working copy) > @@ -33,6 +33,7 @@ > SUFFIX= ${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/} > USES= compiler cpe gmake iconv libtool makeinfo perl5 tar:bzip2 > USE_BINUTILS= yes > +BINARY_ALIAS= strip=${LOCALBASE}/bin/strip Shouldn't USE_BINUTILS automatically prefer all binaries from there to be used, instead of the base system variants ? From owner-svn-src-head@freebsd.org Tue Oct 16 10:18:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1800410C8DBD; Tue, 16 Oct 2018 10:18:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C07B1851B7; Tue, 16 Oct 2018 10:18:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 92F952117C; Tue, 16 Oct 2018 10:18:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 8119289CE0; Tue, 16 Oct 2018 12:18:23 +0200 (CEST) Date: Tue, 16 Oct 2018 12:18:23 +0200 From: Baptiste Daroussin To: Konstantin Belousov Cc: Antoine Brodin , Ed Maste , Gerald Pfeifer , re , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy Message-ID: <20181016101822.gxsuvtczywpxqmiy@ivaldir.net> References: <201810132126.w9DLQ73C022496@repo.freebsd.org> <20181016072614.GO5335@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5mnps4f4lfeoxi7i" Content-Disposition: inline In-Reply-To: <20181016072614.GO5335@kib.kiev.ua> User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 16 Oct 2018 10:18:25 -0000 --5mnps4f4lfeoxi7i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 16, 2018 at 10:26:14AM +0300, Konstantin Belousov wrote: > On Tue, Oct 16, 2018 at 07:39:32AM +0200, Antoine Brodin wrote: > > On Mon, Oct 15, 2018 at 3:53 PM Ed Maste wrote: > > > On Mon, 15 Oct 2018 at 07:13, Ed Maste wrote: > > > > Hi Antoine, did you bisect to this rev or does it just look like the > > > > most probable candidate? Can you copy a pair of differing .o files > > > > (say, gcc/cc1plus-checksum.o) from the work dir to freefall? > > > > > > Antoine provided a tarball of the work dir to me, and pointed out that > > > the *-checksum.o files are not interesting - they are warnings only > > > and are present prior to the identified change. > > > > > > Comparing one of the other differing files, e.g. > > > stage{2,3}-gcc/expmed.o, demonstrates the problem. Gcc's build > > > machinery is reasonably obfuscated so I'm not sure of the exact set of > > > operations, but I can infer that the stage2/stage3 comparison is > > > running strip on the object files and then comparing the result. Gcc > > > is encountering this part of my strip/objcopy change: > > > > > > > Stripping binaries with relocations > > > > referencing removed symbols was already broken, and after this chan= ge > > > > may still be broken in a different way. > > > > > > Stripping symbols and relocations from an object file is not a > > > particularly useful operation, since the object then can't be linked > > > or otherwise used. But it seems Gcc's stage comparison relies on this. > > > I did try running "strip --strip-debug" on stage{2,3}-gcc/expmed.o (a > > > reasonable operation on object files) and that produced identical > > > output. > > > > > > It may well be that a further change to ELF Tool Chain's strip is > > > warranted, but I suspect the most straightforward and reliable fix > > > here will be to just have gcc use GNU strip. > >=20 > > The attached patch for the gcc ports fixes the failures for me. > >=20 > > Antoine >=20 > > Index: lang/gcc48/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- lang/gcc48/Makefile (revision 482165) > > +++ lang/gcc48/Makefile (working copy) > > @@ -33,6 +33,7 @@ > > SUFFIX=3D ${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/} > > USES=3D compiler cpe gmake iconv libtool makeinfo perl5 tar:bzip2 > > USE_BINUTILS=3D yes > > +BINARY_ALIAS=3D strip=3D${LOCALBASE}/bin/strip > Shouldn't USE_BINUTILS automatically prefer all binaries from there to be > used, instead of the base system variants ? >=20 Strip is not in the list of binaries to override, probably something to fix. Plus it expects the build system to respect the "classic" env var, which im= ho should be replaced by BINARY_ALIAS when possible Best regards, Bapt --5mnps4f4lfeoxi7i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlvFuuwACgkQY4mL3PG3 PlrmaA//XM6qWOpITz8r7S7Z97gRZTzelPvbw3z3/E3H69iU63lD4rMV/Danmv9n K97tTv0lqU2yzfE9sS9Dx94ILAyH8/QTW4EQumDRVXPXR3wGyeGOAvVpdPpfOxAs AEhwKsSTPflPAssk1Q+/CvNY64feoqWSzjGaJedWC2Ucv8yqGSYQPks3n0r3b5WV MWsfKe2EN4S6RI5M0v4xdyFPq3BqdlDH8Vp0cUjFgvGDHXolf04RnvBBgZB/fkna pYbUgPIzH/zH1DO5v1PPYsg6Rox7RW8RHSXhhu/jPG8HTOamYP0yEeVUL7HJWjUN ubvYMyqkiysZP4wBzy6cqKmuYUSdjfcmnZgYvt1z4n32ski40j3YkcEyuM5sJjdm qkBb0boegmEaDgquqE6uQcqtxLudHT5zbvXf1Ur1k2AgFyfIBOx1bNdISOZ/XWH0 DMhn7sbQxsc3dilhjeGbacDMRgH7zq+5af7E3ntkcyCD0us5/PdeTpIB+hpctJCQ yQLrp1991SmEQdFjg+8wwl0br34EFRx6BeMEk/gKYjmzUUCLgzxZJahBtSyJV05e 07EL5BHKNg/ouqV7NjBPHvUWU+E1t1nPeyeYruAQt6KM1V9SWS9Bu5D1FTDsF18j neRvpnuehMhkkjkC4mr5TXkJ3EZuFJgC/FqT5WtGvybL3DyDiPs= =LU1Y -----END PGP SIGNATURE----- --5mnps4f4lfeoxi7i-- From owner-svn-src-head@freebsd.org Tue Oct 16 14:16:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA9CE10D4E36; Tue, 16 Oct 2018 14:16:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D4708EAEA; Tue, 16 Oct 2018 14:16:39 +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 77A771DA29; Tue, 16 Oct 2018 14:16:39 +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 w9GEGdlg030335; Tue, 16 Oct 2018 14:16:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GEGd6O030334; Tue, 16 Oct 2018 14:16:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810161416.w9GEGd6O030334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 16 Oct 2018 14:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339377 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 339377 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.27 Precedence: list List-Id: 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, 16 Oct 2018 14:16:40 -0000 Author: gjb Date: Tue Oct 16 14:16:39 2018 New Revision: 339377 URL: https://svnweb.freebsd.org/changeset/base/339377 Log: Update head from ALPHA9 to ALPHA10 as part of the 12.0-RELEASE cycle. This is expected to be the final ALPHA build of this release cycle, prior to branching stable/12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Tue Oct 16 03:18:57 2018 (r339376) +++ head/sys/conf/newvers.sh Tue Oct 16 14:16:39 2018 (r339377) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="ALPHA9" +BRANCH="ALPHA10" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Tue Oct 16 14:41:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A136310D57B4; Tue, 16 Oct 2018 14:41:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51F7F8F873; Tue, 16 Oct 2018 14:41:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CE9F1DEC3; Tue, 16 Oct 2018 14:41:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GEfA18040660; Tue, 16 Oct 2018 14:41:10 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GEfAqh040659; Tue, 16 Oct 2018 14:41:10 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201810161441.w9GEfAqh040659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 16 Oct 2018 14:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339378 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339378 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.27 Precedence: list List-Id: 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, 16 Oct 2018 14:41:10 -0000 Author: jtl Date: Tue Oct 16 14:41:09 2018 New Revision: 339378 URL: https://svnweb.freebsd.org/changeset/base/339378 Log: In r338102, the TCP reassembly code was substantially restructured. Prior to this change, the code sometimes used a temporary stack variable to hold details of a TCP segment. r338102 stopped using the variable to hold segments, but did not actually remove the variable. Because the variable is no longer used, we can safely remove it. Approved by: re (gjb) Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Tue Oct 16 14:16:39 2018 (r339377) +++ head/sys/netinet/tcp_reass.c Tue Oct 16 14:41:09 2018 (r339378) @@ -528,7 +528,6 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, tcp_seq struct tseg_qent *p = NULL; struct tseg_qent *nq = NULL; struct tseg_qent *te = NULL; - struct tseg_qent tqs; struct mbuf *mlast = NULL; struct sockbuf *sb; struct socket *so = tp->t_inpcb->inp_socket; @@ -1053,8 +1052,7 @@ present: KASSERT(tp->t_segqmbuflen >= q->tqe_mbuf_cnt, ("tp:%p seg queue goes negative", tp)); tp->t_segqmbuflen -= q->tqe_mbuf_cnt; - if (q != &tqs) - uma_zfree(tcp_reass_zone, q); + uma_zfree(tcp_reass_zone, q); tp->t_segqlen--; q = nq; } while (q && q->tqe_start == tp->rcv_nxt); From owner-svn-src-head@freebsd.org Tue Oct 16 15:57:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41A9E10D8363; Tue, 16 Oct 2018 15:57:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA3F272D08; Tue, 16 Oct 2018 15:57:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0DC21EAF3; Tue, 16 Oct 2018 15:57:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GFvGJS081371; Tue, 16 Oct 2018 15:57:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GFvGTX081370; Tue, 16 Oct 2018 15:57:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201810161557.w9GFvGTX081370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Oct 2018 15:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339379 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339379 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.27 Precedence: list List-Id: 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, 16 Oct 2018 15:57:17 -0000 Author: glebius Date: Tue Oct 16 15:57:16 2018 New Revision: 339379 URL: https://svnweb.freebsd.org/changeset/base/339379 Log: Plug sendfile(2) on a listening socket with proper error code. Reported by: ngie Reviewed by: ngie Approved by: re (delphij) Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Oct 16 14:41:09 2018 (r339378) +++ head/sys/kern/kern_sendfile.c Tue Oct 16 15:57:16 2018 (r339379) @@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); + if (SOLISTENING(*so)) + return (ENOTCONN); return (0); } From owner-svn-src-head@freebsd.org Tue Oct 16 16:00:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C1F210D85D4; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510447301E; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BE791EB10; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GG0gUC084637; Tue, 16 Oct 2018 16:00:42 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GG0fmg084615; Tue, 16 Oct 2018 16:00:41 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810161600.w9GG0fmg084615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 16 Oct 2018 16:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339380 - head/usr.sbin/pw X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.sbin/pw X-SVN-Commit-Revision: 339380 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.27 Precedence: list List-Id: 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, 16 Oct 2018 16:00:42 -0000 Author: yuripv Date: Tue Oct 16 16:00:41 2018 New Revision: 339380 URL: https://svnweb.freebsd.org/changeset/base/339380 Log: pw: (file == NULL) check is always false in read_userconfig(), remove it. Drop the now unused _PATH_PW_CONF definition. [1] While here, change the last remaining hardcoded "/etc" to _PATH_PWD. Noted by: glebius [1] Reviewed by: eugen Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17575 Modified: head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw.c Tue Oct 16 16:00:41 2018 (r339380) @@ -162,7 +162,8 @@ main(int argc, char *argv[]) PWF._altdir = PWF_ROOTDIR; } snprintf(conf.etcpath, sizeof(conf.etcpath), - "%s%s", optarg, arg == 'R' ? "/etc" : ""); + "%s%s", optarg, arg == 'R' ? + _PATH_PWD : ""); } else break; } Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw.h Tue Oct 16 16:00:41 2018 (r339380) @@ -65,7 +65,6 @@ enum _which #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PW_CONF "pw.conf" -#define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw_conf.c Tue Oct 16 16:00:41 2018 (r339380) @@ -255,9 +255,6 @@ read_userconfig(char const * file) buf = NULL; linecap = 0; - if (file == NULL) - file = _PATH_PW_CONF; - if ((fp = fopen(file, "r")) == NULL) return (&config); From owner-svn-src-head@freebsd.org Tue Oct 16 16:03:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7EC910D8ABA; Tue, 16 Oct 2018 16:03:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8635373508; Tue, 16 Oct 2018 16:03:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EFC91EC9E; Tue, 16 Oct 2018 16:03:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GG3Hi9086646; Tue, 16 Oct 2018 16:03:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GG3HCP086645; Tue, 16 Oct 2018 16:03:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201810161603.w9GG3HCP086645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 16 Oct 2018 16:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339381 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 339381 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.27 Precedence: list List-Id: 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, 16 Oct 2018 16:03:18 -0000 Author: br Date: Tue Oct 16 16:03:17 2018 New Revision: 339381 URL: https://svnweb.freebsd.org/changeset/base/339381 Log: Invalidate TLB on a local hart. This was missed in r339367 ("Various fixes for TLB management on RISC-V."). This fixes operation on lowRISC. Reviewed by: jhb Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17583 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Oct 16 16:00:41 2018 (r339380) +++ head/sys/riscv/riscv/pmap.c Tue Oct 16 16:03:17 2018 (r339381) @@ -804,6 +804,7 @@ pmap_invalidate_all(pmap_t pmap) * all sfence_vma requests as global however. */ sbi_remote_sfence_vma(mask.__bits, 0, 0); + sfence_vma(); sched_unpin(); } #else From owner-svn-src-head@freebsd.org Tue Oct 16 17:00:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216AA10DA9F2; Tue, 16 Oct 2018 17:00:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CABAB75A80; Tue, 16 Oct 2018 17:00:42 +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 C5A771F55C; Tue, 16 Oct 2018 17:00:42 +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 w9GH0g9G013500; Tue, 16 Oct 2018 17:00:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GH0go5013499; Tue, 16 Oct 2018 17:00:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810161700.w9GH0go5013499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Oct 2018 17:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339384 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 339384 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.27 Precedence: list List-Id: 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, 16 Oct 2018 17:00:43 -0000 Author: kib Date: Tue Oct 16 17:00:42 2018 New Revision: 339384 URL: https://svnweb.freebsd.org/changeset/base/339384 Log: Add clwb(). Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 3 days Differential revision: https://reviews.freebsd.org/D17070 Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Oct 16 16:45:21 2018 (r339383) +++ head/sys/amd64/include/cpufunc.h Tue Oct 16 17:00:42 2018 (r339384) @@ -116,6 +116,13 @@ clflushopt(u_long addr) } static __inline void +clwb(u_long addr) +{ + + __asm __volatile("clwb %0" : : "m" (*(char *)addr)); +} + +static __inline void clts(void) { From owner-svn-src-head@freebsd.org Tue Oct 16 17:17:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D07010DB1CE; Tue, 16 Oct 2018 17:17:12 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27D40766A1; Tue, 16 Oct 2018 17:17:12 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22B2E1F888; Tue, 16 Oct 2018 17:17:12 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GHHCuH023070; Tue, 16 Oct 2018 17:17:12 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GHHC36023069; Tue, 16 Oct 2018 17:17:12 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810161717.w9GHHC36023069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 16 Oct 2018 17:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339385 - head/contrib/mandoc X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/contrib/mandoc X-SVN-Commit-Revision: 339385 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.27 Precedence: list List-Id: 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, 16 Oct 2018 17:17:12 -0000 Author: yuripv Date: Tue Oct 16 17:17:11 2018 New Revision: 339385 URL: https://svnweb.freebsd.org/changeset/base/339385 Log: apropos/whatis: use output of manpath(1) to set defpaths if -M is not specified. This fixes searching the paths specified in /usr/local/etc/man.d/*.conf, as currently apropos/whatis from mandoc suite aren't aware about them. PR: 227922 Reviewed by: bapt Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17454 Modified: head/contrib/mandoc/main.c Modified: head/contrib/mandoc/main.c ============================================================================== --- head/contrib/mandoc/main.c Tue Oct 16 17:00:42 2018 (r339384) +++ head/contrib/mandoc/main.c Tue Oct 16 17:17:11 2018 (r339385) @@ -248,7 +248,13 @@ main(int argc, char *argv[]) outmode = OUTMODE_ALL; break; case 'M': +#ifdef __FreeBSD__ + defpaths = strdup(optarg); + if (defpaths == NULL) + err(1, "strdup"); +#else defpaths = optarg; +#endif break; case 'm': auxpaths = optarg; @@ -380,9 +386,34 @@ main(int argc, char *argv[]) outmode == OUTMODE_ONE) search.firstmatch = 1; +#ifdef __FreeBSD__ + /* + * Use manpath(1) to populate defpaths if -M is not specified. + * Don't treat any failures as fatal. + */ + if (defpaths == NULL) { + FILE *fp; + size_t linecap = 0; + ssize_t linelen; + + if ((fp = popen("/usr/bin/manpath -q", "r")) != NULL) { + if ((linelen = getline(&defpaths, + &linecap, fp)) > 0) { + /* Strip trailing newline */ + defpaths[linelen - 1] = '\0'; + } + pclose(fp); + } + } +#endif + /* Access the mandoc database. */ manconf_parse(&conf, conf_file, defpaths, auxpaths); +#ifdef __FreeBSD__ + free(defpaths); +#endif + if ( ! mansearch(&search, &conf.manpath, argc, argv, &res, &sz)) usage(search.argmode); From owner-svn-src-head@freebsd.org Tue Oct 16 17:28:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7FB10DB5B9; Tue, 16 Oct 2018 17:28:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE1676E0C; Tue, 16 Oct 2018 17:28:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AB891FA48; Tue, 16 Oct 2018 17:28:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GHSBN5028001; Tue, 16 Oct 2018 17:28:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GHSBqV027998; Tue, 16 Oct 2018 17:28:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810161728.w9GHSBqV027998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Oct 2018 17:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339386 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 339386 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.27 Precedence: list List-Id: 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, 16 Oct 2018 17:28:12 -0000 Author: kib Date: Tue Oct 16 17:28:10 2018 New Revision: 339386 URL: https://svnweb.freebsd.org/changeset/base/339386 Log: Provide pmap_large_map() KPI on amd64. The KPI allows to map very large contigous physical memory regions into KVA, which are not covered by DMAP. I see both with QEMU and with some real hardware started shipping, the regions for NVDIMMs might be very far apart from the normal RAM, and we expect that at least initial users of NVDIMM could install very large amount of such memory. IMO it is not reasonable to extend DMAP to cover that far-away regions both because it could overflow existing 4T window for DMAP in KVA, and because it costs in page table pages allocations, for gap and for possibly unused NV RAM. Also, KPI provides some special functionality for fast cache flushing based on the knowledge of the NVRAM mapping use. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17070 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/include/vmparam.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Oct 16 17:17:11 2018 (r339385) +++ head/sys/amd64/amd64/pmap.c Tue Oct 16 17:28:10 2018 (r339386) @@ -409,6 +409,9 @@ static struct mtx qframe_mtx; static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ +static vmem_t *large_vmem; +static u_int lm_ents; + int pmap_pcid_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); @@ -655,6 +658,7 @@ static void pmap_invalidate_cache_range_all(vm_offset_ static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, pd_entry_t pde); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); +static vm_page_t pmap_large_map_getptp_unlocked(void); static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); #if VM_NRESERVLEVEL > 0 static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, @@ -1313,7 +1317,7 @@ void pmap_init(void) { struct pmap_preinit_mapping *ppim; - vm_page_t mpte; + vm_page_t m, mpte; vm_size_t s; int error, i, pv_npg, ret, skz63; @@ -1440,6 +1444,28 @@ pmap_init(void) (vmem_addr_t *)&qframe); if (error != 0) panic("qframe allocation failed"); + + lm_ents = 8; + TUNABLE_INT_FETCH("vm.pmap.large_map_pml4_entries", &lm_ents); + if (lm_ents > LMEPML4I - LMSPML4I + 1) + lm_ents = LMEPML4I - LMSPML4I + 1; + if (bootverbose) + printf("pmap: large map %u PML4 slots (%lu Gb)\n", + lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024)); + if (lm_ents != 0) { + large_vmem = vmem_create("large", LARGEMAP_MIN_ADDRESS, + (vmem_size_t)lm_ents * NBPML4, PAGE_SIZE, 0, M_WAITOK); + if (large_vmem == NULL) { + printf("pmap: cannot create large map\n"); + lm_ents = 0; + } + for (i = 0; i < lm_ents; i++) { + m = pmap_large_map_getptp_unlocked(); + kernel_pmap->pm_pml4[LMSPML4I + i] = X86_PG_V | + X86_PG_RW | X86_PG_A | X86_PG_M | pg_nx | + VM_PAGE_TO_PHYS(m); + } + } } static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, @@ -2315,14 +2341,6 @@ pmap_force_invalidate_cache_range(vm_offset_t sva, vm_ { sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); - if (eva - sva >= PMAP_CLFLUSH_THRESHOLD) { - /* - * The supplied range is bigger than 2MB. - * Globally invalidate cache. - */ - pmap_invalidate_cache(); - return; - } /* * XXX: Some CPUs fault, hang, or trash the local APIC @@ -2406,6 +2424,64 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int coun } } +void +pmap_flush_cache_range(vm_offset_t sva, vm_offset_t eva) +{ + + pmap_invalidate_cache_range_check_align(sva, eva); + + if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) == 0) { + pmap_force_invalidate_cache_range(sva, eva); + return; + } + + /* See comment in pmap_force_invalidate_cache_range(). */ + if (pmap_kextract(sva) == lapic_paddr) + return; + + sfence(); + for (; sva < eva; sva += cpu_clflush_line_size) + clwb(sva); + sfence(); +} + +void +pmap_flush_cache_phys_range(vm_paddr_t spa, vm_paddr_t epa, vm_memattr_t mattr) +{ + pt_entry_t *pte; + vm_offset_t vaddr; + int error, pte_bits; + + KASSERT((spa & PAGE_MASK) == 0, + ("pmap_flush_cache_phys_range: spa not page-aligned")); + KASSERT((epa & PAGE_MASK) == 0, + ("pmap_flush_cache_phys_range: epa not page-aligned")); + + if (spa < dmaplimit) { + pmap_flush_cache_range(PHYS_TO_DMAP(spa), PHYS_TO_DMAP(MIN( + dmaplimit, epa))); + if (dmaplimit >= epa) + return; + spa = dmaplimit; + } + + pte_bits = pmap_cache_bits(kernel_pmap, mattr, 0) | X86_PG_RW | + X86_PG_V; + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, + &vaddr); + KASSERT(error == 0, ("vmem_alloc failed: %d", error)); + pte = vtopte(vaddr); + for (; spa < epa; spa += PAGE_SIZE) { + sched_pin(); + pte_store(pte, spa | pte_bits); + invlpg(vaddr); + /* XXXKIB sfences inside flush_cache_range are excessive */ + pmap_flush_cache_range(vaddr, vaddr + PAGE_SIZE); + sched_unpin(); + } + vmem_free(kernel_arena, vaddr, PAGE_SIZE); +} + /* * Routine: pmap_extract * Function: @@ -2812,6 +2888,10 @@ pmap_pinit_pml4(vm_page_t pml4pg) /* install self-referential address mapping entry(s) */ pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; + + /* install large map entries if configured */ + for (i = 0; i < lm_ents; i++) + pm_pml4[LMSPML4I + i] = kernel_pmap->pm_pml4[LMSPML4I + i]; } static void @@ -3158,6 +3238,8 @@ pmap_release(pmap_t pmap) for (i = 0; i < ndmpdpphys; i++)/* Direct Map */ pmap->pm_pml4[DMPML4I + i] = 0; pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ + for (i = 0; i < lm_ents; i++) /* Large Map */ + pmap->pm_pml4[LMSPML4I + i] = 0; vm_page_unwire_noq(m); vm_page_free_zero(m); @@ -8099,6 +8181,477 @@ pmap_quick_remove_page(vm_offset_t addr) pte_store(vtopte(qframe), 0); invlpg(qframe); mtx_unlock_spin(&qframe_mtx); +} + +/* + * Pdp pages from the large map are managed differently from either + * kernel or user page table pages. They are permanently allocated at + * initialization time, and their wire count is permanently set to + * zero. The pml4 entries pointing to those pages are copied into + * each allocated pmap. + * + * In contrast, pd and pt pages are managed like user page table + * pages. They are dynamically allocated, and their wire count + * represents the number of valid entries within the page. + */ +static vm_page_t +pmap_large_map_getptp_unlocked(void) +{ + vm_page_t m; + + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_ZERO); + if (m != NULL && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + return (m); +} + +static vm_page_t +pmap_large_map_getptp(void) +{ + vm_page_t m; + + PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); + m = pmap_large_map_getptp_unlocked(); + if (m == NULL) { + PMAP_UNLOCK(kernel_pmap); + vm_wait(NULL); + PMAP_LOCK(kernel_pmap); + /* Callers retry. */ + } + return (m); +} + +static pdp_entry_t * +pmap_large_map_pdpe(vm_offset_t va) +{ + vm_pindex_t pml4_idx; + vm_paddr_t mphys; + + pml4_idx = pmap_pml4e_index(va); + KASSERT(LMSPML4I <= pml4_idx && pml4_idx < LMSPML4I + lm_ents, + ("pmap_large_map_pdpe: va %#jx out of range idx %#jx LMSPML4I " + "%#jx lm_ents %d", + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); + KASSERT((kernel_pmap->pm_pml4[pml4_idx] & X86_PG_V) != 0, + ("pmap_large_map_pdpe: invalid pml4 for va %#jx idx %#jx " + "LMSPML4I %#jx lm_ents %d", + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); + mphys = kernel_pmap->pm_pml4[pml4_idx] & PG_FRAME; + return ((pdp_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pdpe_index(va)); +} + +static pd_entry_t * +pmap_large_map_pde(vm_offset_t va) +{ + pdp_entry_t *pdpe; + vm_page_t m; + vm_paddr_t mphys; + +retry: + pdpe = pmap_large_map_pdpe(va); + if (*pdpe == 0) { + m = pmap_large_map_getptp(); + if (m == NULL) + goto retry; + mphys = VM_PAGE_TO_PHYS(m); + *pdpe = mphys | X86_PG_A | X86_PG_RW | X86_PG_V | pg_nx; + } else { + MPASS((*pdpe & X86_PG_PS) == 0); + mphys = *pdpe & PG_FRAME; + } + return ((pd_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pde_index(va)); +} + +static pt_entry_t * +pmap_large_map_pte(vm_offset_t va) +{ + pd_entry_t *pde; + vm_page_t m; + vm_paddr_t mphys; + +retry: + pde = pmap_large_map_pde(va); + if (*pde == 0) { + m = pmap_large_map_getptp(); + if (m == NULL) + goto retry; + mphys = VM_PAGE_TO_PHYS(m); + *pde = mphys | X86_PG_A | X86_PG_RW | X86_PG_V | pg_nx; + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))->wire_count++; + } else { + MPASS((*pde & X86_PG_PS) == 0); + mphys = *pde & PG_FRAME; + } + return ((pt_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pte_index(va)); +} + +static int +pmap_large_map_getva(vm_size_t len, vm_offset_t align, vm_offset_t phase, + vmem_addr_t *vmem_res) +{ + + /* + * Large mappings are all but static. Consequently, there + * is no point in waiting for an earlier allocation to be + * freed. + */ + return (vmem_xalloc(large_vmem, len, align, phase, 0, VMEM_ADDR_MIN, + VMEM_ADDR_MAX, M_NOWAIT | M_BESTFIT, vmem_res)); +} + +int +pmap_large_map(vm_paddr_t spa, vm_size_t len, void **addr, + vm_memattr_t mattr) +{ + pdp_entry_t *pdpe; + pd_entry_t *pde; + pt_entry_t *pte; + vm_offset_t va, inc; + vmem_addr_t vmem_res; + vm_paddr_t pa; + int error; + + if (len == 0 || spa + len < spa) + return (EINVAL); + + /* See if DMAP can serve. */ + if (spa + len <= dmaplimit) { + va = PHYS_TO_DMAP(spa); + *addr = (void *)va; + return (pmap_change_attr(va, len, mattr)); + } + + /* + * No, allocate KVA. Fit the address with best possible + * alignment for superpages. Fall back to worse align if + * failed. + */ + error = ENOMEM; + if ((amd_feature & AMDID_PAGE1GB) != 0 && rounddown2(spa + len, + NBPDP) >= roundup2(spa, NBPDP) + NBPDP) + error = pmap_large_map_getva(len, NBPDP, spa & PDPMASK, + &vmem_res); + if (error != 0 && rounddown2(spa + len, NBPDR) >= roundup2(spa, + NBPDR) + NBPDR) + error = pmap_large_map_getva(len, NBPDR, spa & PDRMASK, + &vmem_res); + if (error != 0) + error = pmap_large_map_getva(len, PAGE_SIZE, 0, &vmem_res); + if (error != 0) + return (error); + + /* + * Fill pagetable. PG_M is not pre-set, we scan modified bits + * in the pagetable to minimize flushing. No need to + * invalidate TLB, since we only update invalid entries. + */ + PMAP_LOCK(kernel_pmap); + for (pa = spa, va = vmem_res; len > 0; pa += inc, va += inc, + len -= inc) { + if ((amd_feature & AMDID_PAGE1GB) != 0 && len >= NBPDP && + (pa & PDPMASK) == 0 && (va & PDPMASK) == 0) { + pdpe = pmap_large_map_pdpe(va); + MPASS(*pdpe == 0); + *pdpe = pa | pg_g | X86_PG_PS | X86_PG_RW | + X86_PG_V | X86_PG_A | pg_nx | + pmap_cache_bits(kernel_pmap, mattr, TRUE); + inc = NBPDP; + } else if (len >= NBPDR && (pa & PDRMASK) == 0 && + (va & PDRMASK) == 0) { + pde = pmap_large_map_pde(va); + MPASS(*pde == 0); + *pde = pa | pg_g | X86_PG_PS | X86_PG_RW | + X86_PG_V | X86_PG_A | pg_nx | + pmap_cache_bits(kernel_pmap, mattr, TRUE); + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))-> + wire_count++; + inc = NBPDR; + } else { + pte = pmap_large_map_pte(va); + MPASS(*pte == 0); + *pte = pa | pg_g | X86_PG_RW | X86_PG_V | + X86_PG_A | pg_nx | pmap_cache_bits(kernel_pmap, + mattr, FALSE); + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte))-> + wire_count++; + inc = PAGE_SIZE; + } + } + PMAP_UNLOCK(kernel_pmap); + MPASS(len == 0); + + *addr = (void *)vmem_res; + return (0); +} + +void +pmap_large_unmap(void *svaa, vm_size_t len) +{ + vm_offset_t sva, va; + vm_size_t inc; + pdp_entry_t *pdpe, pdp; + pd_entry_t *pde, pd; + pt_entry_t *pte; + vm_page_t m; + struct spglist spgf; + + sva = (vm_offset_t)svaa; + if (len == 0 || sva + len < sva || (sva >= DMAP_MIN_ADDRESS && + sva + len <= DMAP_MIN_ADDRESS + dmaplimit)) + return; + + SLIST_INIT(&spgf); + KASSERT(LARGEMAP_MIN_ADDRESS <= sva && sva + len <= + LARGEMAP_MAX_ADDRESS + NBPML4 * (u_long)lm_ents, + ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len)); + PMAP_LOCK(kernel_pmap); + for (va = sva; va < sva + len; va += inc) { + pdpe = pmap_large_map_pdpe(va); + pdp = *pdpe; + KASSERT((pdp & X86_PG_V) != 0, + ("invalid pdp va %#lx pdpe %#lx pdp %#lx", va, + (u_long)pdpe, pdp)); + if ((pdp & X86_PG_PS) != 0) { + KASSERT((amd_feature & AMDID_PAGE1GB) != 0, + ("no 1G pages, va %#lx pdpe %#lx pdp %#lx", va, + (u_long)pdpe, pdp)); + KASSERT((va & PDPMASK) == 0, + ("PDPMASK bit set, va %#lx pdpe %#lx pdp %#lx", va, + (u_long)pdpe, pdp)); + KASSERT(len <= NBPDP, + ("len < NBPDP, sva %#lx va %#lx pdpe %#lx pdp %#lx " + "len %#lx", sva, va, (u_long)pdpe, pdp, len)); + *pdpe = 0; + inc = NBPDP; + continue; + } + pde = pmap_pdpe_to_pde(pdpe, va); + pd = *pde; + KASSERT((pd & X86_PG_V) != 0, + ("invalid pd va %#lx pde %#lx pd %#lx", va, + (u_long)pde, pd)); + if ((pd & X86_PG_PS) != 0) { + KASSERT((va & PDRMASK) == 0, + ("PDRMASK bit set, va %#lx pde %#lx pd %#lx", va, + (u_long)pde, pd)); + KASSERT(len <= NBPDR, + ("len < NBPDR, sva %#lx va %#lx pde %#lx pd %#lx " + "len %#lx", sva, va, (u_long)pde, pd, len)); + pde_store(pde, 0); + inc = NBPDR; + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); + m->wire_count--; + if (m->wire_count == 0) { + *pdpe = 0; + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); + } + continue; + } + pte = pmap_pde_to_pte(pde, va); + KASSERT((*pte & X86_PG_V) != 0, + ("invalid pte va %#lx pte %#lx pt %#lx", va, + (u_long)pte, *pte)); + pte_clear(pte); + inc = PAGE_SIZE; + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pte)); + m->wire_count--; + if (m->wire_count == 0) { + *pde = 0; + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); + m->wire_count--; + if (m->wire_count == 0) { + *pdpe = 0; + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); + } + } + } + pmap_invalidate_range(kernel_pmap, sva, sva + len); + PMAP_UNLOCK(kernel_pmap); + vm_page_free_pages_toq(&spgf, false); + vmem_free(large_vmem, sva, len); +} + +static void +pmap_large_map_wb_fence_mfence(void) +{ + + mfence(); +} + +static void +pmap_large_map_wb_fence_sfence(void) +{ + + sfence(); +} + +static void +pmap_large_map_wb_fence_nop(void) +{ +} + +DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void), static) +{ + + if (cpu_vendor_id != CPU_VENDOR_INTEL) + return (pmap_large_map_wb_fence_mfence); + else if ((cpu_stdext_feature & (CPUID_STDEXT_CLWB | + CPUID_STDEXT_CLFLUSHOPT)) == 0) + return (pmap_large_map_wb_fence_sfence); + else + /* clflush is strongly enough ordered */ + return (pmap_large_map_wb_fence_nop); +} + +static void +pmap_large_map_flush_range_clwb(vm_offset_t va, vm_size_t len) +{ + + for (; len > 0; len -= cpu_clflush_line_size, + va += cpu_clflush_line_size) + clwb(va); +} + +static void +pmap_large_map_flush_range_clflushopt(vm_offset_t va, vm_size_t len) +{ + + for (; len > 0; len -= cpu_clflush_line_size, + va += cpu_clflush_line_size) + clflushopt(va); +} + +static void +pmap_large_map_flush_range_clflush(vm_offset_t va, vm_size_t len) +{ + + for (; len > 0; len -= cpu_clflush_line_size, + va += cpu_clflush_line_size) + clflush(va); +} + +static void +pmap_large_map_flush_range_nop(vm_offset_t sva __unused, vm_size_t len __unused) +{ +} + +DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, vm_size_t), + static) +{ + + if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) != 0) + return (pmap_large_map_flush_range_clwb); + else if ((cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0) + return (pmap_large_map_flush_range_clflushopt); + else if ((cpu_feature & CPUID_CLFSH) != 0) + return (pmap_large_map_flush_range_clflush); + else + return (pmap_large_map_flush_range_nop); +} + +static void +pmap_large_map_wb_large(vm_offset_t sva, vm_offset_t eva) +{ + volatile u_long *pe; + u_long p; + vm_offset_t va; + vm_size_t inc; + bool seen_other; + + for (va = sva; va < eva; va += inc) { + inc = 0; + if ((amd_feature & AMDID_PAGE1GB) != 0) { + pe = (volatile u_long *)pmap_large_map_pdpe(va); + p = *pe; + if ((p & X86_PG_PS) != 0) + inc = NBPDP; + } + if (inc == 0) { + pe = (volatile u_long *)pmap_large_map_pde(va); + p = *pe; + if ((p & X86_PG_PS) != 0) + inc = NBPDR; + } + if (inc == 0) { + pe = (volatile u_long *)pmap_large_map_pte(va); + p = *pe; + inc = PAGE_SIZE; + } + seen_other = false; + for (;;) { + if ((p & X86_PG_AVAIL1) != 0) { + /* + * Spin-wait for the end of a parallel + * write-back. + */ + cpu_spinwait(); + p = *pe; + + /* + * If we saw other write-back + * occuring, we cannot rely on PG_M to + * indicate state of the cache. The + * PG_M bit is cleared before the + * flush to avoid ignoring new writes, + * and writes which are relevant for + * us might happen after. + */ + seen_other = true; + continue; + } + + if ((p & X86_PG_M) != 0 || seen_other) { + if (!atomic_fcmpset_long(pe, &p, + (p & ~X86_PG_M) | X86_PG_AVAIL1)) + /* + * If we saw PG_M without + * PG_AVAIL1, and then on the + * next attempt we do not + * observe either PG_M or + * PG_AVAIL1, the other + * write-back started after us + * and finished before us. We + * can rely on it doing our + * work. + */ + continue; + pmap_large_map_flush_range(va, inc); + atomic_clear_long(pe, X86_PG_AVAIL1); + } + break; + } + maybe_yield(); + } +} + +/* + * Write-back cache lines for the given address range. + * + * Must be called only on the range or sub-range returned from + * pmap_large_map(). Must not be called on the coalesced ranges. + * + * Does nothing on CPUs without CLWB, CLFLUSHOPT, or CLFLUSH + * instructions support. + */ +void +pmap_large_map_wb(void *svap, vm_size_t len) +{ + vm_offset_t eva, sva; + + sva = (vm_offset_t)svap; + eva = sva + len; + pmap_large_map_wb_fence(); + if (sva >= DMAP_MIN_ADDRESS && eva <= DMAP_MIN_ADDRESS + dmaplimit) { + pmap_large_map_flush_range(sva, len); + } else { + KASSERT(sva >= LARGEMAP_MIN_ADDRESS && + eva <= LARGEMAP_MIN_ADDRESS + lm_ents * NBPML4, + ("pmap_large_map_wb: not largemap %#lx %#lx", sva, len)); + pmap_large_map_wb_large(sva, eva); + } + pmap_large_map_wb_fence(); } static vm_page_t Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Tue Oct 16 17:17:11 2018 (r339385) +++ head/sys/amd64/include/pmap.h Tue Oct 16 17:28:10 2018 (r339386) @@ -216,6 +216,10 @@ #define KPML4I (NPML4EPG-1) #define KPDPI (NPDPEPG-2) /* kernbase at -2GB */ +/* Large map: index of the first and max last pml4 entry */ +#define LMSPML4I (PML4PML4I + 1) +#define LMEPML4I (DMPML4I - 1) + /* * XXX doesn't really belong here I guess... */ @@ -413,11 +417,16 @@ void pmap_bootstrap(vm_paddr_t *); int pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde); int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate); +void pmap_flush_cache_range(vm_offset_t, vm_offset_t); +void pmap_flush_cache_phys_range(vm_paddr_t, vm_paddr_t, vm_memattr_t); void pmap_init_pat(void); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void *pmap_kenter_temporary(vm_paddr_t pa, int i); vm_paddr_t pmap_kextract(vm_offset_t); void pmap_kremove(vm_offset_t); +int pmap_large_map(vm_paddr_t, vm_size_t, void **, vm_memattr_t); +void pmap_large_map_wb(void *sva, vm_size_t len); +void pmap_large_unmap(void *sva, vm_size_t len); void *pmap_mapbios(vm_paddr_t, vm_size_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Tue Oct 16 17:17:11 2018 (r339385) +++ head/sys/amd64/include/vmparam.h Tue Oct 16 17:28:10 2018 (r339386) @@ -156,7 +156,9 @@ * 0x0000000000000000 - 0x00007fffffffffff user map * 0x0000800000000000 - 0xffff7fffffffffff does not exist (hole) * 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB slot) - * 0xffff804020101000 - 0xfffff7ffffffffff unused + * 0xffff804020100fff - 0xffff807fffffffff unused + * 0xffff808000000000 - 0xffff847fffffffff large map (can be tuned up) + * 0xffff848000000000 - 0xfffff7ffffffffff unused (large map extends there) * 0xfffff80000000000 - 0xfffffbffffffffff 4TB direct map * 0xfffffc0000000000 - 0xfffffdffffffffff unused * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map @@ -172,6 +174,9 @@ #define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0) #define DMAP_MAX_ADDRESS KVADDR(DMPML4I + NDMPML4E, 0, 0, 0) + +#define LARGEMAP_MIN_ADDRESS KVADDR(LMSPML4I, 0, 0, 0) +#define LARGEMAP_MAX_ADDRESS KVADDR(LMEPML4I + 1, 0, 0, 0) #define KERNBASE KVADDR(KPML4I, KPDPI, 0, 0) From owner-svn-src-head@freebsd.org Tue Oct 16 18:17:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C01B10DCBCE; Tue, 16 Oct 2018 18:17:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D374F78DEA; Tue, 16 Oct 2018 18:17:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE6FF202C9; Tue, 16 Oct 2018 18:17:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GIH7nI053083; Tue, 16 Oct 2018 18:17:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GIH77p053082; Tue, 16 Oct 2018 18:17:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201810161817.w9GIH77p053082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 16 Oct 2018 18:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339387 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 339387 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.27 Precedence: list List-Id: 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, 16 Oct 2018 18:17:08 -0000 Author: trasz Date: Tue Oct 16 18:17:07 2018 New Revision: 339387 URL: https://svnweb.freebsd.org/changeset/base/339387 Log: Get rid unneccessary useless calls to lseek(2) from getgrent(3). Looks like this: fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r-- ,inode=2167001,size=390,blksize=32768 },0x0) = 0 (0x0) open("/etc/group",O_RDONLY|O_CLOEXEC,0666) = 3 (0x3) fstat(3,{ mode=-rw-r--r-- ,inode=2166927,size=919,blksize=32768 }) = 0 (0x0) -lseek(3,0x0,SEEK_CUR) = 0 (0x0) -lseek(3,0x0,SEEK_SET) = 0 (0x0) read(3,"# $FreeBSD: release/10.0.0/etc/g"...,32768) = 919 (0x397) close(3) = 0 (0x0) Reviewed by: kib Approved by: re (gjb) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17571 Modified: head/lib/libc/gen/getgrent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Tue Oct 16 17:28:10 2018 (r339386) +++ head/lib/libc/gen/getgrent.c Tue Oct 16 18:17:07 2018 (r339387) @@ -836,8 +836,9 @@ files_group(void *retval, void *mdata, va_list ap) char *buffer; size_t bufsize, linesize; off_t pos; - int rv, stayopen, *errnop; + int fresh, rv, stayopen, *errnop; + fresh = 0; name = NULL; gid = (gid_t)-1; how = (enum nss_lookup_type)mdata; @@ -860,19 +861,24 @@ files_group(void *retval, void *mdata, va_list ap) *errnop = files_getstate(&st); if (*errnop != 0) return (NS_UNAVAIL); - if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { - *errnop = errno; - return (NS_UNAVAIL); + if (st->fp == NULL) { + st->fp = fopen(_PATH_GROUP, "re"); + if (st->fp == NULL) { + *errnop = errno; + return (NS_UNAVAIL); + } + fresh = 1; } if (how == nss_lt_all) stayopen = 1; else { - rewind(st->fp); + if (!fresh) + rewind(st->fp); stayopen = st->stayopen; } rv = NS_NOTFOUND; - pos = ftello(st->fp); + if (stayopen) + pos = ftello(st->fp); while ((line = fgetln(st->fp, &linesize)) != NULL) { if (line[linesize-1] == '\n') linesize--; @@ -894,7 +900,8 @@ files_group(void *retval, void *mdata, va_list ap) &buffer[linesize + 1], bufsize - linesize - 1, errnop); if (rv & NS_TERMINATE) break; - pos = ftello(st->fp); + if (stayopen) + pos = ftello(st->fp); } if (st->fp != NULL && !stayopen) { fclose(st->fp); @@ -1304,7 +1311,7 @@ compat_group(void *retval, void *mdata, va_list ap) void *discard; size_t bufsize, linesize; off_t pos; - int rv, stayopen, *errnop; + int fresh, rv, stayopen, *errnop; #define set_lookup_type(x, y) do { \ int i; \ @@ -1312,6 +1319,7 @@ compat_group(void *retval, void *mdata, va_list ap) x[i].mdata = (void *)y; \ } while (0) + fresh = 0; name = NULL; gid = (gid_t)-1; how = (enum nss_lookup_type)mdata; @@ -1334,16 +1342,20 @@ compat_group(void *retval, void *mdata, va_list ap) *errnop = compat_getstate(&st); if (*errnop != 0) return (NS_UNAVAIL); - if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { - *errnop = errno; - rv = NS_UNAVAIL; - goto fin; + if (st->fp == NULL) { + st->fp = fopen(_PATH_GROUP, "re"); + if (st->fp == NULL) { + *errnop = errno; + rv = NS_UNAVAIL; + goto fin; + } + fresh = 1; } if (how == nss_lt_all) stayopen = 1; else { - rewind(st->fp); + if (!fresh) + rewind(st->fp); stayopen = st->stayopen; } docompat: @@ -1406,7 +1418,8 @@ docompat: break; } rv = NS_NOTFOUND; - pos = ftello(st->fp); + if (stayopen) + pos = ftello(st->fp); while ((line = fgetln(st->fp, &linesize)) != NULL) { if (line[linesize-1] == '\n') linesize--; @@ -1447,7 +1460,8 @@ docompat: &buffer[linesize + 1], bufsize - linesize - 1, errnop); if (rv & NS_TERMINATE) break; - pos = ftello(st->fp); + if (stayopen) + pos = ftello(st->fp); } fin: if (st->fp != NULL && !stayopen) { From owner-svn-src-head@freebsd.org Tue Oct 16 18:47:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C677F10DD87B; Tue, 16 Oct 2018 18:47: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75BD179D82; Tue, 16 Oct 2018 18:47: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 70935207C8; Tue, 16 Oct 2018 18:47: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 w9GIlD0P068442; Tue, 16 Oct 2018 18:47:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GIlD7k068441; Tue, 16 Oct 2018 18:47:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810161847.w9GIlD7k068441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 16 Oct 2018 18:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339388 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 339388 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.27 Precedence: list List-Id: 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, 16 Oct 2018 18:47:14 -0000 Author: hselasky Date: Tue Oct 16 18:47:13 2018 New Revision: 339388 URL: https://svnweb.freebsd.org/changeset/base/339388 Log: Fix for reception of large full speed isochronous frames via the transaction translator, when using the DWC OTG USB controller driver. Make sure to re-try getting the complete split packets until a DATA0 packet is received. Larger isochronous frames may be split into multiple MDATA packets terminated by a single DATA0 packet. PR: 230434 MFC after: 3 days Approved by: re (gjb) Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Tue Oct 16 18:17:07 2018 (r339387) +++ head/sys/dev/usb/controller/dwc_otg.c Tue Oct 16 18:47:13 2018 (r339388) @@ -1458,6 +1458,8 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct /* check if we are complete */ if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) { goto complete; + } else if (td->hcsplt != 0) { + goto receive_pkt; } else { /* get more packets */ goto busy; @@ -1516,8 +1518,10 @@ receive_pkt: if (td->hcsplt != 0) { delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { - td->state = DWC_CHAN_ST_WAIT_C_PKT; - goto busy; + if (td->ep_type != UE_ISOCHRONOUS) { + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto busy; + } } delta = sc->sc_last_frame_num - td->tt_start_slot; if (delta > DWC_OTG_TT_SLOT_MAX) { @@ -1563,12 +1567,23 @@ receive_pkt: hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; - /* receive complete split ASAP */ - if ((sc->sc_last_frame_num & 1) != 0 && - td->ep_type == UE_ISOCHRONOUS) - hcchar |= HCCHAR_ODDFRM; - else + if (td->ep_type == UE_ISOCHRONOUS) { + if (td->hcsplt != 0) { + /* continously buffer */ + if (sc->sc_last_frame_num & 1) + hcchar &= ~HCCHAR_ODDFRM; + else + hcchar |= HCCHAR_ODDFRM; + } else { + /* multi buffer, if any */ + if (sc->sc_last_frame_num & 1) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; + } + } else { hcchar &= ~HCCHAR_ODDFRM; + } /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); From owner-svn-src-head@freebsd.org Tue Oct 16 20:06:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55AB610E07AC; Tue, 16 Oct 2018 20:06:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B91B7E06B; Tue, 16 Oct 2018 20:06:57 +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 0695421561; Tue, 16 Oct 2018 20:06:57 +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 w9GK6ubh011818; Tue, 16 Oct 2018 20:06:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GK6uTH011816; Tue, 16 Oct 2018 20:06:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810162006.w9GK6uTH011816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Oct 2018 20:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339390 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 339390 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.27 Precedence: list List-Id: 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, 16 Oct 2018 20:06:57 -0000 Author: markj Date: Tue Oct 16 20:06:56 2018 New Revision: 339390 URL: https://svnweb.freebsd.org/changeset/base/339390 Log: Reparent a child of pdfork(2) to its reaper when the procdesc is closed. Unconditionally reparenting to PID 1 breaks the procctl(2) reaper functionality. Add a regression test for this case. Reviewed by: kib Approved by: re (gjb) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17589 Modified: head/sys/kern/sys_procdesc.c head/tests/sys/kern/reaper.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Tue Oct 16 19:26:04 2018 (r339389) +++ head/sys/kern/sys_procdesc.c Tue Oct 16 20:06:56 2018 (r339390) @@ -312,8 +312,8 @@ procdesc_exit(struct proc *p) pd = p->p_procdesc; PROCDESC_LOCK(pd); - KASSERT((pd->pd_flags & PDF_CLOSED) == 0 || p->p_pptr == initproc, - ("procdesc_exit: closed && parent not init")); + KASSERT((pd->pd_flags & PDF_CLOSED) == 0 || p->p_pptr == p->p_reaper, + ("procdesc_exit: closed && parent not reaper")); pd->pd_flags |= PDF_EXITED; pd->pd_xstat = KW_EXITCODE(p->p_xexit, p->p_xsig); @@ -361,7 +361,8 @@ procdesc_reap(struct proc *p) /* * procdesc_close() - last close on a process descriptor. If the process is * still running, terminate with SIGKILL (unless PDF_DAEMON is set) and let - * init(8) clean up the mess; if not, we have to clean up the zombie ourselves. + * its reaper clean up the mess; if not, we have to clean up the zombie + * ourselves. */ static int procdesc_close(struct file *fp, struct thread *td) @@ -410,12 +411,12 @@ procdesc_close(struct file *fp, struct thread *td) procdesc_free(pd); /* - * Next, reparent it to init(8) so that there's someone - * to pick up the pieces; finally, terminate with - * prejudice. + * Next, reparent it to its reaper (usually init(8)) so + * that there's someone to pick up the pieces; finally, + * terminate with prejudice. */ p->p_sigparent = SIGCHLD; - proc_reparent(p, initproc); + proc_reparent(p, p->p_reaper); if ((pd->pd_flags & PDF_DAEMON) == 0) kern_psignal(p, SIGKILL); PROC_UNLOCK(p); Modified: head/tests/sys/kern/reaper.c ============================================================================== --- head/tests/sys/kern/reaper.c Tue Oct 16 19:26:04 2018 (r339389) +++ head/tests/sys/kern/reaper.c Tue Oct 16 20:06:56 2018 (r339390) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -740,6 +741,40 @@ ATF_TC_BODY(reaper_kill_subtree, tc) ATF_REQUIRE_EQ(0, r); } +ATF_TC_WITHOUT_HEAD(reaper_pdfork); +ATF_TC_BODY(reaper_pdfork, tc) +{ + struct procctl_reaper_status st; + pid_t child, grandchild, parent, pid; + int pd, r, status; + + parent = getpid(); + r = procctl(P_PID, parent, PROC_REAP_ACQUIRE, NULL); + ATF_REQUIRE_EQ(r, 0); + + child = pdfork(&pd, 0); + ATF_REQUIRE(child != -1); + if (child == 0) { + grandchild = pdfork(&pd, 0); + if (grandchild == -1) + _exit(1); + if (grandchild == 0) + pause(); + _exit(0); + } + pid = waitpid(child, &status, 0); + ATF_REQUIRE_EQ(pid, child); + r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; + ATF_REQUIRE_EQ(r, 0); + + r = procctl(P_PID, parent, PROC_REAP_STATUS, &st); + ATF_REQUIRE_EQ(r, 0); + ATF_CHECK((st.rs_flags & REAPER_STATUS_OWNED) != 0); + ATF_CHECK(st.rs_reaper == parent); + ATF_CHECK(st.rs_children == 1); + ATF_CHECK(st.rs_descendants == 1); +} + ATF_TP_ADD_TCS(tp) { @@ -754,5 +789,6 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, reaper_kill_empty); ATF_TP_ADD_TC(tp, reaper_kill_normal); ATF_TP_ADD_TC(tp, reaper_kill_subtree); + ATF_TP_ADD_TC(tp, reaper_pdfork); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue Oct 16 20:12:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9856210E0C3D; Tue, 16 Oct 2018 20:12: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0687E72D; Tue, 16 Oct 2018 20:12: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 48C6721701; Tue, 16 Oct 2018 20:12:36 +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 w9GKCaOF016862; Tue, 16 Oct 2018 20:12:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GKCaWb016859; Tue, 16 Oct 2018 20:12:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810162012.w9GKCaWb016859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Oct 2018 20:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339391 - in head/sys: dev/nvdimm modules modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules modules/nvdimm X-SVN-Commit-Revision: 339391 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.27 Precedence: list List-Id: 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, 16 Oct 2018 20:12:36 -0000 Author: kib Date: Tue Oct 16 20:12:35 2018 New Revision: 339391 URL: https://svnweb.freebsd.org/changeset/base/339391 Log: Add initial driver for ACPI NFIT-enumerated NVDIMMs. Driver enumerates NVDIMMs. Besides, for each found System Physical Address (SPA) range, spaN geom provider is created, which allows formatting and mounting the region as the normal volume. Also, /dev/nvdimm_spaN node is created, which can be read/written/mapped by userspace, the mapping is zero-copy. No support for block access methods implemented, labels are not parsed. No management interfaces are provided. Tested by: Intel, NetApp Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 2 weeks Added: head/sys/dev/nvdimm/ head/sys/dev/nvdimm/nvdimm.c (contents, props changed) head/sys/dev/nvdimm/nvdimm_spa.c (contents, props changed) head/sys/dev/nvdimm/nvdimm_var.h (contents, props changed) head/sys/modules/nvdimm/ head/sys/modules/nvdimm/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Added: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm.c Tue Oct 16 20:12:35 2018 (r339391) @@ -0,0 +1,423 @@ +/*- + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define _COMPONENT ACPI_OEM +ACPI_MODULE_NAME("NVDIMM") + +static devclass_t nvdimm_devclass; +static device_t *nvdimm_devs; +static int nvdimm_devcnt; +MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); + +struct nvdimm_dev * +nvdimm_find_by_handle(nfit_handle_t nv_handle) +{ + device_t dev; + struct nvdimm_dev *res, *nv; + int i; + + res = NULL; + for (i = 0; i < nvdimm_devcnt; i++) { + dev = nvdimm_devs[i]; + if (dev == NULL) + continue; + nv = device_get_softc(dev); + if (nv->nv_handle == nv_handle) { + res = nv; + break; + } + } + return (res); +} + +static int +nvdimm_parse_flush_addr(void *nfitsubtbl, void *arg) +{ + ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr; + struct nvdimm_dev *nv; + int i; + + nfitflshaddr = nfitsubtbl; + nv = arg; + if (nfitflshaddr->DeviceHandle != nv->nv_handle) + return (0); + + MPASS(nv->nv_flush_addr == NULL && nv->nv_flush_addr_cnt == 0); + nv->nv_flush_addr = malloc(nfitflshaddr->HintCount * sizeof(uint64_t *), + M_NVDIMM, M_WAITOK); + for (i = 0; i < nfitflshaddr->HintCount; i++) + nv->nv_flush_addr[i] = (uint64_t *)nfitflshaddr->HintAddress[i]; + nv->nv_flush_addr_cnt = nfitflshaddr->HintCount; + return (0); +} + +int +nvdimm_iterate_nfit(ACPI_TABLE_NFIT *nfitbl, enum AcpiNfitType type, + int (*cb)(void *, void *), void *arg) +{ + ACPI_NFIT_HEADER *nfithdr; + ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; + ACPI_NFIT_MEMORY_MAP *nfitmap; + ACPI_NFIT_INTERLEAVE *nfitintrl; + ACPI_NFIT_SMBIOS *nfitsmbios; + ACPI_NFIT_CONTROL_REGION *nfitctlreg; + ACPI_NFIT_DATA_REGION *nfitdtreg; + ACPI_NFIT_FLUSH_ADDRESS *nfitflshaddr; + char *ptr; + int error; + + error = 0; + for (ptr = (char *)(nfitbl + 1); + ptr < (char *)nfitbl + nfitbl->Header.Length; + ptr += nfithdr->Length) { + nfithdr = (ACPI_NFIT_HEADER *)ptr; + if (nfithdr->Type != type) + continue; + switch (nfithdr->Type) { + case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: + nfitaddr = __containerof(nfithdr, + ACPI_NFIT_SYSTEM_ADDRESS, Header); + error = cb(nfitaddr, arg); + break; + case ACPI_NFIT_TYPE_MEMORY_MAP: + nfitmap = __containerof(nfithdr, + ACPI_NFIT_MEMORY_MAP, Header); + error = cb(nfitmap, arg); + break; + case ACPI_NFIT_TYPE_INTERLEAVE: + nfitintrl = __containerof(nfithdr, + ACPI_NFIT_INTERLEAVE, Header); + error = cb(nfitintrl, arg); + break; + case ACPI_NFIT_TYPE_SMBIOS: + nfitsmbios = __containerof(nfithdr, + ACPI_NFIT_SMBIOS, Header); + error = cb(nfitsmbios, arg); + break; + case ACPI_NFIT_TYPE_CONTROL_REGION: + nfitctlreg = __containerof(nfithdr, + ACPI_NFIT_CONTROL_REGION, Header); + error = cb(nfitctlreg, arg); + break; + case ACPI_NFIT_TYPE_DATA_REGION: + nfitdtreg = __containerof(nfithdr, + ACPI_NFIT_DATA_REGION, Header); + error = cb(nfitdtreg, arg); + break; + case ACPI_NFIT_TYPE_FLUSH_ADDRESS: + nfitflshaddr = __containerof(nfithdr, + ACPI_NFIT_FLUSH_ADDRESS, Header); + error = cb(nfitflshaddr, arg); + break; + case ACPI_NFIT_TYPE_RESERVED: + default: + if (bootverbose) + printf("NFIT subtype %d unknown\n", + nfithdr->Type); + error = 0; + break; + } + if (error != 0) + break; + } + return (error); +} + +static ACPI_STATUS +nvdimm_walk_dev(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +{ + ACPI_STATUS status; + struct nvdimm_ns_walk_ctx *wctx; + + wctx = ctx; + status = wctx->func(handle, wctx->arg); + return_ACPI_STATUS(status); +} + +static ACPI_STATUS +nvdimm_walk_root(ACPI_HANDLE handle, UINT32 level, void *ctx, void **st) +{ + ACPI_STATUS status; + + if (!acpi_MatchHid(handle, "ACPI0012")) + return_ACPI_STATUS(AE_OK); + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 100, + nvdimm_walk_dev, NULL, ctx, NULL); + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(status); + return_ACPI_STATUS(AE_CTRL_TERMINATE); +} + +static ACPI_STATUS +nvdimm_foreach_acpi(ACPI_STATUS (*func)(ACPI_HANDLE, void *), void *arg) +{ + struct nvdimm_ns_walk_ctx wctx; + ACPI_STATUS status; + + wctx.func = func; + wctx.arg = arg; + status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 100, + nvdimm_walk_root, NULL, &wctx, NULL); + return_ACPI_STATUS(status); +} + +static ACPI_STATUS +nvdimm_count_devs(ACPI_HANDLE handle __unused, void *arg) +{ + int *cnt; + + cnt = arg; + (*cnt)++; + + ACPI_BUFFER name; + ACPI_STATUS status; + if (bootverbose) { + name.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiGetName(handle, ACPI_FULL_PATHNAME, &name); + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(status); + printf("nvdimm: enumerated %s\n", name.Pointer); + AcpiOsFree(name.Pointer); + } + + return_ACPI_STATUS(AE_OK); +} + +struct nvdimm_create_dev_arg { + device_t acpi0; + int *cnt; +}; + +static ACPI_STATUS +nvdimm_create_dev(ACPI_HANDLE handle, void *arg) +{ + struct nvdimm_create_dev_arg *narg; + device_t child; + int idx; + + narg = arg; + idx = *(narg->cnt); + child = device_find_child(narg->acpi0, "nvdimm", idx); + if (child == NULL) + child = BUS_ADD_CHILD(narg->acpi0, 1, "nvdimm", idx); + if (child == NULL) { + if (bootverbose) + device_printf(narg->acpi0, + "failed to create nvdimm%d\n", idx); + return_ACPI_STATUS(AE_ERROR); + } + acpi_set_handle(child, handle); + KASSERT(nvdimm_devs[idx] == NULL, ("nvdimm_devs[%d] not NULL", idx)); + nvdimm_devs[idx] = child; + + (*(narg->cnt))++; + return_ACPI_STATUS(AE_OK); +} + +static bool +nvdimm_init(void) +{ + ACPI_STATUS status; + + if (nvdimm_devcnt != 0) + return (true); + if (acpi_disabled("nvdimm")) + return (false); + status = nvdimm_foreach_acpi(nvdimm_count_devs, &nvdimm_devcnt); + if (ACPI_FAILURE(status)) { + if (bootverbose) + printf("nvdimm_init: count failed\n"); + return (false); + } + nvdimm_devs = malloc(nvdimm_devcnt * sizeof(device_t), M_NVDIMM, + M_WAITOK | M_ZERO); + return (true); +} + +static void +nvdimm_identify(driver_t *driver, device_t parent) +{ + struct nvdimm_create_dev_arg narg; + ACPI_STATUS status; + int i; + + if (!nvdimm_init()) + return; + narg.acpi0 = parent; + narg.cnt = &i; + i = 0; + status = nvdimm_foreach_acpi(nvdimm_create_dev, &narg); + if (ACPI_FAILURE(status) && bootverbose) + printf("nvdimm_identify: create failed\n"); +} + +static int +nvdimm_probe(device_t dev) +{ + + return (BUS_PROBE_NOWILDCARD); +} + +static int +nvdimm_attach(device_t dev) +{ + struct nvdimm_dev *nv; + ACPI_TABLE_NFIT *nfitbl; + ACPI_HANDLE handle; + ACPI_STATUS status; + int i; + + nv = device_get_softc(dev); + handle = acpi_get_handle(dev); + if (handle == NULL) + return (EINVAL); + nv->nv_dev = dev; + for (i = 0; i < nvdimm_devcnt; i++) { + if (nvdimm_devs[i] == dev) { + nv->nv_devs_idx = i; + break; + } + } + MPASS(i < nvdimm_devcnt); + if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &nv->nv_handle))) { + device_printf(dev, "cannot get handle\n"); + return (ENXIO); + } + + status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); + if (ACPI_FAILURE(status)) { + if (bootverbose) + device_printf(dev, "cannot get NFIT\n"); + return (ENXIO); + } + nvdimm_iterate_nfit(nfitbl, ACPI_NFIT_TYPE_FLUSH_ADDRESS, + nvdimm_parse_flush_addr, nv); + AcpiPutTable(&nfitbl->Header); + return (0); +} + +static int +nvdimm_detach(device_t dev) +{ + struct nvdimm_dev *nv; + + nv = device_get_softc(dev); + nvdimm_devs[nv->nv_devs_idx] = NULL; + free(nv->nv_flush_addr, M_NVDIMM); + return (0); +} + +static int +nvdimm_suspend(device_t dev) +{ + + return (0); +} + +static int +nvdimm_resume(device_t dev) +{ + + return (0); +} + +static device_method_t nvdimm_methods[] = { + DEVMETHOD(device_identify, nvdimm_identify), + DEVMETHOD(device_probe, nvdimm_probe), + DEVMETHOD(device_attach, nvdimm_attach), + DEVMETHOD(device_detach, nvdimm_detach), + DEVMETHOD(device_suspend, nvdimm_suspend), + DEVMETHOD(device_resume, nvdimm_resume), + DEVMETHOD_END +}; + +static driver_t nvdimm_driver = { + "nvdimm", + nvdimm_methods, + sizeof(struct nvdimm_dev), +}; + +static void +nvdimm_fini(void) +{ + + free(nvdimm_devs, M_NVDIMM); + nvdimm_devs = NULL; + nvdimm_devcnt = 0; +} + +static int +nvdimm_modev(struct module *mod, int what, void *arg) +{ + int error; + + switch (what) { + case MOD_LOAD: + error = 0; + break; + + case MOD_UNLOAD: + nvdimm_fini(); + error = 0; + break; + + case MOD_QUIESCE: + error = 0; + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +DRIVER_MODULE(nvdimm, acpi, nvdimm_driver, nvdimm_devclass, nvdimm_modev, NULL); +MODULE_DEPEND(nvdimm, acpi, 1, 1, 1); Added: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvdimm/nvdimm_spa.c Tue Oct 16 20:12:35 2018 (r339391) @@ -0,0 +1,632 @@ +/*- + * Copyright (c) 2017, 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" +#include "opt_ddb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct SPA_mapping *spa_mappings; +int spa_mappings_cnt; + +static int +nvdimm_spa_count(void *nfitsubtbl __unused, void *arg) +{ + int *cnt; + + cnt = arg; + (*cnt)++; + return (0); +} + +static struct nvdimm_SPA_uuid_list_elm { + const char *u_name; + const char *u_id_str; + struct uuid u_id; + const bool u_usr_acc; +} nvdimm_SPA_uuid_list[] = { + [SPA_TYPE_VOLATILE_MEMORY] = { + .u_name = "VOLA MEM ", + .u_id_str = UUID_VOLATILE_MEMORY, + .u_usr_acc = true, + }, + [SPA_TYPE_PERSISTENT_MEMORY] = { + .u_name = "PERS MEM", + .u_id_str = UUID_PERSISTENT_MEMORY, + .u_usr_acc = true, + }, + [SPA_TYPE_CONTROL_REGION] = { + .u_name = "CTRL RG ", + .u_id_str = UUID_CONTROL_REGION, + .u_usr_acc = false, + }, + [SPA_TYPE_DATA_REGION] = { + .u_name = "DATA RG ", + .u_id_str = UUID_DATA_REGION, + .u_usr_acc = true, + }, + [SPA_TYPE_VOLATILE_VIRTUAL_DISK] = { + .u_name = "VIRT DSK", + .u_id_str = UUID_VOLATILE_VIRTUAL_DISK, + .u_usr_acc = true, + }, + [SPA_TYPE_VOLATILE_VIRTUAL_CD] = { + .u_name = "VIRT CD ", + .u_id_str = UUID_VOLATILE_VIRTUAL_CD, + .u_usr_acc = true, + }, + [SPA_TYPE_PERSISTENT_VIRTUAL_DISK] = { + .u_name = "PV DSK ", + .u_id_str = UUID_PERSISTENT_VIRTUAL_DISK, + .u_usr_acc = true, + }, + [SPA_TYPE_PERSISTENT_VIRTUAL_CD] = { + .u_name = "PV CD ", + .u_id_str = UUID_PERSISTENT_VIRTUAL_CD, + .u_usr_acc = true, + }, +}; + +static vm_memattr_t +nvdimm_spa_memattr(struct SPA_mapping *spa) +{ + vm_memattr_t mode; + + if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WB) != 0) + mode = VM_MEMATTR_WRITE_BACK; + else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WT) != 0) + mode = VM_MEMATTR_WRITE_THROUGH; + else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WC) != 0) + mode = VM_MEMATTR_WRITE_COMBINING; + else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_WP) != 0) + mode = VM_MEMATTR_WRITE_PROTECTED; + else if ((spa->spa_efi_mem_flags & EFI_MD_ATTR_UC) != 0) + mode = VM_MEMATTR_UNCACHEABLE; + else { + if (bootverbose) + printf("SPA%d mapping attr unsupported\n", + spa->spa_nfit_idx); + mode = VM_MEMATTR_UNCACHEABLE; + } + return (mode); +} + +static int +nvdimm_spa_uio(struct SPA_mapping *spa, struct uio *uio) +{ + struct vm_page m, *ma; + off_t off; + vm_memattr_t mattr; + int error, n; + + if (spa->spa_kva == NULL) { + mattr = nvdimm_spa_memattr(spa); + vm_page_initfake(&m, 0, mattr); + ma = &m; + while (uio->uio_resid > 0) { + if (uio->uio_offset >= spa->spa_len) + break; + off = spa->spa_phys_base + uio->uio_offset; + vm_page_updatefake(&m, trunc_page(off), mattr); + n = PAGE_SIZE; + if (n > uio->uio_resid) + n = uio->uio_resid; + error = uiomove_fromphys(&ma, off & PAGE_MASK, n, uio); + if (error != 0) + break; + } + } else { + while (uio->uio_resid > 0) { + if (uio->uio_offset >= spa->spa_len) + break; + n = INT_MAX; + if (n > uio->uio_resid) + n = uio->uio_resid; + if (uio->uio_offset + n > spa->spa_len) + n = spa->spa_len - uio->uio_offset; + error = uiomove((char *)spa->spa_kva + uio->uio_offset, + n, uio); + if (error != 0) + break; + } + } + return (error); +} + +static int +nvdimm_spa_rw(struct cdev *dev, struct uio *uio, int ioflag) +{ + + return (nvdimm_spa_uio(dev->si_drv1, uio)); +} + +static int +nvdimm_spa_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct SPA_mapping *spa; + int error; + + spa = dev->si_drv1; + error = 0; + switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *)data = DEV_BSIZE; + break; + case DIOCGMEDIASIZE: + *(off_t *)data = spa->spa_len; + break; + default: + error = ENOTTY; + break; + } + return (error); +} + +static int +nvdimm_spa_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, + vm_object_t *objp, int nprot) +{ + struct SPA_mapping *spa; + + spa = dev->si_drv1; + if (spa->spa_obj == NULL) + return (ENXIO); + if (*offset >= spa->spa_len || *offset + size < *offset || + *offset + size > spa->spa_len) + return (EINVAL); + vm_object_reference(spa->spa_obj); + *objp = spa->spa_obj; + return (0); +} + +static struct cdevsw spa_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_DISK, + .d_name = "nvdimm_spa", + .d_read = nvdimm_spa_rw, + .d_write = nvdimm_spa_rw, + .d_ioctl = nvdimm_spa_ioctl, + .d_mmap_single = nvdimm_spa_mmap_single, +}; + +static void +nvdimm_spa_g_all_unmapped(struct SPA_mapping *spa, struct bio *bp, + int rw) +{ + struct vm_page maa[bp->bio_ma_n]; + vm_page_t ma[bp->bio_ma_n]; + vm_memattr_t mattr; + int i; + + mattr = nvdimm_spa_memattr(spa); + for (i = 0; i < nitems(ma); i++) { + maa[i].flags = 0; + vm_page_initfake(&maa[i], spa->spa_phys_base + + trunc_page(bp->bio_offset) + PAGE_SIZE * i, mattr); + ma[i] = &maa[i]; + } + if (rw == BIO_READ) + pmap_copy_pages(ma, bp->bio_offset & PAGE_MASK, bp->bio_ma, + bp->bio_ma_offset, bp->bio_length); + else + pmap_copy_pages(bp->bio_ma, bp->bio_ma_offset, ma, + bp->bio_offset & PAGE_MASK, bp->bio_length); +} + +static void +nvdimm_spa_g_thread(void *arg) +{ + struct SPA_mapping *spa; + struct bio *bp; + struct uio auio; + struct iovec aiovec; + int error; + + spa = arg; + for (;;) { + mtx_lock(&spa->spa_g_mtx); + for (;;) { + bp = bioq_takefirst(&spa->spa_g_queue); + if (bp != NULL) + break; + msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, + "spa_g", 0); + if (!spa->spa_g_proc_run) { + spa->spa_g_proc_exiting = true; + wakeup(&spa->spa_g_queue); + mtx_unlock(&spa->spa_g_mtx); + kproc_exit(0); + } + continue; + } + mtx_unlock(&spa->spa_g_mtx); + if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && + bp->bio_cmd != BIO_FLUSH) { + error = EOPNOTSUPP; + goto completed; + } + + error = 0; + if (bp->bio_cmd == BIO_FLUSH) { + if (spa->spa_kva != NULL) { + pmap_large_map_wb(spa->spa_kva, spa->spa_len); + } else { + pmap_flush_cache_phys_range( + (vm_paddr_t)spa->spa_phys_base, + (vm_paddr_t)spa->spa_phys_base + + spa->spa_len, nvdimm_spa_memattr(spa)); + } + /* + * XXX flush IMC + */ + goto completed; + } + + if ((bp->bio_flags & BIO_UNMAPPED) != 0) { + if (spa->spa_kva != NULL) { + aiovec.iov_base = (char *)spa->spa_kva + + bp->bio_offset; + aiovec.iov_len = bp->bio_length; + auio.uio_iov = &aiovec; + auio.uio_iovcnt = 1; + auio.uio_resid = bp->bio_length; + auio.uio_offset = bp->bio_offset; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = bp->bio_cmd == BIO_READ ? + UIO_WRITE : UIO_READ; + auio.uio_td = curthread; + error = uiomove_fromphys(bp->bio_ma, + bp->bio_ma_offset, bp->bio_length, &auio); + } else { + nvdimm_spa_g_all_unmapped(spa, bp, bp->bio_cmd); + error = 0; + } + } else { + aiovec.iov_base = bp->bio_data; + aiovec.iov_len = bp->bio_length; + auio.uio_iov = &aiovec; + auio.uio_iovcnt = 1; + auio.uio_resid = bp->bio_length; + auio.uio_offset = bp->bio_offset; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = bp->bio_cmd == BIO_READ ? UIO_READ : + UIO_WRITE; + auio.uio_td = curthread; + error = nvdimm_spa_uio(spa, &auio); + } + devstat_end_transaction_bio(spa->spa_g_devstat, bp); +completed: + bp->bio_completed = bp->bio_length; + g_io_deliver(bp, error); + } +} + +static void +nvdimm_spa_g_start(struct bio *bp) +{ + struct SPA_mapping *spa; + + spa = bp->bio_to->geom->softc; + if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + mtx_lock(&spa->spa_g_stat_mtx); + devstat_start_transaction_bio(spa->spa_g_devstat, bp); + mtx_unlock(&spa->spa_g_stat_mtx); + } + mtx_lock(&spa->spa_g_mtx); + bioq_disksort(&spa->spa_g_queue, bp); + wakeup(&spa->spa_g_queue); + mtx_unlock(&spa->spa_g_mtx); +} + +static int +nvdimm_spa_g_access(struct g_provider *pp, int r, int w, int e) +{ + + return (0); +} + +static g_init_t nvdimm_spa_g_init; +static g_fini_t nvdimm_spa_g_fini; + +struct g_class nvdimm_spa_g_class = { + .name = "SPA", + .version = G_VERSION, + .start = nvdimm_spa_g_start, + .access = nvdimm_spa_g_access, + .init = nvdimm_spa_g_init, + .fini = nvdimm_spa_g_fini, +}; +DECLARE_GEOM_CLASS(nvdimm_spa_g_class, g_spa); + +static int +nvdimm_spa_init_one(struct SPA_mapping *spa, ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr, + int spa_type) +{ + struct make_dev_args mda; + struct sglist *spa_sg; + int error, error1; + + spa->spa_type = spa_type; + spa->spa_domain = ((nfitaddr->Flags & ACPI_NFIT_PROXIMITY_VALID) != 0) ? + nfitaddr->ProximityDomain : -1; + spa->spa_nfit_idx = nfitaddr->RangeIndex; + spa->spa_phys_base = nfitaddr->Address; + spa->spa_len = nfitaddr->Length; + spa->spa_efi_mem_flags = nfitaddr->MemoryMapping; + if (bootverbose) { + printf("NVDIMM SPA%d base %#016jx len %#016jx %s fl %#jx\n", + spa->spa_nfit_idx, + (uintmax_t)spa->spa_phys_base, (uintmax_t)spa->spa_len, + nvdimm_SPA_uuid_list[spa_type].u_name, + spa->spa_efi_mem_flags); + } + if (!nvdimm_SPA_uuid_list[spa_type].u_usr_acc) + return (0); + + error1 = pmap_large_map(spa->spa_phys_base, spa->spa_len, + &spa->spa_kva, nvdimm_spa_memattr(spa)); + if (error1 != 0) { + printf("NVDIMM SPA%d cannot map into KVA, error %d\n", + spa->spa_nfit_idx, error1); + spa->spa_kva = NULL; + } + + spa_sg = sglist_alloc(1, M_WAITOK); + error = sglist_append_phys(spa_sg, spa->spa_phys_base, + spa->spa_len); + if (error == 0) { + spa->spa_obj = vm_pager_allocate(OBJT_SG, spa_sg, spa->spa_len, + VM_PROT_ALL, 0, NULL); + if (spa->spa_obj == NULL) { + printf("NVDIMM SPA%d failed to alloc vm object", + spa->spa_nfit_idx); + sglist_free(spa_sg); + } + } else { + printf("NVDIMM SPA%d failed to init sglist, error %d", + spa->spa_nfit_idx, error); + sglist_free(spa_sg); + } + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; + mda.mda_devsw = &spa_cdevsw; + mda.mda_cr = NULL; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_OPERATOR; + mda.mda_mode = 0660; + mda.mda_si_drv1 = spa; + error = make_dev_s(&mda, &spa->spa_dev, "nvdimm_spa%d", + spa->spa_nfit_idx); + if (error != 0) { + printf("NVDIMM SPA%d cannot create devfs node, error %d\n", + spa->spa_nfit_idx, error); + if (error1 == 0) + error1 = error; + } + + bioq_init(&spa->spa_g_queue); + mtx_init(&spa->spa_g_mtx, "spag", NULL, MTX_DEF); + mtx_init(&spa->spa_g_stat_mtx, "spagst", NULL, MTX_DEF); + spa->spa_g_proc_run = true; + spa->spa_g_proc_exiting = false; + error = kproc_create(nvdimm_spa_g_thread, spa, &spa->spa_g_proc, 0, 0, + "g_spa%d", spa->spa_nfit_idx); + if (error != 0) { + printf("NVDIMM SPA%d cannot create geom worker, error %d\n", + spa->spa_nfit_idx, error); + if (error1 == 0) + error1 = error; + } else { + g_topology_assert(); + spa->spa_g = g_new_geomf(&nvdimm_spa_g_class, "spa%d", + spa->spa_nfit_idx); + spa->spa_g->softc = spa; + spa->spa_p = g_new_providerf(spa->spa_g, "spa%d", + spa->spa_nfit_idx); + spa->spa_p->mediasize = spa->spa_len; + spa->spa_p->sectorsize = DEV_BSIZE; + spa->spa_p->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE | + G_PF_ACCEPT_UNMAPPED; + g_error_provider(spa->spa_p, 0); + spa->spa_g_devstat = devstat_new_entry("spa", spa->spa_nfit_idx, + DEV_BSIZE, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, + DEVSTAT_PRIORITY_MAX); + } + return (error1); +} + +static void +nvdimm_spa_fini_one(struct SPA_mapping *spa) +{ + + mtx_lock(&spa->spa_g_mtx); + spa->spa_g_proc_run = false; + wakeup(&spa->spa_g_queue); + while (!spa->spa_g_proc_exiting) + msleep(&spa->spa_g_queue, &spa->spa_g_mtx, PRIBIO, "spa_e", 0); + mtx_unlock(&spa->spa_g_mtx); + if (spa->spa_g != NULL) { + g_topology_lock(); + g_wither_geom(spa->spa_g, ENXIO); + g_topology_unlock(); + spa->spa_g = NULL; + spa->spa_p = NULL; + } + if (spa->spa_g_devstat != NULL) { + devstat_remove_entry(spa->spa_g_devstat); + spa->spa_g_devstat = NULL; + } + if (spa->spa_dev != NULL) { + destroy_dev(spa->spa_dev); + spa->spa_dev = NULL; + } + vm_object_deallocate(spa->spa_obj); + if (spa->spa_kva != NULL) { + pmap_large_unmap(spa->spa_kva, spa->spa_len); + spa->spa_kva = NULL; + } + mtx_destroy(&spa->spa_g_mtx); + mtx_destroy(&spa->spa_g_stat_mtx); +} + +static int +nvdimm_spa_parse(void *nfitsubtbl, void *arg) +{ + ACPI_NFIT_SYSTEM_ADDRESS *nfitaddr; + struct SPA_mapping *spa; + int error, *i, j; + + i = arg; + spa = &spa_mappings[*i]; + nfitaddr = nfitsubtbl; + + for (j = 0; j < nitems(nvdimm_SPA_uuid_list); j++) { + /* XXXKIB: is ACPI UUID representation compatible ? */ + if (uuidcmp((struct uuid *)&nfitaddr->RangeGuid, + &nvdimm_SPA_uuid_list[j].u_id) != 0) + continue; + error = nvdimm_spa_init_one(spa, nfitaddr, j); + if (error != 0) + nvdimm_spa_fini_one(spa); + break; + } + if (j == nitems(nvdimm_SPA_uuid_list) && bootverbose) { + printf("Unknown SPA UUID %d ", nfitaddr->RangeIndex); + printf_uuid((struct uuid *)&nfitaddr->RangeGuid); + printf("\n"); + } + (*i)++; + return (0); +} + +static int +nvdimm_spa_init1(ACPI_TABLE_NFIT *nfitbl) +{ + struct nvdimm_SPA_uuid_list_elm *sle; + int error, i; + + for (i = 0; i < nitems(nvdimm_SPA_uuid_list); i++) { + sle = &nvdimm_SPA_uuid_list[i]; + error = parse_uuid(sle->u_id_str, &sle->u_id); + if (error != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Oct 16 20:31:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D6F10E15AF for ; Tue, 16 Oct 2018 20:31:20 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91A837F815 for ; Tue, 16 Oct 2018 20:31:19 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb33.google.com with SMTP id g15-v6so9456643ybf.6 for ; Tue, 16 Oct 2018 13:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mkJgSjdIqmbbZ+DB9lDgtH2o6JMi7aK1gPQfqv1yTAQ=; b=eOPUe/HjU2kTuL13awe2gRjBDamh9u5K3CQmmRpK/Trg52pW7GZCP9ozZp19q69UBO zqABwNQqCP2fzGdeVBqGGMMkRl7JodNv0qYr2DbZzS7As27NlG5988ZAtf4jaqYH3rLG HB6aFbOtNBkslcSwz9i1+WQnOPA16M7otoCKPA3ZsR02iresaTgic3Zl+pOWE5jofO3e rqXRXdcR4Fe67SOg+s1jcYU7TieSe+lS/AB8Zn1HYAn9I4PQHRldt6MrIeS2iO1LZK6N 3cNfYa4JjGIEw81U0ORzma/TeoR0+EP7qRD/p2dwY6CSttLj34w3C7UZZkOKcQ2ZpUQt nGzw== 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=mkJgSjdIqmbbZ+DB9lDgtH2o6JMi7aK1gPQfqv1yTAQ=; b=jDRMXmYBOTiEwpesHOH9vqhJRS8Lrro68vWjllO+jMVi0Ir8xxdyt4sm9MLatkg9yO EKVqTn9vGKx4/bhTwzuQ4/0yy9XuAW22i/2I7SrPdtqvlak7aEknISc6XnIbhiAEq6tg sopMxXqHmtPM64ceg0tz1DVRWHH71aLNJHsRRDBRbdZgz6bEaV/7HS3IyeLw2J+S9NT3 kvGnzx6POrB7Wanga5+4jqOoVXzkCeNGyjJw0zzpY7Q42NOGoDiMPMvq/fUKvD2RRezN yrV8effsVLZQ/XpOACGjQ5fyo4ounUhpIgl6BxAAqslOyuNlW4rP5ETA5iHceFmy7UB1 9gTA== X-Gm-Message-State: ABuFfogugUZtmGL1UY7htf6oqaTE7EDnbq73la5QHycesC0r49sQyAIx 3kLDCbMcRBuw1h4CDYdqH8/kMu5NJaN52uoLRTdiR/SuCv0= X-Google-Smtp-Source: ACcGV60ZP1AZUXYJKRhItrdIeaVKk3N9v6F9u/nZhiDAwPlRFKAlwgLjcBfdI/UXbGqyMmbaS1OfQd0EeKwXb+G1v50= X-Received: by 2002:a25:800e:: with SMTP id m14-v6mr11854787ybk.389.1539721878748; Tue, 16 Oct 2018 13:31:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5b:645:0:0:0:0:0 with HTTP; Tue, 16 Oct 2018 13:31:17 -0700 (PDT) In-Reply-To: <201810161728.w9GHSBqV027998@repo.freebsd.org> References: <201810161728.w9GHSBqV027998@repo.freebsd.org> From: Oliver Pinter Date: Tue, 16 Oct 2018 22:31:17 +0200 Message-ID: Subject: Re: svn commit: r339386 - in head/sys/amd64: amd64 include To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 16 Oct 2018 20:31:20 -0000 On 10/16/18, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 16 17:28:10 2018 > New Revision: 339386 > URL: https://svnweb.freebsd.org/changeset/base/339386 > > Log: > Provide pmap_large_map() KPI on amd64. > > The KPI allows to map very large contigous physical memory regions > into KVA, which are not covered by DMAP. > > I see both with QEMU and with some real hardware started shipping, the > regions for NVDIMMs might be very far apart from the normal RAM, and > we expect that at least initial users of NVDIMM could install very > large amount of such memory. IMO it is not reasonable to extend DMAP > to cover that far-away regions both because it could overflow existing > 4T window for DMAP in KVA, and because it costs in page table pages > allocations, for gap and for possibly unused NV RAM. > > Also, KPI provides some special functionality for fast cache flushing > based on the knowledge of the NVRAM mapping use. > > Reviewed by: alc, markj > Sponsored by: The FreeBSD Foundation > Approved by: re (gjb) > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D17070 > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/amd64/include/pmap.h > head/sys/amd64/include/vmparam.h > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Tue Oct 16 17:17:11 2018 (r339385) > +++ head/sys/amd64/amd64/pmap.c Tue Oct 16 17:28:10 2018 (r339386) > @@ -409,6 +409,9 @@ static struct mtx qframe_mtx; > > static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ > > +static vmem_t *large_vmem; > +static u_int lm_ents; > + > int pmap_pcid_enabled = 1; > SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | > CTLFLAG_NOFETCH, > &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); > @@ -655,6 +658,7 @@ static void pmap_invalidate_cache_range_all(vm_offset_ > static void pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, > pd_entry_t pde); > static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); > +static vm_page_t pmap_large_map_getptp_unlocked(void); > static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); > #if VM_NRESERVLEVEL > 0 > static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, > @@ -1313,7 +1317,7 @@ void > pmap_init(void) > { > struct pmap_preinit_mapping *ppim; > - vm_page_t mpte; > + vm_page_t m, mpte; > vm_size_t s; > int error, i, pv_npg, ret, skz63; > > @@ -1440,6 +1444,28 @@ pmap_init(void) > (vmem_addr_t *)&qframe); > if (error != 0) > panic("qframe allocation failed"); > + > + lm_ents = 8; > + TUNABLE_INT_FETCH("vm.pmap.large_map_pml4_entries", &lm_ents); > + if (lm_ents > LMEPML4I - LMSPML4I + 1) > + lm_ents = LMEPML4I - LMSPML4I + 1; > + if (bootverbose) > + printf("pmap: large map %u PML4 slots (%lu Gb)\n", Isn't this GB (GigaByte instead of Gigabit?) > + lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024)); > + if (lm_ents != 0) { > + large_vmem = vmem_create("large", LARGEMAP_MIN_ADDRESS, > + (vmem_size_t)lm_ents * NBPML4, PAGE_SIZE, 0, M_WAITOK); > + if (large_vmem == NULL) { > + printf("pmap: cannot create large map\n"); > + lm_ents = 0; > + } > + for (i = 0; i < lm_ents; i++) { > + m = pmap_large_map_getptp_unlocked(); > + kernel_pmap->pm_pml4[LMSPML4I + i] = X86_PG_V | > + X86_PG_RW | X86_PG_A | X86_PG_M | pg_nx | > + VM_PAGE_TO_PHYS(m); > + } > + } > } > > static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, > @@ -2315,14 +2341,6 @@ pmap_force_invalidate_cache_range(vm_offset_t sva, > vm_ > { > > sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); > - if (eva - sva >= PMAP_CLFLUSH_THRESHOLD) { > - /* > - * The supplied range is bigger than 2MB. > - * Globally invalidate cache. > - */ > - pmap_invalidate_cache(); > - return; > - } > > /* > * XXX: Some CPUs fault, hang, or trash the local APIC > @@ -2406,6 +2424,64 @@ pmap_invalidate_cache_pages(vm_page_t *pages, int > coun > } > } > > +void > +pmap_flush_cache_range(vm_offset_t sva, vm_offset_t eva) > +{ > + > + pmap_invalidate_cache_range_check_align(sva, eva); > + > + if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) == 0) { > + pmap_force_invalidate_cache_range(sva, eva); > + return; > + } > + > + /* See comment in pmap_force_invalidate_cache_range(). */ > + if (pmap_kextract(sva) == lapic_paddr) > + return; > + > + sfence(); > + for (; sva < eva; sva += cpu_clflush_line_size) > + clwb(sva); > + sfence(); > +} > + > +void > +pmap_flush_cache_phys_range(vm_paddr_t spa, vm_paddr_t epa, vm_memattr_t > mattr) > +{ > + pt_entry_t *pte; > + vm_offset_t vaddr; > + int error, pte_bits; > + > + KASSERT((spa & PAGE_MASK) == 0, > + ("pmap_flush_cache_phys_range: spa not page-aligned")); > + KASSERT((epa & PAGE_MASK) == 0, > + ("pmap_flush_cache_phys_range: epa not page-aligned")); > + > + if (spa < dmaplimit) { > + pmap_flush_cache_range(PHYS_TO_DMAP(spa), PHYS_TO_DMAP(MIN( > + dmaplimit, epa))); > + if (dmaplimit >= epa) > + return; > + spa = dmaplimit; > + } > + > + pte_bits = pmap_cache_bits(kernel_pmap, mattr, 0) | X86_PG_RW | > + X86_PG_V; > + error = vmem_alloc(kernel_arena, PAGE_SIZE, M_BESTFIT | M_WAITOK, > + &vaddr); > + KASSERT(error == 0, ("vmem_alloc failed: %d", error)); > + pte = vtopte(vaddr); > + for (; spa < epa; spa += PAGE_SIZE) { > + sched_pin(); > + pte_store(pte, spa | pte_bits); > + invlpg(vaddr); > + /* XXXKIB sfences inside flush_cache_range are excessive */ > + pmap_flush_cache_range(vaddr, vaddr + PAGE_SIZE); > + sched_unpin(); > + } > + vmem_free(kernel_arena, vaddr, PAGE_SIZE); > +} > + > /* > * Routine: pmap_extract > * Function: > @@ -2812,6 +2888,10 @@ pmap_pinit_pml4(vm_page_t pml4pg) > /* install self-referential address mapping entry(s) */ > pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | X86_PG_V | X86_PG_RW | > X86_PG_A | X86_PG_M; > + > + /* install large map entries if configured */ > + for (i = 0; i < lm_ents; i++) > + pm_pml4[LMSPML4I + i] = kernel_pmap->pm_pml4[LMSPML4I + i]; > } > > static void > @@ -3158,6 +3238,8 @@ pmap_release(pmap_t pmap) > for (i = 0; i < ndmpdpphys; i++)/* Direct Map */ > pmap->pm_pml4[DMPML4I + i] = 0; > pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ > + for (i = 0; i < lm_ents; i++) /* Large Map */ > + pmap->pm_pml4[LMSPML4I + i] = 0; > > vm_page_unwire_noq(m); > vm_page_free_zero(m); > @@ -8099,6 +8181,477 @@ pmap_quick_remove_page(vm_offset_t addr) > pte_store(vtopte(qframe), 0); > invlpg(qframe); > mtx_unlock_spin(&qframe_mtx); > +} > + > +/* > + * Pdp pages from the large map are managed differently from either > + * kernel or user page table pages. They are permanently allocated at > + * initialization time, and their wire count is permanently set to > + * zero. The pml4 entries pointing to those pages are copied into > + * each allocated pmap. > + * > + * In contrast, pd and pt pages are managed like user page table > + * pages. They are dynamically allocated, and their wire count > + * represents the number of valid entries within the page. > + */ > +static vm_page_t > +pmap_large_map_getptp_unlocked(void) > +{ > + vm_page_t m; > + > + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | > + VM_ALLOC_ZERO); > + if (m != NULL && (m->flags & PG_ZERO) == 0) > + pmap_zero_page(m); > + return (m); > +} > + > +static vm_page_t > +pmap_large_map_getptp(void) > +{ > + vm_page_t m; > + > + PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); > + m = pmap_large_map_getptp_unlocked(); > + if (m == NULL) { > + PMAP_UNLOCK(kernel_pmap); > + vm_wait(NULL); > + PMAP_LOCK(kernel_pmap); > + /* Callers retry. */ > + } > + return (m); > +} > + > +static pdp_entry_t * > +pmap_large_map_pdpe(vm_offset_t va) > +{ > + vm_pindex_t pml4_idx; > + vm_paddr_t mphys; > + > + pml4_idx = pmap_pml4e_index(va); > + KASSERT(LMSPML4I <= pml4_idx && pml4_idx < LMSPML4I + lm_ents, > + ("pmap_large_map_pdpe: va %#jx out of range idx %#jx LMSPML4I " > + "%#jx lm_ents %d", > + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); > + KASSERT((kernel_pmap->pm_pml4[pml4_idx] & X86_PG_V) != 0, > + ("pmap_large_map_pdpe: invalid pml4 for va %#jx idx %#jx " > + "LMSPML4I %#jx lm_ents %d", > + (uintmax_t)va, (uintmax_t)pml4_idx, LMSPML4I, lm_ents)); > + mphys = kernel_pmap->pm_pml4[pml4_idx] & PG_FRAME; > + return ((pdp_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pdpe_index(va)); > +} > + > +static pd_entry_t * > +pmap_large_map_pde(vm_offset_t va) > +{ > + pdp_entry_t *pdpe; > + vm_page_t m; > + vm_paddr_t mphys; > + > +retry: > + pdpe = pmap_large_map_pdpe(va); > + if (*pdpe == 0) { > + m = pmap_large_map_getptp(); > + if (m == NULL) > + goto retry; > + mphys = VM_PAGE_TO_PHYS(m); > + *pdpe = mphys | X86_PG_A | X86_PG_RW | X86_PG_V | pg_nx; > + } else { > + MPASS((*pdpe & X86_PG_PS) == 0); > + mphys = *pdpe & PG_FRAME; > + } > + return ((pd_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pde_index(va)); > +} > + > +static pt_entry_t * > +pmap_large_map_pte(vm_offset_t va) > +{ > + pd_entry_t *pde; > + vm_page_t m; > + vm_paddr_t mphys; > + > +retry: > + pde = pmap_large_map_pde(va); > + if (*pde == 0) { > + m = pmap_large_map_getptp(); > + if (m == NULL) > + goto retry; > + mphys = VM_PAGE_TO_PHYS(m); > + *pde = mphys | X86_PG_A | X86_PG_RW | X86_PG_V | pg_nx; > + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))->wire_count++; > + } else { > + MPASS((*pde & X86_PG_PS) == 0); > + mphys = *pde & PG_FRAME; > + } > + return ((pt_entry_t *)PHYS_TO_DMAP(mphys) + pmap_pte_index(va)); > +} > + > +static int > +pmap_large_map_getva(vm_size_t len, vm_offset_t align, vm_offset_t phase, > + vmem_addr_t *vmem_res) > +{ > + > + /* > + * Large mappings are all but static. Consequently, there > + * is no point in waiting for an earlier allocation to be > + * freed. > + */ > + return (vmem_xalloc(large_vmem, len, align, phase, 0, VMEM_ADDR_MIN, > + VMEM_ADDR_MAX, M_NOWAIT | M_BESTFIT, vmem_res)); > +} > + > +int > +pmap_large_map(vm_paddr_t spa, vm_size_t len, void **addr, > + vm_memattr_t mattr) > +{ > + pdp_entry_t *pdpe; > + pd_entry_t *pde; > + pt_entry_t *pte; > + vm_offset_t va, inc; > + vmem_addr_t vmem_res; > + vm_paddr_t pa; > + int error; > + > + if (len == 0 || spa + len < spa) > + return (EINVAL); > + > + /* See if DMAP can serve. */ > + if (spa + len <= dmaplimit) { > + va = PHYS_TO_DMAP(spa); > + *addr = (void *)va; > + return (pmap_change_attr(va, len, mattr)); > + } > + > + /* > + * No, allocate KVA. Fit the address with best possible > + * alignment for superpages. Fall back to worse align if > + * failed. > + */ > + error = ENOMEM; > + if ((amd_feature & AMDID_PAGE1GB) != 0 && rounddown2(spa + len, > + NBPDP) >= roundup2(spa, NBPDP) + NBPDP) > + error = pmap_large_map_getva(len, NBPDP, spa & PDPMASK, > + &vmem_res); > + if (error != 0 && rounddown2(spa + len, NBPDR) >= roundup2(spa, > + NBPDR) + NBPDR) > + error = pmap_large_map_getva(len, NBPDR, spa & PDRMASK, > + &vmem_res); > + if (error != 0) > + error = pmap_large_map_getva(len, PAGE_SIZE, 0, &vmem_res); > + if (error != 0) > + return (error); > + > + /* > + * Fill pagetable. PG_M is not pre-set, we scan modified bits > + * in the pagetable to minimize flushing. No need to > + * invalidate TLB, since we only update invalid entries. > + */ > + PMAP_LOCK(kernel_pmap); > + for (pa = spa, va = vmem_res; len > 0; pa += inc, va += inc, > + len -= inc) { > + if ((amd_feature & AMDID_PAGE1GB) != 0 && len >= NBPDP && > + (pa & PDPMASK) == 0 && (va & PDPMASK) == 0) { > + pdpe = pmap_large_map_pdpe(va); > + MPASS(*pdpe == 0); > + *pdpe = pa | pg_g | X86_PG_PS | X86_PG_RW | > + X86_PG_V | X86_PG_A | pg_nx | > + pmap_cache_bits(kernel_pmap, mattr, TRUE); > + inc = NBPDP; > + } else if (len >= NBPDR && (pa & PDRMASK) == 0 && > + (va & PDRMASK) == 0) { > + pde = pmap_large_map_pde(va); > + MPASS(*pde == 0); > + *pde = pa | pg_g | X86_PG_PS | X86_PG_RW | > + X86_PG_V | X86_PG_A | pg_nx | > + pmap_cache_bits(kernel_pmap, mattr, TRUE); > + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))-> > + wire_count++; > + inc = NBPDR; > + } else { > + pte = pmap_large_map_pte(va); > + MPASS(*pte == 0); > + *pte = pa | pg_g | X86_PG_RW | X86_PG_V | > + X86_PG_A | pg_nx | pmap_cache_bits(kernel_pmap, > + mattr, FALSE); > + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte))-> > + wire_count++; > + inc = PAGE_SIZE; > + } > + } > + PMAP_UNLOCK(kernel_pmap); > + MPASS(len == 0); > + > + *addr = (void *)vmem_res; > + return (0); > +} > + > +void > +pmap_large_unmap(void *svaa, vm_size_t len) > +{ > + vm_offset_t sva, va; > + vm_size_t inc; > + pdp_entry_t *pdpe, pdp; > + pd_entry_t *pde, pd; > + pt_entry_t *pte; > + vm_page_t m; > + struct spglist spgf; > + > + sva = (vm_offset_t)svaa; > + if (len == 0 || sva + len < sva || (sva >= DMAP_MIN_ADDRESS && > + sva + len <= DMAP_MIN_ADDRESS + dmaplimit)) > + return; > + > + SLIST_INIT(&spgf); > + KASSERT(LARGEMAP_MIN_ADDRESS <= sva && sva + len <= > + LARGEMAP_MAX_ADDRESS + NBPML4 * (u_long)lm_ents, > + ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len)); > + PMAP_LOCK(kernel_pmap); > + for (va = sva; va < sva + len; va += inc) { > + pdpe = pmap_large_map_pdpe(va); > + pdp = *pdpe; > + KASSERT((pdp & X86_PG_V) != 0, > + ("invalid pdp va %#lx pdpe %#lx pdp %#lx", va, > + (u_long)pdpe, pdp)); > + if ((pdp & X86_PG_PS) != 0) { > + KASSERT((amd_feature & AMDID_PAGE1GB) != 0, > + ("no 1G pages, va %#lx pdpe %#lx pdp %#lx", va, > + (u_long)pdpe, pdp)); > + KASSERT((va & PDPMASK) == 0, > + ("PDPMASK bit set, va %#lx pdpe %#lx pdp %#lx", va, > + (u_long)pdpe, pdp)); > + KASSERT(len <= NBPDP, > + ("len < NBPDP, sva %#lx va %#lx pdpe %#lx pdp %#lx " > + "len %#lx", sva, va, (u_long)pdpe, pdp, len)); > + *pdpe = 0; > + inc = NBPDP; > + continue; > + } > + pde = pmap_pdpe_to_pde(pdpe, va); > + pd = *pde; > + KASSERT((pd & X86_PG_V) != 0, > + ("invalid pd va %#lx pde %#lx pd %#lx", va, > + (u_long)pde, pd)); > + if ((pd & X86_PG_PS) != 0) { > + KASSERT((va & PDRMASK) == 0, > + ("PDRMASK bit set, va %#lx pde %#lx pd %#lx", va, > + (u_long)pde, pd)); > + KASSERT(len <= NBPDR, > + ("len < NBPDR, sva %#lx va %#lx pde %#lx pd %#lx " > + "len %#lx", sva, va, (u_long)pde, pd, len)); > + pde_store(pde, 0); > + inc = NBPDR; > + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); > + m->wire_count--; > + if (m->wire_count == 0) { > + *pdpe = 0; > + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); > + } > + continue; > + } > + pte = pmap_pde_to_pte(pde, va); > + KASSERT((*pte & X86_PG_V) != 0, > + ("invalid pte va %#lx pte %#lx pt %#lx", va, > + (u_long)pte, *pte)); > + pte_clear(pte); > + inc = PAGE_SIZE; > + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pte)); > + m->wire_count--; > + if (m->wire_count == 0) { > + *pde = 0; > + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); > + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); > + m->wire_count--; > + if (m->wire_count == 0) { > + *pdpe = 0; > + SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); > + } > + } > + } > + pmap_invalidate_range(kernel_pmap, sva, sva + len); > + PMAP_UNLOCK(kernel_pmap); > + vm_page_free_pages_toq(&spgf, false); > + vmem_free(large_vmem, sva, len); > +} > + > +static void > +pmap_large_map_wb_fence_mfence(void) > +{ > + > + mfence(); > +} > + > +static void > +pmap_large_map_wb_fence_sfence(void) > +{ > + > + sfence(); > +} > + > +static void > +pmap_large_map_wb_fence_nop(void) > +{ > +} > + > +DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void), static) > +{ > + > + if (cpu_vendor_id != CPU_VENDOR_INTEL) > + return (pmap_large_map_wb_fence_mfence); > + else if ((cpu_stdext_feature & (CPUID_STDEXT_CLWB | > + CPUID_STDEXT_CLFLUSHOPT)) == 0) > + return (pmap_large_map_wb_fence_sfence); > + else > + /* clflush is strongly enough ordered */ > + return (pmap_large_map_wb_fence_nop); > +} > + > +static void > +pmap_large_map_flush_range_clwb(vm_offset_t va, vm_size_t len) > +{ > + > + for (; len > 0; len -= cpu_clflush_line_size, > + va += cpu_clflush_line_size) > + clwb(va); > +} > + > +static void > +pmap_large_map_flush_range_clflushopt(vm_offset_t va, vm_size_t len) > +{ > + > + for (; len > 0; len -= cpu_clflush_line_size, > + va += cpu_clflush_line_size) > + clflushopt(va); > +} > + > +static void > +pmap_large_map_flush_range_clflush(vm_offset_t va, vm_size_t len) > +{ > + > + for (; len > 0; len -= cpu_clflush_line_size, > + va += cpu_clflush_line_size) > + clflush(va); > +} > + > +static void > +pmap_large_map_flush_range_nop(vm_offset_t sva __unused, vm_size_t len > __unused) > +{ > +} > + > +DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, > vm_size_t), > + static) > +{ > + > + if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) != 0) > + return (pmap_large_map_flush_range_clwb); > + else if ((cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0) > + return (pmap_large_map_flush_range_clflushopt); > + else if ((cpu_feature & CPUID_CLFSH) != 0) > + return (pmap_large_map_flush_range_clflush); > + else > + return (pmap_large_map_flush_range_nop); > +} > + > +static void > +pmap_large_map_wb_large(vm_offset_t sva, vm_offset_t eva) > +{ > + volatile u_long *pe; > + u_long p; > + vm_offset_t va; > + vm_size_t inc; > + bool seen_other; > + > + for (va = sva; va < eva; va += inc) { > + inc = 0; > + if ((amd_feature & AMDID_PAGE1GB) != 0) { > + pe = (volatile u_long *)pmap_large_map_pdpe(va); > + p = *pe; > + if ((p & X86_PG_PS) != 0) > + inc = NBPDP; > + } > + if (inc == 0) { > + pe = (volatile u_long *)pmap_large_map_pde(va); > + p = *pe; > + if ((p & X86_PG_PS) != 0) > + inc = NBPDR; > + } > + if (inc == 0) { > + pe = (volatile u_long *)pmap_large_map_pte(va); > + p = *pe; > + inc = PAGE_SIZE; > + } > + seen_other = false; > + for (;;) { > + if ((p & X86_PG_AVAIL1) != 0) { > + /* > + * Spin-wait for the end of a parallel > + * write-back. > + */ > + cpu_spinwait(); > + p = *pe; > + > + /* > + * If we saw other write-back > + * occuring, we cannot rely on PG_M to > + * indicate state of the cache. The > + * PG_M bit is cleared before the > + * flush to avoid ignoring new writes, > + * and writes which are relevant for > + * us might happen after. > + */ > + seen_other = true; > + continue; > + } > + > + if ((p & X86_PG_M) != 0 || seen_other) { > + if (!atomic_fcmpset_long(pe, &p, > + (p & ~X86_PG_M) | X86_PG_AVAIL1)) > + /* > + * If we saw PG_M without > + * PG_AVAIL1, and then on the > + * next attempt we do not > + * observe either PG_M or > + * PG_AVAIL1, the other > + * write-back started after us > + * and finished before us. We > + * can rely on it doing our > + * work. > + */ > + continue; > + pmap_large_map_flush_range(va, inc); > + atomic_clear_long(pe, X86_PG_AVAIL1); > + } > + break; > + } > + maybe_yield(); > + } > +} > + > +/* > + * Write-back cache lines for the given address range. > + * > + * Must be called only on the range or sub-range returned from > + * pmap_large_map(). Must not be called on the coalesced ranges. > + * > + * Does nothing on CPUs without CLWB, CLFLUSHOPT, or CLFLUSH > + * instructions support. > + */ > +void > +pmap_large_map_wb(void *svap, vm_size_t len) > +{ > + vm_offset_t eva, sva; > + > + sva = (vm_offset_t)svap; > + eva = sva + len; > + pmap_large_map_wb_fence(); > + if (sva >= DMAP_MIN_ADDRESS && eva <= DMAP_MIN_ADDRESS + dmaplimit) { > + pmap_large_map_flush_range(sva, len); > + } else { > + KASSERT(sva >= LARGEMAP_MIN_ADDRESS && > + eva <= LARGEMAP_MIN_ADDRESS + lm_ents * NBPML4, > + ("pmap_large_map_wb: not largemap %#lx %#lx", sva, len)); > + pmap_large_map_wb_large(sva, eva); > + } > + pmap_large_map_wb_fence(); > } > > static vm_page_t > > Modified: head/sys/amd64/include/pmap.h > ============================================================================== > --- head/sys/amd64/include/pmap.h Tue Oct 16 17:17:11 2018 (r339385) > +++ head/sys/amd64/include/pmap.h Tue Oct 16 17:28:10 2018 (r339386) > @@ -216,6 +216,10 @@ > #define KPML4I (NPML4EPG-1) > #define KPDPI (NPDPEPG-2) /* kernbase at -2GB */ > > +/* Large map: index of the first and max last pml4 entry */ > +#define LMSPML4I (PML4PML4I + 1) > +#define LMEPML4I (DMPML4I - 1) > + > /* > * XXX doesn't really belong here I guess... > */ > @@ -413,11 +417,16 @@ void pmap_bootstrap(vm_paddr_t *); > int pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde); > int pmap_change_attr(vm_offset_t, vm_size_t, int); > void pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t > invalidate); > +void pmap_flush_cache_range(vm_offset_t, vm_offset_t); > +void pmap_flush_cache_phys_range(vm_paddr_t, vm_paddr_t, vm_memattr_t); > void pmap_init_pat(void); > void pmap_kenter(vm_offset_t va, vm_paddr_t pa); > void *pmap_kenter_temporary(vm_paddr_t pa, int i); > vm_paddr_t pmap_kextract(vm_offset_t); > void pmap_kremove(vm_offset_t); > +int pmap_large_map(vm_paddr_t, vm_size_t, void **, vm_memattr_t); > +void pmap_large_map_wb(void *sva, vm_size_t len); > +void pmap_large_unmap(void *sva, vm_size_t len); > void *pmap_mapbios(vm_paddr_t, vm_size_t); > void *pmap_mapdev(vm_paddr_t, vm_size_t); > void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); > > Modified: head/sys/amd64/include/vmparam.h > ============================================================================== > --- head/sys/amd64/include/vmparam.h Tue Oct 16 17:17:11 2018 (r339385) > +++ head/sys/amd64/include/vmparam.h Tue Oct 16 17:28:10 2018 (r339386) > @@ -156,7 +156,9 @@ > * 0x0000000000000000 - 0x00007fffffffffff user map > * 0x0000800000000000 - 0xffff7fffffffffff does not exist (hole) > * 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB > slot) > - * 0xffff804020101000 - 0xfffff7ffffffffff unused > + * 0xffff804020100fff - 0xffff807fffffffff unused > + * 0xffff808000000000 - 0xffff847fffffffff large map (can be tuned up) > + * 0xffff848000000000 - 0xfffff7ffffffffff unused (large map extends > there) > * 0xfffff80000000000 - 0xfffffbffffffffff 4TB direct map > * 0xfffffc0000000000 - 0xfffffdffffffffff unused > * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map > @@ -172,6 +174,9 @@ > > #define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0) > #define DMAP_MAX_ADDRESS KVADDR(DMPML4I + NDMPML4E, 0, 0, 0) > + > +#define LARGEMAP_MIN_ADDRESS KVADDR(LMSPML4I, 0, 0, 0) > +#define LARGEMAP_MAX_ADDRESS KVADDR(LMEPML4I + 1, 0, 0, 0) > > #define KERNBASE KVADDR(KPML4I, KPDPI, 0, 0) > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Oct 17 10:31:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C16010D1570; Wed, 17 Oct 2018 10:31:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C74FD7B299; Wed, 17 Oct 2018 10:31:08 +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 C26682192; Wed, 17 Oct 2018 10:31:08 +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 w9HAV8S5055159; Wed, 17 Oct 2018 10:31:08 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HAV8jk055158; Wed, 17 Oct 2018 10:31:08 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810171031.w9HAV8jk055158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 17 Oct 2018 10:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339407 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339407 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.27 Precedence: list List-Id: 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, 17 Oct 2018 10:31:09 -0000 Author: bz Date: Wed Oct 17 10:31:08 2018 New Revision: 339407 URL: https://svnweb.freebsd.org/changeset/base/339407 Log: The countp argument passed to linker_file_lookup_set() in linker_load_dependencies() is unused, so no need to ask for the value in first place. Remove the unused "count" variable. Approved by: re (kib) Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Oct 17 04:10:23 2018 (r339406) +++ head/sys/kern/kern_linker.c Wed Oct 17 10:31:08 2018 (r339407) @@ -2123,7 +2123,7 @@ linker_load_dependencies(linker_file_t lf) const struct mod_depend *verinfo; modlist_t mod; const char *modname, *nmodname; - int ver, error = 0, count; + int ver, error = 0; /* * All files are dependent on /kernel. @@ -2136,7 +2136,7 @@ linker_load_dependencies(linker_file_t lf) return (error); } if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, - &count) != 0) + NULL) != 0) return (0); for (mdp = start; mdp < stop; mdp++) { mp = *mdp; From owner-svn-src-head@freebsd.org Wed Oct 17 14:51:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1773510D722D; Wed, 17 Oct 2018 14:51:44 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C107282AC9; Wed, 17 Oct 2018 14:51:43 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1FDE50A4; Wed, 17 Oct 2018 14:51:43 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9HEphbP089643; Wed, 17 Oct 2018 14:51:43 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HEph96089642; Wed, 17 Oct 2018 14:51:43 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810171451.w9HEph96089642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 17 Oct 2018 14:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339408 - head/lib/libc/stdtime X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/lib/libc/stdtime X-SVN-Commit-Revision: 339408 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.27 Precedence: list List-Id: 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, 17 Oct 2018 14:51:44 -0000 Author: yuripv Date: Wed Oct 17 14:51:43 2018 New Revision: 339408 URL: https://svnweb.freebsd.org/changeset/base/339408 Log: strptime: fix parsing of tm_year when both %C and %y appear in the format string in arbitrary order. This makes the related test cases in lib/libc/tests/time (not yet connected to the build) pass. While here, don't error on negative tm_year value based on the APPLICATION USAGE in http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html (glibc does the same): tm_year is a signed value; therefore, years before 1900 may be represented. Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17550 Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Wed Oct 17 10:31:08 2018 (r339407) +++ head/lib/libc/stdtime/strptime.c Wed Oct 17 14:51:43 2018 (r339408) @@ -95,6 +95,7 @@ _strptime(const char *buf, const char *fmt, struct tm int i, len; int flags; int Ealternative, Oalternative; + int century, year; const struct lc_time_T *tptr = __get_current_time_locale(locale); static int start_of_month[2][13] = { {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, @@ -102,6 +103,8 @@ _strptime(const char *buf, const char *fmt, struct tm }; flags = FLAG_NONE; + century = -1; + year = -1; ptr = fmt; while (*ptr != 0) { @@ -146,10 +149,8 @@ label: i += *buf - '0'; len--; } - if (i < 19) - return (NULL); - tm->tm_year = i * 100 - TM_YEAR_BASE; + century = i; flags |= FLAG_YEAR; break; @@ -527,13 +528,9 @@ label: len--; } if (c == 'Y') - i -= TM_YEAR_BASE; - if (c == 'y' && i < 69) - i += 100; - if (i < 0) - return (NULL); + century = i / 100; + year = i % 100; - tm->tm_year = i; flags |= FLAG_YEAR; break; @@ -609,6 +606,17 @@ label: default: return (NULL); } + } + + if (century != -1 || year != -1) { + if (year == -1) + year = 0; + if (century == -1) { + if (year < 69) + year += 100; + } else + year += century * 100 - TM_YEAR_BASE; + tm->tm_year = year; } if (!(flags & FLAG_YDAY) && (flags & FLAG_YEAR)) { From owner-svn-src-head@freebsd.org Wed Oct 17 16:11:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9BE510D8FA9; Wed, 17 Oct 2018 16:11:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75EAD85238; Wed, 17 Oct 2018 16:11:44 +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 70BBD5D6F; Wed, 17 Oct 2018 16:11:44 +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 w9HGBisv028388; Wed, 17 Oct 2018 16:11:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HGBhwc028383; Wed, 17 Oct 2018 16:11:43 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201810171611.w9HGBhwc028383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 17 Oct 2018 16:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339409 - in head: sys/kern sys/sys usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: sys/kern sys/sys usr.sbin/jail X-SVN-Commit-Revision: 339409 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.27 Precedence: list List-Id: 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, 17 Oct 2018 16:11:45 -0000 Author: jamie Date: Wed Oct 17 16:11:43 2018 New Revision: 339409 URL: https://svnweb.freebsd.org/changeset/base/339409 Log: Add a new jail permission, allow.read_msgbuf. When true, jailed processes can see the dmesg buffer (this is the current behavior). When false (the new default), dmesg will be unavailable to jailed users, whether root or not. The security.bsd.unprivileged_read_msgbuf sysctl still works as before, controlling system-wide whether non-root users can see the buffer. PR: 211580 Submitted by: bz Approved by: re@ (kib@) MFC after: 3 days Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_priv.c head/sys/kern/subr_prf.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Oct 17 14:51:43 2018 (r339408) +++ head/sys/kern/kern_jail.c Wed Oct 17 16:11:43 2018 (r339409) @@ -193,6 +193,7 @@ static struct bool_flags pr_flag_allow[NBBY * NBPW] = {"allow.mlock", "allow.nomlock", PR_ALLOW_MLOCK}, {"allow.reserved_ports", "allow.noreserved_ports", PR_ALLOW_RESERVED_PORTS}, + {"allow.read_msgbuf", "allow.noread_msgbuf", PR_ALLOW_READ_MSGBUF}, }; const size_t pr_flag_allow_size = sizeof(pr_flag_allow); @@ -3350,6 +3351,15 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_PROC_SETLOGINCLASS: return (0); + /* + * Do not allow a process inside a jail read the kernel + * message buffer unless explicitly permitted. + */ + case PRIV_MSGBUF: + if (cred->cr_prison->pr_allow & PR_ALLOW_READ_MSGBUF) + return (0); + return (EPERM); + default: /* * In all remaining cases, deny the privilege request. This @@ -3770,6 +3780,8 @@ SYSCTL_JAIL_PARAM(_allow, mlock, CTLTYPE_INT | CTLFLAG "B", "Jail may lock (unlock) physical pages in memory"); SYSCTL_JAIL_PARAM(_allow, reserved_ports, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may bind sockets to reserved ports"); +SYSCTL_JAIL_PARAM(_allow, read_msgbuf, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may read the kernel message buffer"); SYSCTL_JAIL_PARAM_SUBNODE(allow, mount, "Jail mount/unmount permission flags"); SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYPE_INT | CTLFLAG_RW, Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Wed Oct 17 14:51:43 2018 (r339408) +++ head/sys/kern/kern_priv.c Wed Oct 17 16:11:43 2018 (r339409) @@ -62,6 +62,11 @@ static int unprivileged_mlock = 1; SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_mlock, CTLFLAG_RWTUN, &unprivileged_mlock, 0, "Allow non-root users to call mlock(2)"); +static int unprivileged_read_msgbuf = 1; +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_read_msgbuf, + CTLFLAG_RW, &unprivileged_read_msgbuf, 0, + "Unprivileged processes may read the kernel message buffer"); + SDT_PROVIDER_DEFINE(priv); SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int"); SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__err, "int"); @@ -104,6 +109,17 @@ priv_check_cred(struct ucred *cred, int priv, int flag switch (priv) { case PRIV_VM_MLOCK: case PRIV_VM_MUNLOCK: + error = 0; + goto out; + } + } + + if (unprivileged_read_msgbuf) { + /* + * Allow an unprivileged user to read the kernel message + * buffer. + */ + if (priv == PRIV_MSGBUF) { error = 0; goto out; } Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Wed Oct 17 14:51:43 2018 (r339408) +++ head/sys/kern/subr_prf.c Wed Oct 17 16:11:43 2018 (r339409) @@ -1053,11 +1053,6 @@ msgbufinit(void *ptr, int size) oldp = msgbufp; } -static int unprivileged_read_msgbuf = 1; -SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_read_msgbuf, - CTLFLAG_RW, &unprivileged_read_msgbuf, 0, - "Unprivileged processes may read the kernel message buffer"); - /* Sysctls for accessing/clearing the msgbuf */ static int sysctl_kern_msgbuf(SYSCTL_HANDLER_ARGS) @@ -1066,11 +1061,9 @@ sysctl_kern_msgbuf(SYSCTL_HANDLER_ARGS) u_int seq; int error, len; - if (!unprivileged_read_msgbuf) { - error = priv_check(req->td, PRIV_MSGBUF); - if (error) - return (error); - } + error = priv_check(req->td, PRIV_MSGBUF); + if (error) + return (error); /* Read the whole buffer, one chunk at a time. */ mtx_lock(&msgbuf_lock); Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Wed Oct 17 14:51:43 2018 (r339408) +++ head/sys/sys/jail.h Wed Oct 17 16:11:43 2018 (r339409) @@ -228,9 +228,10 @@ struct prison_racct { #define PR_ALLOW_QUOTAS 0x00000020 #define PR_ALLOW_SOCKET_AF 0x00000040 #define PR_ALLOW_MLOCK 0x00000080 +#define PR_ALLOW_READ_MSGBUF 0x00000100 #define PR_ALLOW_RESERVED_PORTS 0x00008000 #define PR_ALLOW_KMEM_ACCESS 0x00010000 /* reserved, not used yet */ -#define PR_ALLOW_ALL_STATIC 0x000180ff +#define PR_ALLOW_ALL_STATIC 0x000181ff /* * OSD methods Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed Oct 17 14:51:43 2018 (r339408) +++ head/usr.sbin/jail/jail.8 Wed Oct 17 16:11:43 2018 (r339409) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2018 +.Dd October 17, 2018 .Dt JAIL 8 .Os .Sh NAME @@ -549,6 +549,11 @@ option. The jail root may administer quotas on the jail's filesystem(s). This includes filesystems that the jail may share with other jails or with non-jailed parts of the system. +.It Va allow.read_msgbuf +Jailed users may read the kernel message buffer. +If the +.Va security.bsd.unprivileged_read_msgbuf +MIB entry is zero, this will be restricted to to root user. .It Va allow.socket_af Sockets within a jail are normally restricted to IPv4, IPv6, local (UNIX), and route. This allows access to other protocol stacks that From owner-svn-src-head@freebsd.org Wed Oct 17 16:38:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6014C10D9884; Wed, 17 Oct 2018 16:38:45 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14A1F8616F; Wed, 17 Oct 2018 16:38:45 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ECFE60FE; Wed, 17 Oct 2018 16:38:45 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9HGciFl042390; Wed, 17 Oct 2018 16:38:44 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HGcir7042389; Wed, 17 Oct 2018 16:38:44 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810171638.w9HGcir7042389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 17 Oct 2018 16:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339412 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 339412 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.27 Precedence: list List-Id: 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, 17 Oct 2018 16:38:45 -0000 Author: yuripv Date: Wed Oct 17 16:38:44 2018 New Revision: 339412 URL: https://svnweb.freebsd.org/changeset/base/339412 Log: Revert r315571 for share/timedef/ca_IT.ISO8859-15.src, ca_IT is Catalan in Italy, and is not related to Canada. While here, remove the header as we do NOT currently use CLDR data to generate timedef, and it's misleading. PR: 225855 Reviewed by: bapt Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17551 Modified: head/share/timedef/ca_IT.ISO8859-15.src Modified: head/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/ca_IT.ISO8859-15.src Wed Oct 17 16:17:57 2018 (r339411) +++ head/share/timedef/ca_IT.ISO8859-15.src Wed Oct 17 16:38:44 2018 (r339412) @@ -1,7 +1,3 @@ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. The data is obtained from the -# CLDR project, obtained from http://cldr.unicode.org/ -# ----------------------------------------------------------------------------- # # Short month names gen. @@ -53,7 +49,7 @@ dissabte %H:%M:%S # # x_fmt -%Y-%m-%d +%d/%m/%Y # # c_fmt %a %e %b %X %Y From owner-svn-src-head@freebsd.org Wed Oct 17 16:49:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1397110D9CBF; Wed, 17 Oct 2018 16:49:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC6FC866D9; Wed, 17 Oct 2018 16:49:12 +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 90CFA6297; Wed, 17 Oct 2018 16:49:12 +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 w9HGnCQq047291; Wed, 17 Oct 2018 16:49:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HGnBZg047286; Wed, 17 Oct 2018 16:49:11 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810171649.w9HGnBZg047286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 17 Oct 2018 16:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339413 - in head: libexec libexec/rc libexec/rc/rc.d sbin/init sbin/init/rc.d X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: libexec libexec/rc libexec/rc/rc.d sbin/init sbin/init/rc.d X-SVN-Commit-Revision: 339413 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.27 Precedence: list List-Id: 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, 17 Oct 2018 16:49:13 -0000 Author: bz Date: Wed Oct 17 16:49:11 2018 New Revision: 339413 URL: https://svnweb.freebsd.org/changeset/base/339413 Log: Move the rc framework out of sbin/init into libexec/rc. The reasons for this are forward looking to pkgbase: * /sbin/init is a special binary; try not to replace it with every package update because an rc script was touched. (a follow-up commit will make init its own package) * having rc in its own place will allow more easy replacement of the rc framework with alternatives, such as openrc. Discussed with: brd (during BSDCam), kmoore Requested by: cem, bz PR: 231522 Approved by: re (gjb) Added: head/libexec/rc/ head/libexec/rc/Makefile (contents, props changed) head/libexec/rc/netstart - copied unchanged from r339412, head/sbin/init/netstart head/libexec/rc/network.subr - copied unchanged from r339412, head/sbin/init/network.subr head/libexec/rc/pccard_ether - copied unchanged from r339412, head/sbin/init/pccard_ether head/libexec/rc/rc - copied unchanged from r339412, head/sbin/init/rc head/libexec/rc/rc.conf - copied unchanged from r339412, head/sbin/init/rc.conf head/libexec/rc/rc.d/ - copied from r339412, head/sbin/init/rc.d/ head/libexec/rc/rc.initdiskless - copied unchanged from r339412, head/sbin/init/rc.initdiskless head/libexec/rc/rc.resume - copied unchanged from r339412, head/sbin/init/rc.resume head/libexec/rc/rc.shutdown - copied unchanged from r339412, head/sbin/init/rc.shutdown head/libexec/rc/rc.subr - copied unchanged from r339412, head/sbin/init/rc.subr head/libexec/rc/rc.suspend - copied unchanged from r339412, head/sbin/init/rc.suspend Deleted: head/sbin/init/netstart head/sbin/init/network.subr head/sbin/init/pccard_ether head/sbin/init/rc head/sbin/init/rc.conf head/sbin/init/rc.d/ head/sbin/init/rc.initdiskless head/sbin/init/rc.resume head/sbin/init/rc.shutdown head/sbin/init/rc.subr head/sbin/init/rc.suspend Modified: head/libexec/Makefile head/libexec/rc/rc.d/Makefile head/sbin/init/Makefile Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Wed Oct 17 16:38:44 2018 (r339412) +++ head/libexec/Makefile Wed Oct 17 16:49:11 2018 (r339413) @@ -13,6 +13,7 @@ SUBDIR= ${_atf} \ ${_makewhatis.local} \ ${_mknetid} \ ${_pppoed} \ + rc \ revnetgroup \ ${_rlogind} \ rpc.rquotad \ Added: head/libexec/rc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/Makefile Wed Oct 17 16:49:11 2018 (r339413) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS +CONFETCDIR= /etc +CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown +CONFETCMODE= 644 +CONFETCEXEC= netstart pccard_ether rc.resume rc.suspend +CONFETCEXECDIR= /etc +CONFETCEXECMODE= 755 +CONFETCDEFAULTSDIR= /etc/defaults +CONFETCDEFAULTS= rc.conf +PACKAGE=rc + +SUBDIR+= rc.d + +.include Copied: head/libexec/rc/netstart (from r339412, head/sbin/init/netstart) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/netstart Wed Oct 17 16:49:11 2018 (r339413, copy of r339412, head/sbin/init/netstart) @@ -0,0 +1,57 @@ +#!/bin/sh - +# +# Copyright (c) 1993 The FreeBSD Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 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$ +# From: @(#)netstart 5.9 (Berkeley) 3/30/91 +# + +# This file is NOT called by any of the other scripts - it has been +# obsoleted by /etc/rc.d/* and is provided here only for user +# convenience (if you're sitting in single user mode and wish to start +# the network by hand, this script will do it for you). +# + +_start=quietstart + +/etc/rc.d/devd ${_start} +/etc/rc.d/hostid ${_start} +/etc/rc.d/hostname ${_start} +/etc/rc.d/ipmon ${_start} +/etc/rc.d/ipfilter ${_start} +/etc/rc.d/ipnat ${_start} +/etc/rc.d/ipfs ${_start} +/etc/rc.d/sppp ${_start} +/etc/rc.d/netif ${_start} +/etc/rc.d/ipsec ${_start} +/etc/rc.d/ppp ${_start} +/etc/rc.d/ipfw ${_start} +/etc/rc.d/routing ${_start} +/etc/rc.d/route6d ${_start} +/etc/rc.d/routed ${_start} +/etc/rc.d/rtsold ${_start} +/etc/rc.d/nisdomain ${_start} + +exit 0 Copied: head/libexec/rc/network.subr (from r339412, head/sbin/init/network.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rc/network.subr Wed Oct 17 16:49:11 2018 (r339413, copy of r339412, head/sbin/init/network.subr) @@ -0,0 +1,1793 @@ +# +# Copyright (c) 2003 The FreeBSD Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 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 PROJECT AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT 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$ +# +IFCONFIG_CMD="/sbin/ifconfig" +: ${netif_ipexpand_max:=2048} + +# +# Subroutines commonly used from network startup scripts. +# Requires that rc.conf be loaded first. +# + +# ifn_start ifn +# Bring up and configure an interface. If some configuration is +# applied, print the interface configuration. +# +ifn_start() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_start called without an interface" + + ifscript_up ${ifn} && cfg=0 + ifconfig_up ${ifn} && cfg=0 + if ! noafif $ifn; then + afexists inet && ipv4_up ${ifn} && cfg=0 + afexists inet6 && ipv6_up ${ifn} && cfg=0 + fi + childif_create ${ifn} && cfg=0 + + return $cfg +} + +# ifn_stop ifn +# Shutdown and de-configure an interface. If action is taken, +# print the interface name. +# +ifn_stop() +{ + local ifn cfg + ifn="$1" + cfg=1 + + [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" + + if ! noafif $ifn; then + afexists inet6 && ipv6_down ${ifn} && cfg=0 + afexists inet && ipv4_down ${ifn} && cfg=0 + fi + ifconfig_down ${ifn} && cfg=0 + ifscript_down ${ifn} && cfg=0 + childif_destroy ${ifn} && cfg=0 + + return $cfg +} + +# ifn_vnetup ifn +# Move ifn to the specified vnet jail. +# +ifn_vnetup() +{ + + ifn_vnet0 $1 vnet +} + +# ifn_vnetdown ifn +# Reclaim ifn from the specified vnet jail. +# +ifn_vnetdown() +{ + + ifn_vnet0 $1 -vnet +} + +# ifn_vnet0 ifn action +# Helper function for ifn_vnetup and ifn_vnetdown. +# +ifn_vnet0() +{ + local _ifn _cfg _action _vnet + _ifn="$1" + _action="$2" + _cfg=1 + + if _vnet=$(vnetif $_ifn); then + ${IFCONFIG_CMD} $_ifn $_action $_vnet && _cfg=0 + fi + + return $_cfg +} + +# ifconfig_up if +# Evaluate ifconfig(8) arguments for interface $if and +# run ifconfig(8) with those arguments. It returns 0 if +# arguments were found and executed or 1 if the interface +# had no arguments. Pseudo arguments DHCP and WPA are handled +# here. +# +ifconfig_up() +{ + local _cfg _ifconfig_descr _ipv6_opts ifconfig_args + _cfg=1 + + # Make sure lo0 always comes up. + if [ "$1" = "lo0" ]; then + _cfg=0 + fi + + # inet6 specific + if ! noafif $1 && afexists inet6; then + if checkyesno ipv6_activate_all_interfaces; then + _ipv6_opts="-ifdisabled" + elif [ "$1" != "lo0" ]; then + _ipv6_opts="ifdisabled" + fi + + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + ;; + *) + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; + esac + ;; + esac + + case $ipv6_cpe_wanif in + $1) + _ipv6_opts="${_ipv6_opts} -no_radr accept_rtadv" + ;; + esac + + if [ -n "${_ipv6_opts}" ]; then + ${IFCONFIG_CMD} $1 inet6 ${_ipv6_opts} + fi + fi + + # ifconfig_IF + ifconfig_args=`ifconfig_getargs $1` + if [ -n "${ifconfig_args}" ]; then + eval ${IFCONFIG_CMD} $1 ${ifconfig_args} + _cfg=0 + fi + + # inet6 specific + if ! noafif $1 && afexists inet6; then + # ifconfig_IF_ipv6 + ifconfig_args=`ifconfig_getargs $1 ipv6` + if [ -n "${ifconfig_args}" ]; then + # backward compatibility: inet6 keyword + case "${ifconfig_args}" in + :*|[0-9a-fA-F]*:*) + warn "\$ifconfig_$1_ipv6 needs leading" \ + "\"inet6\" keyword for an IPv6 address." + ifconfig_args="inet6 ${ifconfig_args}" + ;; + esac + ${IFCONFIG_CMD} $1 inet6 -ifdisabled + eval ${IFCONFIG_CMD} $1 ${ifconfig_args} + _cfg=0 + fi + + # $ipv6_prefix_IF will be handled in + # ipv6_prefix_hostid_addr_common(). + ifconfig_args=`get_if_var $1 ipv6_prefix_IF` + if [ -n "${ifconfig_args}" ]; then + ${IFCONFIG_CMD} $1 inet6 -ifdisabled + _cfg=0 + fi + + # backward compatibility: $ipv6_ifconfig_IF + ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` + if [ -n "${ifconfig_args}" ]; then + warn "\$ipv6_ifconfig_$1 is obsolete." \ + " Use ifconfig_$1_ipv6 instead." + ${IFCONFIG_CMD} $1 inet6 -ifdisabled + eval ${IFCONFIG_CMD} $1 inet6 ${ifconfig_args} + _cfg=0 + fi + fi + + ifalias $1 link alias + ifalias $1 ether alias + + _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr` + if [ -n "${_ifconfig_descr}" ]; then + ${IFCONFIG_CMD} $1 description "${_ifconfig_descr}" + fi + + if wpaif $1; then + /etc/rc.d/wpa_supplicant start $1 + _cfg=0 # XXX: not sure this should count + elif hostapif $1; then + /etc/rc.d/hostapd start $1 + _cfg=0 + elif [ ${_cfg} -eq 0 ]; then + ${IFCONFIG_CMD} $1 up + fi + + if dhcpif $1; then + if [ $_cfg -ne 0 ] ; then + ${IFCONFIG_CMD} $1 up + fi + if syncdhcpif $1; then + /etc/rc.d/dhclient start $1 + fi + _cfg=0 + fi + + return $_cfg +} + +# ifconfig_down if +# returns 1 if wpa_supplicant or dhclient was stopped or +# the interface exists. +# +ifconfig_down() +{ + local _cfg + _cfg=1 + + if wpaif $1; then + /etc/rc.d/wpa_supplicant stop $1 + _cfg=0 + elif hostapif $1; then + /etc/rc.d/hostapd stop $1 + _cfg=0 + fi + + if dhcpif $1; then + /etc/rc.d/dhclient stop $1 + _cfg=0 + fi + + if ifexists $1; then + ${IFCONFIG_CMD} $1 down + _cfg=0 + fi + + return $_cfg +} + +# get_if_var if var [default] +# Return the value of the pseudo-hash corresponding to $if where +# $var is a string containg the sub-string "IF" which will be +# replaced with $if after the characters defined in _punct are +# replaced with '_'. If the variable is unset, replace it with +# $default if given. +get_if_var() +{ + local _if _punct _punct_c _var _default prefix suffix + + if [ $# -ne 2 -a $# -ne 3 ]; then + err 3 'USAGE: get_if_var name var [default]' + fi + + _if=$1 + _punct=".-/+" + ltr ${_if} "${_punct}" '_' _if + _var=$2 + _default=$3 + + prefix=${_var%%IF*} + suffix=${_var##*IF} + eval echo \${${prefix}${_if}${suffix}-${_default}} +} + +# _ifconfig_getargs if [af] +# Prints the arguments for the supplied interface to stdout. +# Returns 1 if empty. In general, ifconfig_getargs should be used +# outside this file. +_ifconfig_getargs() +{ + local _ifn _af + _ifn=$1 + _af=${2+_$2} + + if [ -z "$_ifn" ]; then + return 1 + fi + + get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT" +} + +# ifconfig_getargs if [af] +# Takes the result from _ifconfig_getargs and removes pseudo +# args such as DHCP and WPA. +ifconfig_getargs() +{ + local _tmpargs _arg _args _vnet + _tmpargs=`_ifconfig_getargs $1 $2` + if [ $? -eq 1 ]; then + return 1 + fi + _args= + _vnet=0 + + for _arg in $_tmpargs; do + case $_arg:$_vnet in + [Dd][Hh][Cc][Pp]:0) ;; + [Nn][Oo][Aa][Uu][Tt][Oo]:0) ;; + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; + [Ww][Pp][Aa]:0) ;; + [Hh][Oo][Ss][Tt][Aa][Pp]:0) ;; + vnet:0) _vnet=1 ;; + *:1) _vnet=0 ;; + *:0) + _args="$_args $_arg" + ;; + esac + done + + echo $_args +} + +# autoif +# Returns 0 if the interface should be automatically configured at +# boot time and 1 otherwise. +autoif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + for _arg in $_tmpargs; do + case $_arg in + [Nn][Oo][Aa][Uu][Tt][Oo]) + return 1 + ;; + esac + done + + return 0 +} + +# dhcpif if +# Returns 0 if the interface is a DHCP interface and 1 otherwise. +dhcpif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + case $1 in + lo[0-9]*|\ + stf[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) + return 1 + ;; + esac + if noafif $1; then + return 1 + fi + + for _arg in $_tmpargs; do + case $_arg in + [Dd][Hh][Cc][Pp]) + return 0 + ;; + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) + return 0 + ;; + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) + return 0 + ;; + esac + done + + return 1 +} + +# syncdhcpif +# Returns 0 if the interface should be configured synchronously and +# 1 otherwise. +syncdhcpif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + if noafif $1; then + return 1 + fi + + for _arg in $_tmpargs; do + case $_arg in + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) + return 1 + ;; + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) + return 0 + ;; + esac + done + + checkyesno synchronous_dhclient +} + +# wpaif if +# Returns 0 if the interface is a WPA interface and 1 otherwise. +wpaif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + for _arg in $_tmpargs; do + case $_arg in + [Ww][Pp][Aa]) + return 0 + ;; + esac + done + + return 1 +} + +# hostapif if +# Returns 0 if the interface is a HOSTAP interface and 1 otherwise. +hostapif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + for _arg in $_tmpargs; do + case $_arg in + [Hh][Oo][Ss][Tt][Aa][Pp]) + return 0 + ;; + esac + done + + return 1 +} + +# vnetif if +# Returns 0 and echo jail if "vnet" keyword is specified on the +# interface, and 1 otherwise. +vnetif() +{ + local _tmpargs _arg _vnet + _tmpargs=`_ifconfig_getargs $1` + + _vnet=0 + for _arg in $_tmpargs; do + case $_arg:$_vnet in + vnet:0) _vnet=1 ;; + *:1) echo $_arg; return 0 ;; + esac + done + + return 1 +} + +# afexists af +# Returns 0 if the address family is enabled in the kernel +# 1 otherwise. +afexists() +{ + local _af + _af=$1 + + case ${_af} in + inet|inet6) + check_kern_features ${_af} + ;; + link|ether) + return 0 + ;; + *) + err 1 "afexists(): Unsupported address family: $_af" + ;; + esac +} + +# noafif if +# Returns 0 if the interface has no af configuration and 1 otherwise. +noafif() +{ + local _if + _if=$1 + + case $_if in + pflog[0-9]*|\ + pfsync[0-9]*|\ + usbus[0-9]*|\ + an[0-9]*|\ + ath[0-9]*|\ + ipw[0-9]*|\ + ipfw[0-9]*|\ + iwi[0-9]*|\ + iwn[0-9]*|\ + ral[0-9]*|\ + wi[0-9]*|\ + wl[0-9]*|\ + wpi[0-9]*) + return 0 + ;; + esac + + return 1 +} + +# ipv6if if +# Returns 0 if the interface should be configured for IPv6 and +# 1 otherwise. +ipv6if() +{ + local _if _tmpargs i + _if=$1 + + if ! afexists inet6; then + return 1 + fi + + # lo0 is always IPv6-enabled + case $_if in + lo0) + return 0 + ;; + esac + + case "${ipv6_network_interfaces}" in + $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) + # True if $ifconfig_IF_ipv6 is defined. + _tmpargs=`_ifconfig_getargs $_if ipv6` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + + # True if $ipv6_prefix_IF is defined. + _tmpargs=`get_if_var $_if ipv6_prefix_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + + # backward compatibility: True if $ipv6_ifconfig_IF is defined. + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + ;; + esac + + return 1 +} + +# ipv6_autoconfif if +# Returns 0 if the interface should be configured for IPv6 with +# Stateless Address Configuration; 1 otherwise. +ipv6_autoconfif() +{ + local _if _tmpargs _arg + _if=$1 + + case $_if in + lo[0-9]*|\ + stf[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) + return 1 + ;; + esac + if noafif $_if; then + return 1 + fi + if ! ipv6if $_if; then + return 1 + fi + if checkyesno ipv6_gateway_enable; then + return 1 + fi + _tmpargs=`get_if_var $_if ipv6_prefix_IF` + if [ -n "${_tmpargs}" ]; then + return 1 + fi + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + if checkyesno ipv6_gateway_enable; then + return 1 + fi + case $1 in + bridge[0-9]*) + # No accept_rtadv by default on if_bridge(4) + # to avoid a conflict with the member + # interfaces. + return 1 + ;; + *) + return 0 + ;; + esac + ;; + esac + + _tmpargs=`_ifconfig_getargs $_if ipv6` + for _arg in $_tmpargs; do + case $_arg in + accept_rtadv) + return 0 + ;; + esac + done + + # backward compatibility: $ipv6_ifconfig_IF + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` + for _arg in $_tmpargs; do + case $_arg in + accept_rtadv) + return 0 + ;; + esac + done + + return 1 +} + +# ifexists if +# Returns 0 if the interface exists and 1 otherwise. +ifexists() +{ + [ -z "$1" ] && return 1 + ${IFCONFIG_CMD} -n $1 > /dev/null 2>&1 +} + +# ipv4_up if +# add IPv4 addresses to the interface $if +ipv4_up() +{ + local _if _ret + _if=$1 + _ret=1 + + # Add 127.0.0.1/8 to lo0 unless otherwise specified. + if [ "${_if}" = "lo0" ]; then + ifconfig_args=`get_if_var ${_if} ifconfig_IF` + if [ -z "${ifconfig_args}" ]; then + ${IFCONFIG_CMD} ${_if} inet 127.0.0.1/8 alias + fi + fi + ifalias ${_if} inet alias && _ret=0 + + return $_ret +} + +# ipv6_up if +# add IPv6 addresses to the interface $if +ipv6_up() +{ + local _if _ret + _if=$1 + _ret=1 + + if ! ipv6if $_if; then + return 0 + fi + + ifalias ${_if} inet6 alias && _ret=0 + ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 + ipv6_accept_rtadv_up ${_if} && _ret=0 + + return $_ret +} + +# ipv4_down if +# remove IPv4 addresses from the interface $if +ipv4_down() +{ + local _if _ifs _ret inetList oldifs _inet + _if=$1 + _ifs="^" + _ret=1 + + ifalias ${_if} inet -alias && _ret=0 + + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet ' | tr "\n\t" "$_ifs"`" + + oldifs="$IFS" + IFS="$_ifs" + for _inet in $inetList ; do + # get rid of extraneous line + case $_inet in + inet\ *) ;; + *) continue ;; + esac + + _inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` + + IFS="$oldifs" + ${IFCONFIG_CMD} ${_if} ${_inet} delete + IFS="$_ifs" + _ret=0 + done + IFS="$oldifs" + + return $_ret +} + +# ipv6_down if +# remove IPv6 addresses from the interface $if +ipv6_down() +{ + local _if _ifs _ret inetList oldifs _inet6 + _if=$1 + _ifs="^" + _ret=1 + + if ! ipv6if $_if; then + return 0 + fi + + ipv6_accept_rtadv_down ${_if} && _ret=0 + ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0 + ifalias ${_if} inet6 -alias && _ret=0 + + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet6 ' | tr "\n\t" "$_ifs"`" + + oldifs="$IFS" + IFS="$_ifs" + for _inet6 in $inetList ; do + # get rid of extraneous line + case $_inet6 in + inet6\ *) ;; + *) continue ;; + esac + + _inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'` + + IFS="$oldifs" + ${IFCONFIG_CMD} ${_if} ${_inet6} -alias + IFS="$_ifs" + _ret=0 + done + IFS="$oldifs" + + return $_ret +} + +# ifalias if af action +# Configure or remove aliases for network interface $if. +# It returns 0 if at least one alias was configured or +# removed, or 1 if there were none. +# +ifalias() +{ + local _ret + _ret=1 + + afexists $2 || return $_ret + + case "$2" in + inet|inet6|link|ether) + ifalias_af_common $1 $2 $3 && _ret=0 + ;; + esac + + return $_ret +} + +# ifalias_expand_addr af action addr +# Expand address range ("N-M") specification in addr. +# "addr" must not include an address-family keyword. +# The results will include an address-family keyword. +# +ifalias_expand_addr() +{ + local _af _action + + _af=$1 + _action=$2 + shift 2 + + afexists $_af || return + ifalias_expand_addr_$_af $_action $* +} + +# ifalias_expand_addr_inet action addr +# Helper function for ifalias_expand_addr(). Handles IPv4. +# +ifalias_expand_addr_inet() +{ + local _action _arg _cidr _cidr_addr _exargs + local _ipaddr _plen _range _iphead _iptail _iplow _iphigh _ipcount + local _retstr _c + _action=$1 + _arg=$2 + shift 2 + _exargs=$* + _retstr= + + case $_action:$_arg:$_exargs in + *:*--*) return ;; # invalid + tmp:*[0-9]-[0-9]*:*) # to be expanded + _action="alias" + ;; + *:*[0-9]-[0-9]*:*) # to be expanded + ;; + tmp:*:*netmask*) # already expanded w/ netmask option + echo ${_arg%/[0-9]*} $_exargs && return + ;; + tmp:*:*) # already expanded w/o netmask option + echo $_arg $_exargs && return + ;; + *:*:*netmask*) # already expanded w/ netmask option + echo inet ${_arg%/[0-9]*} $_exargs && return + ;; + *:*:*) # already expanded w/o netmask option + echo inet $_arg $_exargs && return + ;; + esac + + for _cidr in $_arg; do + _ipaddr=${_cidr%%/*} + _plen=${_cidr##*/} + # When subnet prefix length is not specified, use /32. + case $_plen in + $_ipaddr) _plen=32 ;; # "/" character not found + esac + + OIFS=$IFS + IFS=. set -- $_ipaddr + _range= + _iphead= + _iptail= + for _c in $@; do + case $_range:$_c in + :[0-9]*-[0-9]*) + _range=$_c + ;; + :*) + _iphead="${_iphead}${_iphead:+.}${_c}" + ;; + *:*) + _iptail="${_iptail}${_iptail:+.}${_c}" + ;; + esac + done + IFS=$OIFS + _iplow=${_range%-*} + _iphigh=${_range#*-} + + # clear netmask when removing aliases + if [ "$_action" = "-alias" ]; then + _plen="" + fi + + _ipcount=$_iplow + while [ "$_ipcount" -le "$_iphigh" ]; do + _retstr="${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen}" + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ]; then + warn "Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. Increase \$netif_ipexpand_max in rc.conf." + break + else + _ipcount=$(($_ipcount + 1)) + fi + # Forcibly set /32 for remaining aliases. + _plen=32 + done + done + + for _c in $_retstr; do + ifalias_expand_addr_inet $_action $_c $_exargs + done +} + +# ifalias_expand_addr_inet6 action addr +# Helper function for ifalias_expand_addr(). Handles IPv6. +# +ifalias_expand_addr_inet6() +{ + local _action _arg _cidr _cidr_addr _exargs + local _ipaddr _plen _ipleft _ipright _iplow _iphigh _ipcount + local _ipv4part + local _retstr _c + _action=$1 + _arg=$2 + shift 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Oct 17 16:54:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A05E610DA065; Wed, 17 Oct 2018 16:54:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5135C86C9A; Wed, 17 Oct 2018 16:54:14 +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 4BC946476; Wed, 17 Oct 2018 16:54:14 +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 w9HGsEZG052296; Wed, 17 Oct 2018 16:54:14 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9HGsExr052295; Wed, 17 Oct 2018 16:54:14 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810171654.w9HGsExr052295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 17 Oct 2018 16:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339414 - head/sbin/tunefs X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sbin/tunefs X-SVN-Commit-Revision: 339414 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.27 Precedence: list List-Id: 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, 17 Oct 2018 16:54:14 -0000 Author: bz Date: Wed Oct 17 16:54:13 2018 New Revision: 339414 URL: https://svnweb.freebsd.org/changeset/base/339414 Log: Fix spelling of an error message and add warning to another error case in tunefs(8). Reviewed by: imp (2017 version of the same diff) Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D10046 Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Wed Oct 17 16:49:11 2018 (r339413) +++ head/sbin/tunefs/tunefs.c Wed Oct 17 16:54:13 2018 (r339414) @@ -377,7 +377,7 @@ main(int argc, char *argv[]) warnx("%s cannot be enabled until fsck is run", name); } else if (journal_alloc(Svalue) != 0) { - warnx("%s can not be enabled", name); + warnx("%s cannot be enabled", name); } else { sblock.fs_flags |= FS_DOSOFTDEP | FS_SUJ; warnx("%s set", name); @@ -966,8 +966,10 @@ journal_alloc(int64_t size) * If the journal file exists we can't allocate it. */ ino = journal_findfile(); - if (ino == (ino_t)-1) + if (ino == (ino_t)-1) { + warnx("journal_findfile() failed."); return (-1); + } if (ino > 0) { warnx("Journal file %s already exists, please remove.", SUJ_FILE); From owner-svn-src-head@freebsd.org Wed Oct 17 16:59:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A771310DA12A; Wed, 17 Oct 2018 16:59:05 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 114EF86E60; Wed, 17 Oct 2018 16:59:04 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w9HGwsBp007309 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NOT); Wed, 17 Oct 2018 09:58:55 -0700 Subject: Re: svn commit: r339413 - in head: libexec libexec/rc libexec/rc/rc.d sbin/init sbin/init/rc.d To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810171649.w9HGnBZg047286@repo.freebsd.org> From: Nathan Whitehorn Openpgp: preference=signencrypt Autocrypt: addr=nwhitehorn@freebsd.org; keydata= xsFNBFuARN8BEADLKYsG3l1aq/M21R59I/5EsEfvtvd15ZJ9lDHcWPuxzIfGnu2LMpe5PrFP e/Y4bcsPrlB4S3I3ooIUDvoEEsDeqgqlZod3QevOK/RjLqiqx1i/4mKnobJ++3ppyVVIccgN sUrj786OYCFCI/W+uWw7cbKewNeaL//Z/TDKlHLkssiy6qmZbNQ0ZjcMLJKUesk4eVg2TtTD HNe42ZuxbUC9iLYieO4c7kQB4qiFhagDRiObXrLzvm2MQYeAaNVRqID+mfI75TWrQ+t98iVu mHvFu461eeteq59jg6H/IL07ACxL+HzEVM+D6tPtPrz7ppr3wiZL5Cu17yu0nAx0nhJTV8ZB qza1rOVun0x65S14L41XD2HkmBDxTaRlTg8ypnkLFo8kh+MEq4k67apL/DUGcaUjKy2TVUC7 3igLO/DwQHrkWx2RrOmS3xS0TgGXVmB47nq2Zveo3fcjporQK63n2sbLkS70cfAJAJ9KHEIx u9am44iW5Ku3+mVLgQYybtcUxlk/Jw/BA5V6KUcDQMd5kTm0MyagziqMaT+57ceYxwRBK4HC DCLRpSOHV81/YzyL5vnwfHsxADm3091rd0uwr8uRCQn7wLvlcFyp/JKSFkVnE1oo7UE4QQJZ GbSJyvj7GdXu0LdghALcMj/thdb+js4D3UuCaAMecgVSscxEIQARAQABzS5OYXRoYW4gV2hp dGVob3JuIDxud2hpdGVob3JuQGljZWN1YmUud2lzYy5lZHU+wsGOBBMBCAA4FiEEPWQg+qgh ST6Avw1hOLZNlGaE6HcFAluAUl4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOLZN lGaE6HeHFw//fN2CzkiW1yedjLGEQ3uXRMgu6geRgWdtkgg/pOhn5OLSQI4R59kjvHNHHqln 1QYdxe63lsbe+7CRsTKuke3/mgsQ1h6n7cCzsoXVP3eLtWjshAz7spwUcdRRFTSbwkMzKcRn plpr+ByZDw98vnpQo10J5xYmf6if6wcEpVlazwnC5G1gHktM4X0jrlAUKSgVx7MG8o4G6af9 7MQJINAG6g6+BlBH3u5fmPunKi9qgHsZxKnTZneD2mO5u2x6p1qmqybvfvWI5UEvktPeEext JBeXXqdex+HWmAbLYznLUoBloBl+fW5Lo9VapkcGubvGC0WLr/gYuamAApwoFpa4/SBqgmHr JSsPqoDtheWt9oYzuYkYW5+tpJQoDVdG3KCOQJSYZIbNT8HyviFY32ZSn6gIn2qP/5E+rA8J +6/57XCZXPazE4FiPNbwY/OwZoi7w0yRKcdmJoSoC/GdjtQbjyeARbAaHIcudeU/bB3paGS2 rHkoW4iR5TnK/V/QJvNT4KC6Dw3m6pfBIzsF+smcyjz+MzBFQNvSOtG4kJQooKcMsThas8oX VTx+WsqNAVOeQKTOU74jlUYKm5+w5aIOJbc8jg1LlTWJus1SxYtxT9lgNwOCUhE/j6Ueq9jG V9POWg31C44akWmnK8rS4PImUBsPKwtxUNM6BhfZRbtIjQ7OwU0EW4BFQQEQAOLKFtg6us0A LA7LtvjxIskIgqFJjHw2ka/UtdJ432P9kvmBq7z4v0+m/gkxCOOG0yDi2Cv/ALJobsyb56tb U6MU0SRjTio35S2jit369B1BDC2TLNF337sUquUx0l4wkEXEBefvLRYouF8BRbkgjveg7sA4 NjsiduQx92vPJnBoaH2OWxqDbr5X6kF5cx9jPrKUJ4ZqH/raE/SSDhtow4aKO0nWbteVGck1 5W1X/S8KziPXKazxCQ8qprQRTAehsdG/bSbWD95hp3TAlEbl4N4UqqS7n4jCZunCeii2TDZH Vvx/lpFAT2ezx646p2PUmH5hpiVMgbY5uHcyahwNf+eNOO7gotnNYoieoLw4fUeTYOq+s3IN isCB4iovQcZOCYSzmwRolQRggX0tBSenR6Pgp38YjVIkWvMHhxbVifAusjvVbm/GQeA2MaCt kog53Iyfo7ri9DeNpVuRc/47BxHi8JtdyyGgLO13Ajcwc6V7KLeDmw/SXJAMssuWQlXzs8Og spNvtymBh5rq4TlxAY65L3Yv/yh0izEztOJO3Ob9y3gLrp7TeDI0EO9SyGuFXbgWY/NXlDwW HWguMgO7DWM/KxeaMYyHfnffIeQ6uhM21y42I7NV11mWwycv/XJkID3fd7GWBecakdYnYI/7 FYMDHmsUQPmSMkbqCqYcZe47ABEBAAHCwXYEGAEIACAWIQQ9ZCD6qCFJPoC/DWE4tk2UZoTo dwUCW4BFQQIbDAAKCRA4tk2UZoTod2RbEACbQ2bwJ3++bvqclErbekf7BXYja37/HxGE67q3 9xf28hen8vWGtXwq4bWmZT5H8bBqXigA4bUU4nN4X3xEDfTyqkQMuDTnnwT7Y61B4QEqhi4a q4adf/KP0l1UCg4CJ0KS931Han+VbiuUcbadu1ZX37Ef6g/hG+mt59FeXDMU0rers2Bpr8zB 8ywojAsVC92kvOHLsCQtdCsPzC+R6B1bY6/Re9slM1NBd+2k4BUVhYu8Fb8Ir37OmN0aGQzY uRczfrmR/OV5/1+g5XeYSFbq/0Q3KkFWLHfimff8lb9GRWrdvOUpYyGluv49b/G5o9lSxPwX yBfaoVi/WDDfJ/XJw9H90XK68TYxPfEQkeuLEEzg+Bz3Zeduyo2Zx4S5apLqAbv0RzduXgIG YZVPu8R4ya8nQWHeUpot17lt8SL7yFkMJaAXk27QqUAaxjqnGBLn70YMWXFGySfvjgaR1Ftu /S/HSKqH7m8aFYZftqs7ZojXNdqGHZKRrIx6hRUYuZQM8uxHDweF4jF+QIwYIUmtry5h8iti Sjt9KHjpkH3Wz5o1mk6cbFNN+wgpHplDl/iZMZjFskTAJfEsYHVSSm21zcYvvogrbqYvciMT ty65+0A8Gz9tMbcNx9ePaGoM+9jeFehrzTjdaiTiC+umSd/Y29DCW4OBMr1VfufVVKbfAQ== Message-ID: <4b7424af-a76a-8ff2-d2df-74e2c814f77e@freebsd.org> Date: Wed, 17 Oct 2018 09:58:54 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201810171649.w9HGnBZg047286@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVYff3s4LQwVMJHWV0iOinxrMnL4ksvAh7UQSua586SrAci2qQincK18LEio0QXisTr3AUqfVFgqqX4/1vqJ7umSbrWHklHSs2Y= X-Sonic-ID: C;Gqks7i3S6BGDFf+mSH5B5g== M;dDSI7i3S6BGDFf+mSH5B5g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 17 Oct 2018 16:59:06 -0000 Is there some high-level overview of the plan for pkgbase somewhere? Which things will be in which packages, how the tools will work, etc.? I'm still a little confused by how things are intended to work and it's a bit hard to follow from commits with lots of small reorganizations. Thanks, Nathan On 10/17/18 9:49 AM, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Oct 17 16:49:11 2018 > New Revision: 339413 > URL: https://svnweb.freebsd.org/changeset/base/339413 > > Log: > Move the rc framework out of sbin/init into libexec/rc. > > The reasons for this are forward looking to pkgbase: > * /sbin/init is a special binary; try not to replace it with > every package update because an rc script was touched. > (a follow-up commit will make init its own package) > * having rc in its own place will allow more easy replacement > of the rc framework with alternatives, such as openrc. > > Discussed with: brd (during BSDCam), kmoore > Requested by: cem, bz > PR: 231522 > Approved by: re (gjb) > > Added: > head/libexec/rc/ > head/libexec/rc/Makefile (contents, props changed) > head/libexec/rc/netstart > - copied unchanged from r339412, head/sbin/init/netstart > head/libexec/rc/network.subr > - copied unchanged from r339412, head/sbin/init/network.subr > head/libexec/rc/pccard_ether > - copied unchanged from r339412, head/sbin/init/pccard_ether > head/libexec/rc/rc > - copied unchanged from r339412, head/sbin/init/rc > head/libexec/rc/rc.conf > - copied unchanged from r339412, head/sbin/init/rc.conf > head/libexec/rc/rc.d/ > - copied from r339412, head/sbin/init/rc.d/ > head/libexec/rc/rc.initdiskless > - copied unchanged from r339412, head/sbin/init/rc.initdiskless > head/libexec/rc/rc.resume > - copied unchanged from r339412, head/sbin/init/rc.resume > head/libexec/rc/rc.shutdown > - copied unchanged from r339412, head/sbin/init/rc.shutdown > head/libexec/rc/rc.subr > - copied unchanged from r339412, head/sbin/init/rc.subr > head/libexec/rc/rc.suspend > - copied unchanged from r339412, head/sbin/init/rc.suspend > Deleted: > head/sbin/init/netstart > head/sbin/init/network.subr > head/sbin/init/pccard_ether > head/sbin/init/rc > head/sbin/init/rc.conf > head/sbin/init/rc.d/ > head/sbin/init/rc.initdiskless > head/sbin/init/rc.resume > head/sbin/init/rc.shutdown > head/sbin/init/rc.subr > head/sbin/init/rc.suspend > Modified: > head/libexec/Makefile > head/libexec/rc/rc.d/Makefile > head/sbin/init/Makefile > > Modified: head/libexec/Makefile > ============================================================================== > --- head/libexec/Makefile Wed Oct 17 16:38:44 2018 (r339412) > +++ head/libexec/Makefile Wed Oct 17 16:49:11 2018 (r339413) > @@ -13,6 +13,7 @@ SUBDIR= ${_atf} \ > ${_makewhatis.local} \ > ${_mknetid} \ > ${_pppoed} \ > + rc \ > revnetgroup \ > ${_rlogind} \ > rpc.rquotad \ > > Added: head/libexec/rc/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/rc/Makefile Wed Oct 17 16:49:11 2018 (r339413) > @@ -0,0 +1,16 @@ > +# $FreeBSD$ > + > +CONFGROUPS= CONFETC CONFETCEXEC CONFETCDEFAULTS > +CONFETCDIR= /etc > +CONFETC= network.subr rc rc.initdiskless rc.subr rc.shutdown > +CONFETCMODE= 644 > +CONFETCEXEC= netstart pccard_ether rc.resume rc.suspend > +CONFETCEXECDIR= /etc > +CONFETCEXECMODE= 755 > +CONFETCDEFAULTSDIR= /etc/defaults > +CONFETCDEFAULTS= rc.conf > +PACKAGE=rc > + > +SUBDIR+= rc.d > + > +.include > > Copied: head/libexec/rc/netstart (from r339412, head/sbin/init/netstart) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/rc/netstart Wed Oct 17 16:49:11 2018 (r339413, copy of r339412, head/sbin/init/netstart) > @@ -0,0 +1,57 @@ > +#!/bin/sh - > +# > +# Copyright (c) 1993 The FreeBSD Project > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# 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$ > +# From: @(#)netstart 5.9 (Berkeley) 3/30/91 > +# > + > +# This file is NOT called by any of the other scripts - it has been > +# obsoleted by /etc/rc.d/* and is provided here only for user > +# convenience (if you're sitting in single user mode and wish to start > +# the network by hand, this script will do it for you). > +# > + > +_start=quietstart > + > +/etc/rc.d/devd ${_start} > +/etc/rc.d/hostid ${_start} > +/etc/rc.d/hostname ${_start} > +/etc/rc.d/ipmon ${_start} > +/etc/rc.d/ipfilter ${_start} > +/etc/rc.d/ipnat ${_start} > +/etc/rc.d/ipfs ${_start} > +/etc/rc.d/sppp ${_start} > +/etc/rc.d/netif ${_start} > +/etc/rc.d/ipsec ${_start} > +/etc/rc.d/ppp ${_start} > +/etc/rc.d/ipfw ${_start} > +/etc/rc.d/routing ${_start} > +/etc/rc.d/route6d ${_start} > +/etc/rc.d/routed ${_start} > +/etc/rc.d/rtsold ${_start} > +/etc/rc.d/nisdomain ${_start} > + > +exit 0 > > Copied: head/libexec/rc/network.subr (from r339412, head/sbin/init/network.subr) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/rc/network.subr Wed Oct 17 16:49:11 2018 (r339413, copy of r339412, head/sbin/init/network.subr) > @@ -0,0 +1,1793 @@ > +# > +# Copyright (c) 2003 The FreeBSD Project. All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# 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 PROJECT AND CONTRIBUTORS ``AS IS'' AND > +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +# ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT 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$ > +# > +IFCONFIG_CMD="/sbin/ifconfig" > +: ${netif_ipexpand_max:=2048} > + > +# > +# Subroutines commonly used from network startup scripts. > +# Requires that rc.conf be loaded first. > +# > + > +# ifn_start ifn > +# Bring up and configure an interface. If some configuration is > +# applied, print the interface configuration. > +# > +ifn_start() > +{ > + local ifn cfg > + ifn="$1" > + cfg=1 > + > + [ -z "$ifn" ] && err 1 "ifn_start called without an interface" > + > + ifscript_up ${ifn} && cfg=0 > + ifconfig_up ${ifn} && cfg=0 > + if ! noafif $ifn; then > + afexists inet && ipv4_up ${ifn} && cfg=0 > + afexists inet6 && ipv6_up ${ifn} && cfg=0 > + fi > + childif_create ${ifn} && cfg=0 > + > + return $cfg > +} > + > +# ifn_stop ifn > +# Shutdown and de-configure an interface. If action is taken, > +# print the interface name. > +# > +ifn_stop() > +{ > + local ifn cfg > + ifn="$1" > + cfg=1 > + > + [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" > + > + if ! noafif $ifn; then > + afexists inet6 && ipv6_down ${ifn} && cfg=0 > + afexists inet && ipv4_down ${ifn} && cfg=0 > + fi > + ifconfig_down ${ifn} && cfg=0 > + ifscript_down ${ifn} && cfg=0 > + childif_destroy ${ifn} && cfg=0 > + > + return $cfg > +} > + > +# ifn_vnetup ifn > +# Move ifn to the specified vnet jail. > +# > +ifn_vnetup() > +{ > + > + ifn_vnet0 $1 vnet > +} > + > +# ifn_vnetdown ifn > +# Reclaim ifn from the specified vnet jail. > +# > +ifn_vnetdown() > +{ > + > + ifn_vnet0 $1 -vnet > +} > + > +# ifn_vnet0 ifn action > +# Helper function for ifn_vnetup and ifn_vnetdown. > +# > +ifn_vnet0() > +{ > + local _ifn _cfg _action _vnet > + _ifn="$1" > + _action="$2" > + _cfg=1 > + > + if _vnet=$(vnetif $_ifn); then > + ${IFCONFIG_CMD} $_ifn $_action $_vnet && _cfg=0 > + fi > + > + return $_cfg > +} > + > +# ifconfig_up if > +# Evaluate ifconfig(8) arguments for interface $if and > +# run ifconfig(8) with those arguments. It returns 0 if > +# arguments were found and executed or 1 if the interface > +# had no arguments. Pseudo arguments DHCP and WPA are handled > +# here. > +# > +ifconfig_up() > +{ > + local _cfg _ifconfig_descr _ipv6_opts ifconfig_args > + _cfg=1 > + > + # Make sure lo0 always comes up. > + if [ "$1" = "lo0" ]; then > + _cfg=0 > + fi > + > + # inet6 specific > + if ! noafif $1 && afexists inet6; then > + if checkyesno ipv6_activate_all_interfaces; then > + _ipv6_opts="-ifdisabled" > + elif [ "$1" != "lo0" ]; then > + _ipv6_opts="ifdisabled" > + fi > + > + # backward compatibility: $ipv6_enable > + case $ipv6_enable in > + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) > + case $1 in > + bridge[0-9]*) > + # No accept_rtadv by default on if_bridge(4) > + # to avoid a conflict with the member > + # interfaces. > + ;; > + *) > + if ! checkyesno ipv6_gateway_enable; then > + _ipv6_opts="${_ipv6_opts} accept_rtadv" > + fi > + ;; > + esac > + ;; > + esac > + > + case $ipv6_cpe_wanif in > + $1) > + _ipv6_opts="${_ipv6_opts} -no_radr accept_rtadv" > + ;; > + esac > + > + if [ -n "${_ipv6_opts}" ]; then > + ${IFCONFIG_CMD} $1 inet6 ${_ipv6_opts} > + fi > + fi > + > + # ifconfig_IF > + ifconfig_args=`ifconfig_getargs $1` > + if [ -n "${ifconfig_args}" ]; then > + eval ${IFCONFIG_CMD} $1 ${ifconfig_args} > + _cfg=0 > + fi > + > + # inet6 specific > + if ! noafif $1 && afexists inet6; then > + # ifconfig_IF_ipv6 > + ifconfig_args=`ifconfig_getargs $1 ipv6` > + if [ -n "${ifconfig_args}" ]; then > + # backward compatibility: inet6 keyword > + case "${ifconfig_args}" in > + :*|[0-9a-fA-F]*:*) > + warn "\$ifconfig_$1_ipv6 needs leading" \ > + "\"inet6\" keyword for an IPv6 address." > + ifconfig_args="inet6 ${ifconfig_args}" > + ;; > + esac > + ${IFCONFIG_CMD} $1 inet6 -ifdisabled > + eval ${IFCONFIG_CMD} $1 ${ifconfig_args} > + _cfg=0 > + fi > + > + # $ipv6_prefix_IF will be handled in > + # ipv6_prefix_hostid_addr_common(). > + ifconfig_args=`get_if_var $1 ipv6_prefix_IF` > + if [ -n "${ifconfig_args}" ]; then > + ${IFCONFIG_CMD} $1 inet6 -ifdisabled > + _cfg=0 > + fi > + > + # backward compatibility: $ipv6_ifconfig_IF > + ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` > + if [ -n "${ifconfig_args}" ]; then > + warn "\$ipv6_ifconfig_$1 is obsolete." \ > + " Use ifconfig_$1_ipv6 instead." > + ${IFCONFIG_CMD} $1 inet6 -ifdisabled > + eval ${IFCONFIG_CMD} $1 inet6 ${ifconfig_args} > + _cfg=0 > + fi > + fi > + > + ifalias $1 link alias > + ifalias $1 ether alias > + > + _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr` > + if [ -n "${_ifconfig_descr}" ]; then > + ${IFCONFIG_CMD} $1 description "${_ifconfig_descr}" > + fi > + > + if wpaif $1; then > + /etc/rc.d/wpa_supplicant start $1 > + _cfg=0 # XXX: not sure this should count > + elif hostapif $1; then > + /etc/rc.d/hostapd start $1 > + _cfg=0 > + elif [ ${_cfg} -eq 0 ]; then > + ${IFCONFIG_CMD} $1 up > + fi > + > + if dhcpif $1; then > + if [ $_cfg -ne 0 ] ; then > + ${IFCONFIG_CMD} $1 up > + fi > + if syncdhcpif $1; then > + /etc/rc.d/dhclient start $1 > + fi > + _cfg=0 > + fi > + > + return $_cfg > +} > + > +# ifconfig_down if > +# returns 1 if wpa_supplicant or dhclient was stopped or > +# the interface exists. > +# > +ifconfig_down() > +{ > + local _cfg > + _cfg=1 > + > + if wpaif $1; then > + /etc/rc.d/wpa_supplicant stop $1 > + _cfg=0 > + elif hostapif $1; then > + /etc/rc.d/hostapd stop $1 > + _cfg=0 > + fi > + > + if dhcpif $1; then > + /etc/rc.d/dhclient stop $1 > + _cfg=0 > + fi > + > + if ifexists $1; then > + ${IFCONFIG_CMD} $1 down > + _cfg=0 > + fi > + > + return $_cfg > +} > + > +# get_if_var if var [default] > +# Return the value of the pseudo-hash corresponding to $if where > +# $var is a string containg the sub-string "IF" which will be > +# replaced with $if after the characters defined in _punct are > +# replaced with '_'. If the variable is unset, replace it with > +# $default if given. > +get_if_var() > +{ > + local _if _punct _punct_c _var _default prefix suffix > + > + if [ $# -ne 2 -a $# -ne 3 ]; then > + err 3 'USAGE: get_if_var name var [default]' > + fi > + > + _if=$1 > + _punct=".-/+" > + ltr ${_if} "${_punct}" '_' _if > + _var=$2 > + _default=$3 > + > + prefix=${_var%%IF*} > + suffix=${_var##*IF} > + eval echo \${${prefix}${_if}${suffix}-${_default}} > +} > + > +# _ifconfig_getargs if [af] > +# Prints the arguments for the supplied interface to stdout. > +# Returns 1 if empty. In general, ifconfig_getargs should be used > +# outside this file. > +_ifconfig_getargs() > +{ > + local _ifn _af > + _ifn=$1 > + _af=${2+_$2} > + > + if [ -z "$_ifn" ]; then > + return 1 > + fi > + > + get_if_var $_ifn ifconfig_IF$_af "$ifconfig_DEFAULT" > +} > + > +# ifconfig_getargs if [af] > +# Takes the result from _ifconfig_getargs and removes pseudo > +# args such as DHCP and WPA. > +ifconfig_getargs() > +{ > + local _tmpargs _arg _args _vnet > + _tmpargs=`_ifconfig_getargs $1 $2` > + if [ $? -eq 1 ]; then > + return 1 > + fi > + _args= > + _vnet=0 > + > + for _arg in $_tmpargs; do > + case $_arg:$_vnet in > + [Dd][Hh][Cc][Pp]:0) ;; > + [Nn][Oo][Aa][Uu][Tt][Oo]:0) ;; > + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; > + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; > + [Ww][Pp][Aa]:0) ;; > + [Hh][Oo][Ss][Tt][Aa][Pp]:0) ;; > + vnet:0) _vnet=1 ;; > + *:1) _vnet=0 ;; > + *:0) > + _args="$_args $_arg" > + ;; > + esac > + done > + > + echo $_args > +} > + > +# autoif > +# Returns 0 if the interface should be automatically configured at > +# boot time and 1 otherwise. > +autoif() > +{ > + local _tmpargs _arg > + _tmpargs=`_ifconfig_getargs $1` > + > + for _arg in $_tmpargs; do > + case $_arg in > + [Nn][Oo][Aa][Uu][Tt][Oo]) > + return 1 > + ;; > + esac > + done > + > + return 0 > +} > + > +# dhcpif if > +# Returns 0 if the interface is a DHCP interface and 1 otherwise. > +dhcpif() > +{ > + local _tmpargs _arg > + _tmpargs=`_ifconfig_getargs $1` > + > + case $1 in > + lo[0-9]*|\ > + stf[0-9]*|\ > + lp[0-9]*|\ > + sl[0-9]*) > + return 1 > + ;; > + esac > + if noafif $1; then > + return 1 > + fi > + > + for _arg in $_tmpargs; do > + case $_arg in > + [Dd][Hh][Cc][Pp]) > + return 0 > + ;; > + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) > + return 0 > + ;; > + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) > + return 0 > + ;; > + esac > + done > + > + return 1 > +} > + > +# syncdhcpif > +# Returns 0 if the interface should be configured synchronously and > +# 1 otherwise. > +syncdhcpif() > +{ > + local _tmpargs _arg > + _tmpargs=`_ifconfig_getargs $1` > + > + if noafif $1; then > + return 1 > + fi > + > + for _arg in $_tmpargs; do > + case $_arg in > + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) > + return 1 > + ;; > + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) > + return 0 > + ;; > + esac > + done > + > + checkyesno synchronous_dhclient > +} > + > +# wpaif if > +# Returns 0 if the interface is a WPA interface and 1 otherwise. > +wpaif() > +{ > + local _tmpargs _arg > + _tmpargs=`_ifconfig_getargs $1` > + > + for _arg in $_tmpargs; do > + case $_arg in > + [Ww][Pp][Aa]) > + return 0 > + ;; > + esac > + done > + > + return 1 > +} > + > +# hostapif if > +# Returns 0 if the interface is a HOSTAP interface and 1 otherwise. > +hostapif() > +{ > + local _tmpargs _arg > + _tmpargs=`_ifconfig_getargs $1` > + > + for _arg in $_tmpargs; do > + case $_arg in > + [Hh][Oo][Ss][Tt][Aa][Pp]) > + return 0 > + ;; > + esac > + done > + > + return 1 > +} > + > +# vnetif if > +# Returns 0 and echo jail if "vnet" keyword is specified on the > +# interface, and 1 otherwise. > +vnetif() > +{ > + local _tmpargs _arg _vnet > + _tmpargs=`_ifconfig_getargs $1` > + > + _vnet=0 > + for _arg in $_tmpargs; do > + case $_arg:$_vnet in > + vnet:0) _vnet=1 ;; > + *:1) echo $_arg; return 0 ;; > + esac > + done > + > + return 1 > +} > + > +# afexists af > +# Returns 0 if the address family is enabled in the kernel > +# 1 otherwise. > +afexists() > +{ > + local _af > + _af=$1 > + > + case ${_af} in > + inet|inet6) > + check_kern_features ${_af} > + ;; > + link|ether) > + return 0 > + ;; > + *) > + err 1 "afexists(): Unsupported address family: $_af" > + ;; > + esac > +} > + > +# noafif if > +# Returns 0 if the interface has no af configuration and 1 otherwise. > +noafif() > +{ > + local _if > + _if=$1 > + > + case $_if in > + pflog[0-9]*|\ > + pfsync[0-9]*|\ > + usbus[0-9]*|\ > + an[0-9]*|\ > + ath[0-9]*|\ > + ipw[0-9]*|\ > + ipfw[0-9]*|\ > + iwi[0-9]*|\ > + iwn[0-9]*|\ > + ral[0-9]*|\ > + wi[0-9]*|\ > + wl[0-9]*|\ > + wpi[0-9]*) > + return 0 > + ;; > + esac > + > + return 1 > +} > + > +# ipv6if if > +# Returns 0 if the interface should be configured for IPv6 and > +# 1 otherwise. > +ipv6if() > +{ > + local _if _tmpargs i > + _if=$1 > + > + if ! afexists inet6; then > + return 1 > + fi > + > + # lo0 is always IPv6-enabled > + case $_if in > + lo0) > + return 0 > + ;; > + esac > + > + case "${ipv6_network_interfaces}" in > + $_if|"$_if "*|*" $_if"|*" $_if "*|[Aa][Uu][Tt][Oo]) > + # True if $ifconfig_IF_ipv6 is defined. > + _tmpargs=`_ifconfig_getargs $_if ipv6` > + if [ -n "${_tmpargs}" ]; then > + return 0 > + fi > + > + # True if $ipv6_prefix_IF is defined. > + _tmpargs=`get_if_var $_if ipv6_prefix_IF` > + if [ -n "${_tmpargs}" ]; then > + return 0 > + fi > + > + # backward compatibility: True if $ipv6_ifconfig_IF is defined. > + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` > + if [ -n "${_tmpargs}" ]; then > + return 0 > + fi > + ;; > + esac > + > + return 1 > +} > + > +# ipv6_autoconfif if > +# Returns 0 if the interface should be configured for IPv6 with > +# Stateless Address Configuration; 1 otherwise. > +ipv6_autoconfif() > +{ > + local _if _tmpargs _arg > + _if=$1 > + > + case $_if in > + lo[0-9]*|\ > + stf[0-9]*|\ > + lp[0-9]*|\ > + sl[0-9]*) > + return 1 > + ;; > + esac > + if noafif $_if; then > + return 1 > + fi > + if ! ipv6if $_if; then > + return 1 > + fi > + if checkyesno ipv6_gateway_enable; then > + return 1 > + fi > + _tmpargs=`get_if_var $_if ipv6_prefix_IF` > + if [ -n "${_tmpargs}" ]; then > + return 1 > + fi > + # backward compatibility: $ipv6_enable > + case $ipv6_enable in > + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) > + if checkyesno ipv6_gateway_enable; then > + return 1 > + fi > + case $1 in > + bridge[0-9]*) > + # No accept_rtadv by default on if_bridge(4) > + # to avoid a conflict with the member > + # interfaces. > + return 1 > + ;; > + *) > + return 0 > + ;; > + esac > + ;; > + esac > + > + _tmpargs=`_ifconfig_getargs $_if ipv6` > + for _arg in $_tmpargs; do > + case $_arg in > + accept_rtadv) > + return 0 > + ;; > + esac > + done > + > + # backward compatibility: $ipv6_ifconfig_IF > + _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` > + for _arg in $_tmpargs; do > + case $_arg in > + accept_rtadv) > + return 0 > + ;; > + esac > + done > + > + return 1 > +} > + > +# ifexists if > +# Returns 0 if the interface exists and 1 otherwise. > +ifexists() > +{ > + [ -z "$1" ] && return 1 > + ${IFCONFIG_CMD} -n $1 > /dev/null 2>&1 > +} > + > +# ipv4_up if > +# add IPv4 addresses to the interface $if > +ipv4_up() > +{ > + local _if _ret > + _if=$1 > + _ret=1 > + > + # Add 127.0.0.1/8 to lo0 unless otherwise specified. > + if [ "${_if}" = "lo0" ]; then > + ifconfig_args=`get_if_var ${_if} ifconfig_IF` > + if [ -z "${ifconfig_args}" ]; then > + ${IFCONFIG_CMD} ${_if} inet 127.0.0.1/8 alias > + fi > + fi > + ifalias ${_if} inet alias && _ret=0 > + > + return $_ret > +} > + > +# ipv6_up if > +# add IPv6 addresses to the interface $if > +ipv6_up() > +{ > + local _if _ret > + _if=$1 > + _ret=1 > + > + if ! ipv6if $_if; then > + return 0 > + fi > + > + ifalias ${_if} inet6 alias && _ret=0 > + ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 > + ipv6_accept_rtadv_up ${_if} && _ret=0 > + > + return $_ret > +} > + > +# ipv4_down if > +# remove IPv4 addresses from the interface $if > +ipv4_down() > +{ > + local _if _ifs _ret inetList oldifs _inet > + _if=$1 > + _ifs="^" > + _ret=1 > + > + ifalias ${_if} inet -alias && _ret=0 > + > + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet ' | tr "\n\t" "$_ifs"`" > + > + oldifs="$IFS" > + IFS="$_ifs" > + for _inet in $inetList ; do > + # get rid of extraneous line > + case $_inet in > + inet\ *) ;; > + *) continue ;; > + esac > + > + _inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` > + > + IFS="$oldifs" > + ${IFCONFIG_CMD} ${_if} ${_inet} delete > + IFS="$_ifs" > + _ret=0 > + done > + IFS="$oldifs" > + > + return $_ret > +} > + > +# ipv6_down if > +# remove IPv6 addresses from the interface $if > +ipv6_down() > +{ > + local _if _ifs _ret inetList oldifs _inet6 > + _if=$1 > + _ifs="^" > + _ret=1 > + > + if ! ipv6if $_if; then > + return 0 > + fi > + > + ipv6_accept_rtadv_down ${_if} && _ret=0 > + ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0 > + ifalias ${_if} inet6 -alias && _ret=0 > + > + inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet6 ' | tr "\n\t" "$_ifs"`" > + > + oldifs="$IFS" > + IFS="$_ifs" > + for _inet6 in $inetList ; do > + # get rid of extraneous line > + case $_inet6 in > + inet6\ *) ;; > + *) continue ;; > + esac > + > + _inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'` > + > + IFS="$oldifs" > + ${IFCONFIG_CMD} ${_if} ${_inet6} -alias > + IFS="$_ifs" > + _ret=0 > + done > + IFS="$oldifs" > + > + return $_ret > +} > + > +# ifalias if af action > +# Configure or remove aliases for network interface $if. > +# It returns 0 if at least one alias was configured or > +# removed, or 1 if there were none. > +# > +ifalias() > +{ > + local _ret > + _ret=1 > + > + afexists $2 || return $_ret > + > + case "$2" in > + inet|inet6|link|ether) > + ifalias_af_common $1 $2 $3 && _ret=0 > + ;; > + esac > + > + return $_ret > +} > + > +# ifalias_expand_addr af action addr > +# Expand address range ("N-M") specification in addr. > +# "addr" must not include an address-family keyword. > +# The results will include an address-family keyword. > +# > +ifalias_expand_addr() > +{ > + local _af _action > + > + _af=$1 > + _action=$2 > + shift 2 > + > + afexists $_af || return > + ifalias_expand_addr_$_af $_action $* > +} > + > +# ifalias_expand_addr_inet action addr > +# Helper function for ifalias_expand_addr(). Handles IPv4. > +# > +ifalias_expand_addr_inet() > +{ > + local _action _arg _cidr _cidr_addr _exargs > + local _ipaddr _plen _range _iphead _iptail _iplow _iphigh _ipcount > + local _retstr _c > + _action=$1 > + _arg=$2 > + shift 2 > + _exargs=$* > + _retstr= > + > + case $_action:$_arg:$_exargs in > + *:*--*) return ;; # invalid > + tmp:*[0-9]-[0-9]*:*) # to be expanded > + _action="alias" > + ;; > + *:*[0-9]-[0-9]*:*) # to be expanded > + ;; > + tmp:*:*netmask*) # already expanded w/ netmask option > + echo ${_arg%/[0-9]*} $_exargs && return > + ;; > + tmp:*:*) # already expanded w/o netmask option > + echo $_arg $_exargs && return > + ;; > + *:*:*netmask*) # already expanded w/ netmask option > + echo inet ${_arg%/[0-9]*} $_exargs && return > + ;; > + *:*:*) # already expanded w/o netmask option > + echo inet $_arg $_exargs && return > + ;; > + esac > + > + for _cidr in $_arg; do > + _ipaddr=${_cidr%%/*} > + _plen=${_cidr##*/} > + # When subnet prefix length is not specified, use /32. > + case $_plen in > + $_ipaddr) _plen=32 ;; # "/" character not found > + esac > + > + OIFS=$IFS > + IFS=. set -- $_ipaddr > + _range= > + _iphead= > + _iptail= > + for _c in $@; do > + case $_range:$_c in > + :[0-9]*-[0-9]*) > + _range=$_c > + ;; > + :*) > + _iphead="${_iphead}${_iphead:+.}${_c}" > + ;; > + *:*) > + _iptail="${_iptail}${_iptail:+.}${_c}" > + ;; > + esac > + done > + IFS=$OIFS > + _iplow=${_range%-*} > + _iphigh=${_range#*-} > + > + # clear netmask when removing aliases > + if [ "$_action" = "-alias" ]; then > + _plen="" > + fi > + > + _ipcount=$_iplow > + while [ "$_ipcount" -le "$_iphigh" ]; do > + _retstr="${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen}" > + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ]; then > + warn "Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. Increase \$netif_ipexpand_max in rc.conf." > + break > + else > + _ipcount=$(($_ipcount + 1)) > + fi > + # Forcibly set /32 for remaining aliases. > + _plen=32 > + done > + done > + > + for _c in $_retstr; do > + ifalias_expand_addr_inet $_action $_c $_exargs > + done > +} > + > +# ifalias_expand_addr_inet6 action addr > +# Helper function for ifalias_expand_addr(). Handles IPv6. > +# > +ifalias_expand_addr_inet6() > +{ > + local _action _arg _cidr _cidr_addr _exargs > + local _ipaddr _plen _ipleft _ipright _iplow _iphigh _ipcount > + local _ipv4part > + local _retstr _c > + _action=$1 > + _arg=$2 > + shift 2 > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Wed Oct 17 18:08:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E10C510DBB3C; Wed, 17 Oct 2018 18:08:30 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (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 1AA6C8C843; Wed, 17 Oct 2018 18:08:29 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id w9HI8LFv098902; Wed, 17 Oct 2018 21:08:21 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Wed, 17 Oct 2018 21:08:21 +0300 (MSK) From: Dmitry Morozovsky To: Nathan Whitehorn cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339413 - in head: libexec libexec/rc libexec/rc/rc.d sbin/init sbin/init/rc.d In-Reply-To: <4b7424af-a76a-8ff2-d2df-74e2c814f77e@freebsd.org> Message-ID: References: <201810171649.w9HGnBZg047286@repo.freebsd.org> <4b7424af-a76a-8ff2-d2df-74e2c814f77e@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Wed, 17 Oct 2018 21:08:21 +0300 (MSK) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 17 Oct 2018 18:08:31 -0000 On Wed, 17 Oct 2018, Nathan Whitehorn wrote: > Is there some high-level overview of the plan for pkgbase somewhere? > Which things will be in which packages, how the tools will work, etc.? > I'm still a little confused by how things are intended to work and it's > a bit hard to follow from commits with lots of small reorganizations. possibly https://wiki.freebsd.org/PkgBase but it's pretty vague [snip] -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@freebsd.org Wed Oct 17 18:51:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECACA10DC9AD for ; Wed, 17 Oct 2018 18:51:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 867808DE0E for ; Wed, 17 Oct 2018 18:51:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vk1-xa2f.google.com with SMTP id x78-v6so3903334vke.11 for ; Wed, 17 Oct 2018 11:51:39 -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=+W+mSTPZ0f41MUlsvjqLqyOGiRE5bZ/8HF1FrZ3cnGc=; b=n1JeHzzW/fFY6Mp3FVpoQpdk7UjRK+C59FQ8I3Qnv/KjT8JlfRSy+68EGvMLggaDHt kWpWp13pg2QI/Ao3YpdDn0b6nWB9q+ypbgKTPOo9SS2EkZzXENFnceTW6Tt9yEdew6Kd zrCR1uiUULec4j/k32g/RcDglZHlPOS6oPyMePAtVa6j8BRCG9qUSbQQExoNCbfvE+5/ fMG6CCf1kfTrLL0RK5M1MZe6O/ppeoTETqwujPnMTtlSjwofatSyzolYcxxT6eILJIdt 3Nf0BOzb5hkLxnJMVeEFiVP4Bu2Oz0YVcgyL3O+uwHNxzvGUtFkFvJ0mOecqY/o2HwSB 71dA== 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=+W+mSTPZ0f41MUlsvjqLqyOGiRE5bZ/8HF1FrZ3cnGc=; b=Wq/52d/nWlLmfVwL5Ra3FOSIERdb0OfTCZTS40/2SDi/cBFJSoQ6t1SAoPbHy21HXN SPO3KK138gtjdvKzDK4h9SqPRv043VfK9BlOwbd4/W9dFs+Ba2uRN3NPywfmUmLS20lU lBzf8/kgQQz1VEoCgG9aLJDtX1JnSpovJIrAHz/32syva6PRAHtjJGfPK6Q9S+EFp34K LTCGB2vFRW7SVr11mcOKXG5DtS3rIXz7D7iqQFSmrjAgy3TunKVep1nbcstKokYdxefd OnYLYCuP9+ERdarFiKafEoxu9k1QDCOqWPRSJeCmCJ6ZUr6jH89d34Hbwo3QWYpNP7/Y fPYg== X-Gm-Message-State: ABuFfohaBRHE+ewr4aIPyKj8y6hpk9o5EZ/hRZ5l8lcXLMoUnvD/ti25 qKfhLMsRACORgjtMgMlqYb5tGTKj+7jXtu74OiZvRA== X-Google-Smtp-Source: ACcGV6242wg98L9GK16RRwvP3nhQ+/3/7XRVzn4yBUYds/oT04Ut8O7z6DerNv9q3/nqR4Nhj+qAcxcGNwqrHTn8lo4= X-Received: by 2002:a1f:b547:: with SMTP id e68-v6mr11203186vkf.72.1539802298822; Wed, 17 Oct 2018 11:51:38 -0700 (PDT) MIME-Version: 1.0 References: <201810171649.w9HGnBZg047286@repo.freebsd.org> <4b7424af-a76a-8ff2-d2df-74e2c814f77e@freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 17 Oct 2018 12:51:27 -0600 Message-ID: Subject: Re: svn commit: r339413 - in head: libexec libexec/rc libexec/rc/rc.d sbin/init sbin/init/rc.d To: Dmitry Morozovsky Cc: Nathan Whitehorn , "Bjoern A. Zeeb" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 17 Oct 2018 18:51:40 -0000 Would people stop moving things around. Please. We can live with minorly sub-optimal placement of the files for now. The churn isn't helpful. I'm working with Brad to get the design finalized. It's not there yet. Until it's finalized, don't move things. Warner On Wed, Oct 17, 2018 at 12:08 PM Dmitry Morozovsky wrote: > On Wed, 17 Oct 2018, Nathan Whitehorn wrote: > > > Is there some high-level overview of the plan for pkgbase somewhere? > > Which things will be in which packages, how the tools will work, etc.? > > I'm still a little confused by how things are intended to work and it's > > a bit hard to follow from commits with lots of small reorganizations. > > possibly https://wiki.freebsd.org/PkgBase but it's pretty vague > > [snip] > > > -- > Sincerely, > D.Marck [DM5020, MCK-RIPE, DM3-RIPN] > [ FreeBSD committer: marck@FreeBSD.org ] > ------------------------------------------------------------------------ > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** > ------------------------------------------------------------------------ > > From owner-svn-src-head@freebsd.org Thu Oct 18 00:51:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5C710E34CB; Thu, 18 Oct 2018 00:51:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60D0697AB5; Thu, 18 Oct 2018 00:51:43 +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 5BCEF185AC; Thu, 18 Oct 2018 00:51:43 +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 w9I0phAK095905; Thu, 18 Oct 2018 00:51:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9I0phk0095904; Thu, 18 Oct 2018 00:51:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810180051.w9I0phk0095904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Oct 2018 00:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339416 - head/sys/modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/modules/nvdimm X-SVN-Commit-Revision: 339416 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.27 Precedence: list List-Id: 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, 18 Oct 2018 00:51:43 -0000 Author: bz Date: Thu Oct 18 00:51:42 2018 New Revision: 339416 URL: https://svnweb.freebsd.org/changeset/base/339416 Log: Fix modules/nvdimm build issues after r339391 by adding a dependency to the SRC list. Sort the list while changing the line. Reported by: ci.f.o, make -j24 buildkernel Approved by: re (gjb) Modified: head/sys/modules/nvdimm/Makefile Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Wed Oct 17 19:29:57 2018 (r339415) +++ head/sys/modules/nvdimm/Makefile Thu Oct 18 00:51:42 2018 (r339416) @@ -6,6 +6,6 @@ KMOD= nvdimm SRCS= nvdimm.c \ nvdimm_spa.c -SRCS+= device_if.h bus_if.h +SRCS+= acpi_if.h bus_if.h device_if.h .include From owner-svn-src-head@freebsd.org Thu Oct 18 02:07:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D06B10E761E; Thu, 18 Oct 2018 02:07:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D386473BFD; Thu, 18 Oct 2018 02:07:30 +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 CD6B31969F; Thu, 18 Oct 2018 02:07:30 +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 w9I27UTW033544; Thu, 18 Oct 2018 02:07:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9I27U2Z033543; Thu, 18 Oct 2018 02:07:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810180207.w9I27U2Z033543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Oct 2018 02:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339417 - in head/libexec/rc: . rc.d X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/libexec/rc: . rc.d X-SVN-Commit-Revision: 339417 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.27 Precedence: list List-Id: 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, 18 Oct 2018 02:07:31 -0000 Author: bz Date: Thu Oct 18 02:07:30 2018 New Revision: 339417 URL: https://svnweb.freebsd.org/changeset/base/339417 Log: While preparing to move init(8) to its own package as indicated in r339413, a current pkgbase update problem came up. For users testing pkgbase at the moment there is no (automatic) way to pick up new base packages (yet). As a result rather than also moving init(8) to its own package, back out the part of the change in r339413 that moved rc* to its own package and defer creating new packages until the infrastructure is in place to handle these cases. Both init and rc* are considered too problematic to be lost by early adaptors at this stage. Discussed with: brd Reviewed by: brd Approved by: re (gjb) Modified: head/libexec/rc/Makefile head/libexec/rc/rc.d/Makefile Modified: head/libexec/rc/Makefile ============================================================================== --- head/libexec/rc/Makefile Thu Oct 18 00:51:42 2018 (r339416) +++ head/libexec/rc/Makefile Thu Oct 18 02:07:30 2018 (r339417) @@ -9,7 +9,7 @@ CONFETCEXECDIR= /etc CONFETCEXECMODE= 755 CONFETCDEFAULTSDIR= /etc/defaults CONFETCDEFAULTS= rc.conf -PACKAGE=rc +#PACKAGE=rc SUBDIR+= rc.d Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Thu Oct 18 00:51:42 2018 (r339416) +++ head/libexec/rc/rc.d/Makefile Thu Oct 18 02:07:30 2018 (r339417) @@ -4,7 +4,7 @@ CONFDIR= /etc/rc.d CONFGROUPS= CONFS -PACKAGE=rc +#PACKAGE=rc CONFS= DAEMON \ FILESYSTEMS \ From owner-svn-src-head@freebsd.org Thu Oct 18 02:12:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57E3210E7C82; Thu, 18 Oct 2018 02:12:51 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0425974397; Thu, 18 Oct 2018 02:12:51 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.69] (unknown [12.202.168.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 730C7104F7; Thu, 18 Oct 2018 02:12:50 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.12.0.181014 Date: Wed, 17 Oct 2018 19:12:47 -0700 Subject: Re: svn commit: r339361 - head From: Ravi Pokala To: Glen Barber , , , Message-ID: <2B792E27-E175-4684-824B-70214716873C@panasas.com> Thread-Topic: svn commit: r339361 - head References: <201810151716.w9FHGlmF077762@repo.freebsd.org> In-Reply-To: <201810151716.w9FHGlmF077762@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 18 Oct 2018 02:12:51 -0000 Why would the OpenSSL change cause these libcasper files to be stale? Nothi= ng on that list should have anything to do with OpenSSL, right? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Glen Barber Date: 2018-10-15, Monday at 10:16 To: , , Subject: svn commit: r339361 - head Author: gjb Date: Mon Oct 15 17:16:47 2018 New Revision: 339361 URL: https://svnweb.freebsd.org/changeset/base/339361 Log: Remove stale libcasper(3) shared libraries following the OpenSSL 1.1.1 update. =20 Reported by: des Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Mon Oct 15 16:43:07 2018 (r339360) +++ head/ObsoleteFiles.inc Mon Oct 15 17:16:47 2018 (r339361) @@ -38,6 +38,19 @@ # xargs -n1 | sort | uniq -d; # done =20 +# 20181015: Stale libcasper(3) files following 20181009: OpenSSL 1.1.1 +OLD_LIBS+=3Dlib/casper/libcap_sysctl.so.0 +OLD_LIBS+=3Dlib/casper/libcap_grp.so.0 +OLD_LIBS+=3Dlib/casper/libcap_pwd.so.0 +OLD_LIBS+=3Dlib/casper/libcap_random.so.0 +OLD_LIBS+=3Dlib/casper/libcap_dns.so.0 +OLD_LIBS+=3Dlib/casper/libcap_syslog.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_sysctl.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_grp.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_pwd.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_random.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_dns.so.0 +OLD_LIBS+=3Dusr/lib32/libcap_syslog.so.0 # 20181009: OpenSSL 1.1.1 OLD_FILES+=3Dusr/include/openssl/des_old.h OLD_FILES+=3Dusr/include/openssl/dso.h From owner-svn-src-head@freebsd.org Thu Oct 18 02:27:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D0510E831C; Thu, 18 Oct 2018 02:27:59 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D5B9748B5; Thu, 18 Oct 2018 02:27:59 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 41ED91AAC3; Thu, 18 Oct 2018 02:27:59 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Thu, 18 Oct 2018 02:27:57 +0000 From: Glen Barber To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339361 - head Message-ID: <20181018022757.GT54240@FreeBSD.org> References: <201810151716.w9FHGlmF077762@repo.freebsd.org> <2B792E27-E175-4684-824B-70214716873C@panasas.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PkEWctFf+8E2rcii" Content-Disposition: inline In-Reply-To: <2B792E27-E175-4684-824B-70214716873C@panasas.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 18 Oct 2018 02:28:00 -0000 --PkEWctFf+8E2rcii Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 17, 2018 at 07:12:47PM -0700, Ravi Pokala wrote: > Why would the OpenSSL change cause these libcasper files to be > stale? Nothing on that list should have anything to do with OpenSSL, > right? >=20 It seems I misread the report, and the shlib bump occurred in r329452. So the shlib and ObsoleteFiles.inc change is correct, it is the commit log that is incorrect in this case. Thank you for pointing this out. Glen --PkEWctFf+8E2rcii Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlvH760ACgkQAxRYpUeP 4pPZZQ/+NrYFnLEQTmcgheJHi3ciLHtuJKrOar3w98Ibw+a/MHieAYomHPEw9os9 AzQ4G0M55xHALBWOdxYBJSUA+mottkEJOS1WgIWsaE2LHQjS/CnjdanCNa9Y1q8b Dm6xKiHWSacBf45iDtkSSflDM2BNl89p2KFU5zPBd0xKc11W7g+FWVdqpe1FVaCE 0bucuLWB85JMECioyiJzuJEL4rYiKDsizq9EFC5xjz2Klj36COVM3w1VnW4MkIeF aYKRBkCE/RbegzezaRzfTeM3KbUaxVpfKQ/DY/baMiIdCRRBDifvBH3ElaAXS8te ylvEL+JZ5xQc2YgifvztQLZsSlI0/pLD3iyyBIkBKESyiZuQfOPGyRHbsqP9lBZo ZJHkHkVL3BlBPCVNcV3fMwRQP4CXWJys1YEps4GfYNIX/ULog5tEI7rgY/QDyEjh tRVrtmocM/aWim1oumd87xLPXTJIlxEMKVzxDzrX5hHwKMRPO2Fm3zKRfaPA8Bqp tp0yzDjAqhQydEuCWP98uKr7lU+gh3urGYq6U15qELbt0kTgoARCA+AdhGGi95DV PRoc/s/S3UJcjxGlZ1HiRq0QVXWAQkCjEoImYvfHiMnMC4ScJtvTNj6aqZ0Af20A GlaDeIRinOTOGG9l9dZH+/hDOr5TNCjbFttWGJTC8YP1OlH3XkY= =024u -----END PGP SIGNATURE----- --PkEWctFf+8E2rcii-- From owner-svn-src-head@freebsd.org Thu Oct 18 14:20:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D1510DDDAB; Thu, 18 Oct 2018 14:20:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99EEE8D44D; Thu, 18 Oct 2018 14:20:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94EFA20EF5; Thu, 18 Oct 2018 14:20:16 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IEKGxA008890; Thu, 18 Oct 2018 14:20:16 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IEKGG7008889; Thu, 18 Oct 2018 14:20:16 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201810181420.w9IEKGG7008889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 18 Oct 2018 14:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339419 - in head: share/man/man9 sys/kern X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head: share/man/man9 sys/kern X-SVN-Commit-Revision: 339419 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.27 Precedence: list List-Id: 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, 18 Oct 2018 14:20:17 -0000 Author: jtl Date: Thu Oct 18 14:20:15 2018 New Revision: 339419 URL: https://svnweb.freebsd.org/changeset/base/339419 Log: r334853 added a "socket destructor" callback. However, as implemented, it was really a "socket close" callback. Update the socket destructor functionality to run when a socket is destroyed (rather than when it is closed). The original submitter has confirmed that this change satisfies the intended use case. Suggested by: rwatson Submitted by: Michio Honda Tested by: Michio Honda Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D17590 Modified: head/share/man/man9/socket.9 head/sys/kern/uipc_socket.c Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Thu Oct 18 04:36:25 2018 (r339418) +++ head/share/man/man9/socket.9 Thu Oct 18 14:20:15 2018 (r339419) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2018 +.Dd October 18, 2018 .Dt SOCKET 9 .Os .Sh NAME @@ -378,8 +378,8 @@ or A kernel system can use the .Fn sodtor_set function to set a destructor for a socket. -The destructor is called when the socket is closed. -The destructor is called after the protocol close routine has completed. +The destructor is called when the socket is is about to be freed. +The destructor is called before the protocol detach routine. The destructor can serve as a callback to initiate additional cleanup actions. .Ss Socket I/O The Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Oct 18 04:36:25 2018 (r339418) +++ head/sys/kern/uipc_socket.c Thu Oct 18 14:20:15 2018 (r339419) @@ -1026,6 +1026,9 @@ sofree(struct socket *so) so->so_error = ECONNABORTED; SOCK_UNLOCK(so); + if (so->so_dtor != NULL) + so->so_dtor(so); + VNET_SO_ASSERT(so); if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) (*pr->pr_domain->dom_dispose)(so); @@ -1102,8 +1105,6 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); - if (so->so_dtor != NULL) - so->so_dtor(so); SOCK_LOCK(so); if ((listening = (so->so_options & SO_ACCEPTCONN))) { From owner-svn-src-head@freebsd.org Thu Oct 18 15:02:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B542610DEB67; Thu, 18 Oct 2018 15:02:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695AB8EBBD; Thu, 18 Oct 2018 15:02:58 +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 64410216FB; Thu, 18 Oct 2018 15:02:58 +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 w9IF2w6p034291; Thu, 18 Oct 2018 15:02:58 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IF2wFZ034290; Thu, 18 Oct 2018 15:02:58 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201810181502.w9IF2wFZ034290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 18 Oct 2018 15:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339420 - in head: sys/kern usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: sys/kern usr.sbin/jail X-SVN-Commit-Revision: 339420 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.27 Precedence: list List-Id: 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, 18 Oct 2018 15:02:58 -0000 Author: jamie Date: Thu Oct 18 15:02:57 2018 New Revision: 339420 URL: https://svnweb.freebsd.org/changeset/base/339420 Log: Fix typos from r339409. Reported by: maxim Approved by: re (gjb) Modified: head/sys/kern/kern_jail.c head/usr.sbin/jail/jail.8 Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Oct 18 14:20:15 2018 (r339419) +++ head/sys/kern/kern_jail.c Thu Oct 18 15:02:57 2018 (r339420) @@ -3352,7 +3352,7 @@ prison_priv_check(struct ucred *cred, int priv) return (0); /* - * Do not allow a process inside a jail read the kernel + * Do not allow a process inside a jail to read the kernel * message buffer unless explicitly permitted. */ case PRIV_MSGBUF: Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Oct 18 14:20:15 2018 (r339419) +++ head/usr.sbin/jail/jail.8 Thu Oct 18 15:02:57 2018 (r339420) @@ -553,7 +553,7 @@ with non-jailed parts of the system. Jailed users may read the kernel message buffer. If the .Va security.bsd.unprivileged_read_msgbuf -MIB entry is zero, this will be restricted to to root user. +MIB entry is zero, this will be restricted to the root user. .It Va allow.socket_af Sockets within a jail are normally restricted to IPv4, IPv6, local (UNIX), and route. This allows access to other protocol stacks that From owner-svn-src-head@freebsd.org Thu Oct 18 15:08:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E06110DED49; Thu, 18 Oct 2018 15:08:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD988EF79; Thu, 18 Oct 2018 15:08:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 135CA21721; Thu, 18 Oct 2018 15:08:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IF8G1K034682; Thu, 18 Oct 2018 15:08:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IF8FfX034673; Thu, 18 Oct 2018 15:08:15 GMT (envelope-from br@FreeBSD.org) Message-Id: <201810181508.w9IF8FfX034673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Oct 2018 15:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339421 - in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv X-SVN-Commit-Revision: 339421 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.27 Precedence: list List-Id: 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, 18 Oct 2018 15:08:17 -0000 Author: br Date: Thu Oct 18 15:08:14 2018 New Revision: 339421 URL: https://svnweb.freebsd.org/changeset/base/339421 Log: Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives). RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardware support for these bits optional. Implementations that do not manage these bits in hardware raise page faults for accesses to a valid page without A set and writes to a writable page without D set. Check for these types of faults when handling a page fault and fixup the PTE without calling vm_fault if they occur. Reviewed by: jhb, markj Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17424 Modified: head/sys/arm/arm/pl310.c head/sys/arm/conf/GENERIC head/sys/arm/conf/GENERIC-MMCCAM head/sys/arm/conf/SOCDK head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts head/sys/riscv/include/pmap.h head/sys/riscv/include/pte.h head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/trap.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/arm/arm/pl310.c Thu Oct 18 15:08:14 2018 (r339421) @@ -168,27 +168,34 @@ pl310_set_ram_latency(struct pl310_softc *sc, uint32_t { uint32_t v; + printf("%s\n", __func__); KASSERT(which_reg == PL310_TAG_RAM_CTRL || which_reg == PL310_DATA_RAM_CTRL, ("bad pl310 ram latency register address")); + printf("%s\n", __func__); v = pl310_read4(sc, which_reg); + printf("%s\n", __func__); if (setup != 0) { KASSERT(setup <= 8, ("bad pl310 setup latency: %d", setup)); v &= ~RAM_CTRL_SETUP_MASK; v |= (setup - 1) << RAM_CTRL_SETUP_SHIFT; } + printf("%s\n", __func__); if (read != 0) { KASSERT(read <= 8, ("bad pl310 read latency: %d", read)); v &= ~RAM_CTRL_READ_MASK; v |= (read - 1) << RAM_CTRL_READ_SHIFT; } + printf("%s\n", __func__); if (write != 0) { KASSERT(write <= 8, ("bad pl310 write latency: %d", write)); v &= ~RAM_CTRL_WRITE_MASK; v |= (write - 1) << RAM_CTRL_WRITE_SHIFT; } + printf("%s wr\n", __func__); pl310_write4(sc, which_reg, v); + printf("%s done\n", __func__); } static int @@ -482,6 +489,8 @@ pl310_attach(device_t dev) uint32_t cache_id, debug_ctrl; phandle_t node; + printf("%s\n", __func__); + sc->sc_dev = dev; rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -489,6 +498,8 @@ pl310_attach(device_t dev) if (sc->sc_mem_res == NULL) panic("%s: Cannot map registers", device_get_name(dev)); + printf("%s\n", __func__); + /* Allocate an IRQ resource */ rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -497,10 +508,16 @@ pl310_attach(device_t dev) device_printf(dev, "cannot allocate IRQ, not using interrupt\n"); } + printf("%s: mtx init\n", __func__); pl310_softc = sc; mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN); + printf("%s: pl310_read4\n", __func__); + printf("%s: pl310_read4\n", __func__); + printf("%s: pl310_read4\n", __func__); + cache_id = pl310_read4(sc, PL310_CACHE_ID); + printf("%s\n", __func__); sc->sc_rtl_revision = (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK; device_printf(dev, "Part number: 0x%x, release: 0x%x\n", Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/arm/conf/GENERIC Thu Oct 18 15:08:14 2018 (r339421) @@ -36,6 +36,7 @@ files "../allwinner/a31/files.a31" files "../allwinner/a33/files.a33" files "../allwinner/a83t/files.a83t" files "../allwinner/h3/files.h3" +files "../altera/socfpga/files.socfpga" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" files "../freescale/imx/files.imx6" @@ -56,6 +57,8 @@ options SOC_ALLWINNER_A33 options SOC_ALLWINNER_A83T options SOC_ALLWINNER_H2PLUS options SOC_ALLWINNER_H3 +options SOC_ALTERA_ARRIA10 +options SOC_ALTERA_CYCLONE5 options SOC_BCM2836 options SOC_MV_ARMADA38X options SOC_MV_ARMADAXP @@ -89,10 +92,15 @@ device pmu device generic_timer device mpcore_timer +# DMA support +device xdma +device pl330 + # MMC/SD/SDIO Card slot support device sdhci # SD controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards +device dwmmc # ATA controllers device ahci # AHCI-compatible SATA controllers @@ -169,7 +177,9 @@ device aw_cir device spibus device spigen device bcm2835_spi +device cqspi # Cadence Quad SPI Flash Controller device ti_spi +device n25q # n25q Quad SPI Flash # ADC support device ti_adc Modified: head/sys/arm/conf/GENERIC-MMCCAM ============================================================================== --- head/sys/arm/conf/GENERIC-MMCCAM Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/arm/conf/GENERIC-MMCCAM Thu Oct 18 15:08:14 2018 (r339421) @@ -20,3 +20,6 @@ device pass nodevice mmc nodevice mmcsd + +# dwmmc_altera.c fails to build +nodevice dwmmc Modified: head/sys/arm/conf/SOCDK ============================================================================== --- head/sys/arm/conf/SOCDK Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/arm/conf/SOCDK Thu Oct 18 15:08:14 2018 (r339421) @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "SOCFPGA" +include "GENERIC" ident SOCDK options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" Modified: head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts ============================================================================== --- head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Thu Oct 18 15:08:14 2018 (r339421) @@ -61,6 +61,10 @@ }; }; +&L2 { + status = "disabled"; +}; + &uart1 { clock-frequency = < 50000000 >; }; Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/riscv/include/pmap.h Thu Oct 18 15:08:14 2018 (r339421) @@ -153,6 +153,8 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/riscv/include/pte.h ============================================================================== --- head/sys/riscv/include/pte.h Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/riscv/include/pte.h Thu Oct 18 15:08:14 2018 (r339421) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Andrew Turner - * Copyright (c) 2015-2016 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -65,7 +65,7 @@ typedef uint64_t pn_t; /* page number */ #define Ln_ENTRIES (1 << 9) #define Ln_ADDR_MASK (Ln_ENTRIES - 1) -/* Bits 9:7 are reserved for software */ +/* Bits 9:8 are reserved for software */ #define PTE_SW_MANAGED (1 << 9) #define PTE_SW_WIRED (1 << 8) #define PTE_D (1 << 7) /* Dirty */ @@ -78,6 +78,7 @@ typedef uint64_t pn_t; /* page number */ #define PTE_V (1 << 0) /* Valid */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) +#define PTE_KERN (PTE_V | PTE_RWX | PTE_A | PTE_D) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/riscv/riscv/locore.S Thu Oct 18 15:08:14 2018 (r339421) @@ -94,7 +94,7 @@ _start: add t3, t4, t2 li t5, 0 2: - li t0, (PTE_V | PTE_RWX | PTE_D) + li t0, (PTE_KERN) slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */ @@ -126,7 +126,7 @@ _start: mv s2, s11 srli s2, s2, PAGE_SHIFT - li t0, (PTE_V | PTE_RWX | PTE_D) + li t0, (PTE_KERN) slli t2, s2, PTE_PPN0_S /* << PTE_PPN0_S */ or t0, t0, t2 Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/riscv/riscv/pmap.c Thu Oct 18 15:08:14 2018 (r339421) @@ -15,7 +15,7 @@ * All rights reserved. * Copyright (c) 2014 The FreeBSD Foundation * All rights reserved. - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -487,7 +487,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi /* superpages */ pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(&l1[l1_slot], entry); } @@ -965,7 +965,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1063,7 +1063,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pn = (pa / PAGE_SIZE); l3 = pmap_l3(kernel_pmap, va); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1465,7 +1465,8 @@ pmap_growkernel(vm_offset_t addr) continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); - if ((pmap_load(l2) & PTE_A) != 0) { + if ((pmap_load(l2) & PTE_V) != 0 && + (pmap_load(l2) & PTE_RWX) == 0) { kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= vm_map_max(kernel_map)) { kernel_vm_end = vm_map_max(kernel_map); @@ -2008,6 +2009,41 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t PMAP_UNLOCK(pmap); } +int +pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot) +{ + pt_entry_t orig_l3; + pt_entry_t new_l3; + pt_entry_t *l3; + + l3 = pmap_l3(pmap, va); + if (l3 == NULL) + return (0); + + orig_l3 = pmap_load(l3); + if ((orig_l3 & PTE_V) == 0 || + ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || + ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) + return (0); + + new_l3 = orig_l3 | PTE_A; + if ((prot & VM_PROT_WRITE) != 0) + new_l3 |= PTE_D; + + if (orig_l3 != new_l3) { + pmap_load_store(l3, new_l3); + pmap_invalidate_page(pmap, va); + return (1); + } + + /* + * XXX: This case should never happen since it means + * the PTE shouldn't have resulted in a fault. + */ + + return (0); +} + /* * Insert the given physical page (p) at * the specified virtual address (v) in the @@ -2415,8 +2451,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - /* RISCVTODO: check permissions */ - entry = (PTE_V | PTE_RWX); + entry = (PTE_V | PTE_R | PTE_X); entry |= (pn << PTE_PPN0_S); /* Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Thu Oct 18 15:02:57 2018 (r339420) +++ head/sys/riscv/riscv/trap.c Thu Oct 18 15:08:14 2018 (r339421) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -212,6 +212,9 @@ data_abort(struct trapframe *frame, int lower) ftype = (VM_PROT_READ); } + if (pmap_fault_fixup(map->pmap, va, ftype)) + goto done; + if (map != kernel_map) { /* * Keep swapout from messing with us during this @@ -256,6 +259,7 @@ data_abort(struct trapframe *frame, int lower) } } +done: if (lower) userret(td, frame); } From owner-svn-src-head@freebsd.org Thu Oct 18 15:13:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E534610DF083 for ; Thu, 18 Oct 2018 15:13:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 655F58F609 for ; Thu, 18 Oct 2018 15:13:38 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1539875609; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Ua1ZAexgmIQ3COvGAKYtUNXOf2s1RtdT/jPzXIKqAu+XWvrvvbfJNWdCfMH7kyjT49n59CmoNu3Fm KU475lnaWFiBBi1kpeXbBJ8qy7397a8Ea0vK/dJEvc+DzDQ1Rx7HMo7bZqhR86zjv8ZITpd9ywxmRa IpcCuGSFVUZrbWQGszC+Ijkobkixoyl8S8tjw6BqZC8eInWs1Q4JU72Uj2sjUxg39s7ajOrtvdOu6w tRNoOBsAlQ/GnMHtDopcEq1JqGmvp2zT8iWHT+BjSyumg8yj2DigYb+wnhoi/wCXEzqyZCevOy8L79 bk7/Ta/ibgrVdJDwTWqgYePz2B0l3aQ== 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:to:from:subject:message-id:dkim-signature:from; bh=fKjJtst6BpGyhW3j03adGAkYTAdKriS41yG24qvyuGo=; b=cURHrPGdBwWgl65MenIOTJw2+q6kPQubbYa+LhlUS2OOQ0UrhQsHMKLgLDzydLhMflU9imgSYd163 znRZAQhiWuE5o3eeocgsRGNJm8VXENaXymgkG3OIrYDtLXULjctdftpDLcOYOqjbMl5N+BCMyVpml2 S1xgBhoCL6GQ+wW0/u5WB5gUb7Nz5o7CsmH35szoK8VLAvRpfOGGlOjbxWRBjsotyuMWy1G4MDF9Fw QB7+jSbnjQa2WdoR6bgj35ABLaxovkEJJBvOOxmnq1lwTpoLOy5N/D2/spOHTJWfeMbFs46cdJXMXs cTN1ygCLdaLWwjFY9ou4VBDCWyMyuBQ== ARC-Authentication-Results: i=1; outbound1.eu.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:to:from:subject:message-id:from; bh=fKjJtst6BpGyhW3j03adGAkYTAdKriS41yG24qvyuGo=; b=M47Xbn0n6zZS8xYs7x17YWoSDqJ3ZR65d6YMqlW7SgmrCwEtt8tiotHlCI3bnpkSzmBf1Kn/dM3tl DJ+xIM0wgy0aF01iyMfj009VI9EoF6yXRclqNA+zbhTJiqNdzsvVtaOdxq6BeMZe8UJNqASal2C62A j2QzqIU8Zl1z3q14hiWdaTDkimAFCYYq18mfCEsDISWlOV6J0Nj8SJGTyxHZZ85tgKoZIie0JXEfh+ +6bwWwVT4+DgY0YL/SR+hHVvXdobiDko6lOgvf7PCuCTQ0o2ll3yGp83Kq3I0PDc8auvlk4gUYfZV6 +bvM9rBL6Y/FZR8tqx12unpfjWMYPKA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 59a07aaf-d2e8-11e8-af32-edadc92cdc1a 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 (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 59a07aaf-d2e8-11e8-af32-edadc92cdc1a; Thu, 18 Oct 2018 15:13:26 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w9IFDKIQ035265; Thu, 18 Oct 2018 09:13:20 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1539875600.86290.14.camel@freebsd.org> Subject: Re: svn commit: r339421 - in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv From: Ian Lepore To: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 18 Oct 2018 09:13:20 -0600 In-Reply-To: <201810181508.w9IF8FfX034673@repo.freebsd.org> References: <201810181508.w9IF8FfX034673@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 18 Oct 2018 15:13:39 -0000 On Thu, 2018-10-18 at 15:08 +0000, Ruslan Bukin wrote: > Author: br > Date: Thu Oct 18 15:08:14 2018 > New Revision: 339421 > URL: https://svnweb.freebsd.org/changeset/base/339421 > > Log: >   Support RISC-V implementations that do not manage the A and D bits >   (e.g. RocketChip, lowRISC and derivatives). >    >   RISC-V page table entries support A (accessed) and D (dirty) bits. The >   spec makes hardware support for these bits optional. Implementations that >   do not manage these bits in hardware raise page faults for accesses to a >   valid page without A set and writes to a writable page without D set. >   Check for these types of faults when handling a page fault and fixup the >   PTE without calling vm_fault if they occur. >    >   Reviewed by: jhb, markj >   Approved by: re (gjb) >   Sponsored by: DARPA, AFRL >   Differential Revision: https://reviews.freebsd.org/D17424 > > Modified: >   head/sys/arm/arm/pl310.c >   head/sys/arm/conf/GENERIC >   head/sys/arm/conf/GENERIC-MMCCAM >   head/sys/arm/conf/SOCDK >   head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts >   head/sys/riscv/include/pmap.h >   head/sys/riscv/include/pte.h >   head/sys/riscv/riscv/locore.S >   head/sys/riscv/riscv/pmap.c >   head/sys/riscv/riscv/trap.c > It looks like some unintended arm files got included in this commit. -- Ian From owner-svn-src-head@freebsd.org Thu Oct 18 15:18:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D08910DF277; Thu, 18 Oct 2018 15:18:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACD0B8F847; Thu, 18 Oct 2018 15:18:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B38F218ED; Thu, 18 Oct 2018 15:18:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IFI0is040082; Thu, 18 Oct 2018 15:18:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IFHwwU040068; Thu, 18 Oct 2018 15:17:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201810181517.w9IFHwwU040068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Oct 2018 15:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339422 - in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv X-SVN-Commit-Revision: 339422 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.27 Precedence: list List-Id: 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, 18 Oct 2018 15:18:01 -0000 Author: br Date: Thu Oct 18 15:17:58 2018 New Revision: 339422 URL: https://svnweb.freebsd.org/changeset/base/339422 Log: Revert r339421 due to unintended files included to commit. Reported by: ian Approved by: re (gjb) Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/pl310.c head/sys/arm/conf/GENERIC head/sys/arm/conf/GENERIC-MMCCAM head/sys/arm/conf/SOCDK head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts head/sys/riscv/include/pmap.h head/sys/riscv/include/pte.h head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/trap.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/arm/arm/pl310.c Thu Oct 18 15:17:58 2018 (r339422) @@ -168,34 +168,27 @@ pl310_set_ram_latency(struct pl310_softc *sc, uint32_t { uint32_t v; - printf("%s\n", __func__); KASSERT(which_reg == PL310_TAG_RAM_CTRL || which_reg == PL310_DATA_RAM_CTRL, ("bad pl310 ram latency register address")); - printf("%s\n", __func__); v = pl310_read4(sc, which_reg); - printf("%s\n", __func__); if (setup != 0) { KASSERT(setup <= 8, ("bad pl310 setup latency: %d", setup)); v &= ~RAM_CTRL_SETUP_MASK; v |= (setup - 1) << RAM_CTRL_SETUP_SHIFT; } - printf("%s\n", __func__); if (read != 0) { KASSERT(read <= 8, ("bad pl310 read latency: %d", read)); v &= ~RAM_CTRL_READ_MASK; v |= (read - 1) << RAM_CTRL_READ_SHIFT; } - printf("%s\n", __func__); if (write != 0) { KASSERT(write <= 8, ("bad pl310 write latency: %d", write)); v &= ~RAM_CTRL_WRITE_MASK; v |= (write - 1) << RAM_CTRL_WRITE_SHIFT; } - printf("%s wr\n", __func__); pl310_write4(sc, which_reg, v); - printf("%s done\n", __func__); } static int @@ -489,8 +482,6 @@ pl310_attach(device_t dev) uint32_t cache_id, debug_ctrl; phandle_t node; - printf("%s\n", __func__); - sc->sc_dev = dev; rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -498,8 +489,6 @@ pl310_attach(device_t dev) if (sc->sc_mem_res == NULL) panic("%s: Cannot map registers", device_get_name(dev)); - printf("%s\n", __func__); - /* Allocate an IRQ resource */ rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -508,16 +497,10 @@ pl310_attach(device_t dev) device_printf(dev, "cannot allocate IRQ, not using interrupt\n"); } - printf("%s: mtx init\n", __func__); pl310_softc = sc; mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN); - printf("%s: pl310_read4\n", __func__); - printf("%s: pl310_read4\n", __func__); - printf("%s: pl310_read4\n", __func__); - cache_id = pl310_read4(sc, PL310_CACHE_ID); - printf("%s\n", __func__); sc->sc_rtl_revision = (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK; device_printf(dev, "Part number: 0x%x, release: 0x%x\n", Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/arm/conf/GENERIC Thu Oct 18 15:17:58 2018 (r339422) @@ -36,7 +36,6 @@ files "../allwinner/a31/files.a31" files "../allwinner/a33/files.a33" files "../allwinner/a83t/files.a83t" files "../allwinner/h3/files.h3" -files "../altera/socfpga/files.socfpga" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" files "../freescale/imx/files.imx6" @@ -57,8 +56,6 @@ options SOC_ALLWINNER_A33 options SOC_ALLWINNER_A83T options SOC_ALLWINNER_H2PLUS options SOC_ALLWINNER_H3 -options SOC_ALTERA_ARRIA10 -options SOC_ALTERA_CYCLONE5 options SOC_BCM2836 options SOC_MV_ARMADA38X options SOC_MV_ARMADAXP @@ -92,15 +89,10 @@ device pmu device generic_timer device mpcore_timer -# DMA support -device xdma -device pl330 - # MMC/SD/SDIO Card slot support device sdhci # SD controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards -device dwmmc # ATA controllers device ahci # AHCI-compatible SATA controllers @@ -177,9 +169,7 @@ device aw_cir device spibus device spigen device bcm2835_spi -device cqspi # Cadence Quad SPI Flash Controller device ti_spi -device n25q # n25q Quad SPI Flash # ADC support device ti_adc Modified: head/sys/arm/conf/GENERIC-MMCCAM ============================================================================== --- head/sys/arm/conf/GENERIC-MMCCAM Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/arm/conf/GENERIC-MMCCAM Thu Oct 18 15:17:58 2018 (r339422) @@ -20,6 +20,3 @@ device pass nodevice mmc nodevice mmcsd - -# dwmmc_altera.c fails to build -nodevice dwmmc Modified: head/sys/arm/conf/SOCDK ============================================================================== --- head/sys/arm/conf/SOCDK Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/arm/conf/SOCDK Thu Oct 18 15:17:58 2018 (r339422) @@ -20,7 +20,7 @@ #NO_UNIVERSE -include "GENERIC" +include "SOCFPGA" ident SOCDK options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" Modified: head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts ============================================================================== --- head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Thu Oct 18 15:17:58 2018 (r339422) @@ -61,10 +61,6 @@ }; }; -&L2 { - status = "disabled"; -}; - &uart1 { clock-frequency = < 50000000 >; }; Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/riscv/include/pmap.h Thu Oct 18 15:17:58 2018 (r339422) @@ -153,8 +153,6 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) -int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); - #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/riscv/include/pte.h ============================================================================== --- head/sys/riscv/include/pte.h Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/riscv/include/pte.h Thu Oct 18 15:17:58 2018 (r339422) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Andrew Turner - * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -65,7 +65,7 @@ typedef uint64_t pn_t; /* page number */ #define Ln_ENTRIES (1 << 9) #define Ln_ADDR_MASK (Ln_ENTRIES - 1) -/* Bits 9:8 are reserved for software */ +/* Bits 9:7 are reserved for software */ #define PTE_SW_MANAGED (1 << 9) #define PTE_SW_WIRED (1 << 8) #define PTE_D (1 << 7) /* Dirty */ @@ -78,7 +78,6 @@ typedef uint64_t pn_t; /* page number */ #define PTE_V (1 << 0) /* Valid */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) -#define PTE_KERN (PTE_V | PTE_RWX | PTE_A | PTE_D) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/riscv/riscv/locore.S Thu Oct 18 15:17:58 2018 (r339422) @@ -94,7 +94,7 @@ _start: add t3, t4, t2 li t5, 0 2: - li t0, (PTE_KERN) + li t0, (PTE_V | PTE_RWX | PTE_D) slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */ @@ -126,7 +126,7 @@ _start: mv s2, s11 srli s2, s2, PAGE_SHIFT - li t0, (PTE_KERN) + li t0, (PTE_V | PTE_RWX | PTE_D) slli t2, s2, PTE_PPN0_S /* << PTE_PPN0_S */ or t0, t0, t2 Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/riscv/riscv/pmap.c Thu Oct 18 15:17:58 2018 (r339422) @@ -15,7 +15,7 @@ * All rights reserved. * Copyright (c) 2014 The FreeBSD Foundation * All rights reserved. - * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2015-2017 Ruslan Bukin * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -487,7 +487,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi /* superpages */ pn = (pa / PAGE_SIZE); - entry = PTE_KERN; + entry = (PTE_V | PTE_RWX); entry |= (pn << PTE_PPN0_S); pmap_load_store(&l1[l1_slot], entry); } @@ -965,7 +965,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); pn = (pa / PAGE_SIZE); - entry = PTE_KERN; + entry = (PTE_V | PTE_RWX); entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1063,7 +1063,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pn = (pa / PAGE_SIZE); l3 = pmap_l3(kernel_pmap, va); - entry = PTE_KERN; + entry = (PTE_V | PTE_RWX); entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1465,8 +1465,7 @@ pmap_growkernel(vm_offset_t addr) continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); - if ((pmap_load(l2) & PTE_V) != 0 && - (pmap_load(l2) & PTE_RWX) == 0) { + if ((pmap_load(l2) & PTE_A) != 0) { kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= vm_map_max(kernel_map)) { kernel_vm_end = vm_map_max(kernel_map); @@ -2009,41 +2008,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t PMAP_UNLOCK(pmap); } -int -pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot) -{ - pt_entry_t orig_l3; - pt_entry_t new_l3; - pt_entry_t *l3; - - l3 = pmap_l3(pmap, va); - if (l3 == NULL) - return (0); - - orig_l3 = pmap_load(l3); - if ((orig_l3 & PTE_V) == 0 || - ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || - ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) - return (0); - - new_l3 = orig_l3 | PTE_A; - if ((prot & VM_PROT_WRITE) != 0) - new_l3 |= PTE_D; - - if (orig_l3 != new_l3) { - pmap_load_store(l3, new_l3); - pmap_invalidate_page(pmap, va); - return (1); - } - - /* - * XXX: This case should never happen since it means - * the PTE shouldn't have resulted in a fault. - */ - - return (0); -} - /* * Insert the given physical page (p) at * the specified virtual address (v) in the @@ -2451,7 +2415,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_R | PTE_X); + /* RISCVTODO: check permissions */ + entry = (PTE_V | PTE_RWX); entry |= (pn << PTE_PPN0_S); /* Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Thu Oct 18 15:08:14 2018 (r339421) +++ head/sys/riscv/riscv/trap.c Thu Oct 18 15:17:58 2018 (r339422) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2015-2017 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -212,9 +212,6 @@ data_abort(struct trapframe *frame, int lower) ftype = (VM_PROT_READ); } - if (pmap_fault_fixup(map->pmap, va, ftype)) - goto done; - if (map != kernel_map) { /* * Keep swapout from messing with us during this @@ -259,7 +256,6 @@ data_abort(struct trapframe *frame, int lower) } } -done: if (lower) userret(td, frame); } From owner-svn-src-head@freebsd.org Thu Oct 18 15:25:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5D4E10DF619; Thu, 18 Oct 2018 15:25:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77BA58FDD0; Thu, 18 Oct 2018 15:25:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72ACD21A8E; Thu, 18 Oct 2018 15:25:08 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IFP8rf044864; Thu, 18 Oct 2018 15:25:08 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IFP7qU044860; Thu, 18 Oct 2018 15:25:07 GMT (envelope-from br@FreeBSD.org) Message-Id: <201810181525.w9IFP7qU044860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 18 Oct 2018 15:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339423 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 339423 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.27 Precedence: list List-Id: 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, 18 Oct 2018 15:25:09 -0000 Author: br Date: Thu Oct 18 15:25:07 2018 New Revision: 339423 URL: https://svnweb.freebsd.org/changeset/base/339423 Log: Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives). RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardware support for these bits optional. Implementations that do not manage these bits in hardware raise page faults for accesses to a valid page without A set and writes to a writable page without D set. Check for these types of faults when handling a page fault and fixup the PTE without calling vm_fault if they occur. Reviewed by: jhb, markj Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17424 Modified: head/sys/riscv/include/pmap.h head/sys/riscv/include/pte.h head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Thu Oct 18 15:17:58 2018 (r339422) +++ head/sys/riscv/include/pmap.h Thu Oct 18 15:25:07 2018 (r339423) @@ -153,6 +153,8 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/riscv/include/pte.h ============================================================================== --- head/sys/riscv/include/pte.h Thu Oct 18 15:17:58 2018 (r339422) +++ head/sys/riscv/include/pte.h Thu Oct 18 15:25:07 2018 (r339423) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Andrew Turner - * Copyright (c) 2015-2016 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -65,7 +65,7 @@ typedef uint64_t pn_t; /* page number */ #define Ln_ENTRIES (1 << 9) #define Ln_ADDR_MASK (Ln_ENTRIES - 1) -/* Bits 9:7 are reserved for software */ +/* Bits 9:8 are reserved for software */ #define PTE_SW_MANAGED (1 << 9) #define PTE_SW_WIRED (1 << 8) #define PTE_D (1 << 7) /* Dirty */ @@ -78,6 +78,7 @@ typedef uint64_t pn_t; /* page number */ #define PTE_V (1 << 0) /* Valid */ #define PTE_RWX (PTE_R | PTE_W | PTE_X) #define PTE_RX (PTE_R | PTE_X) +#define PTE_KERN (PTE_V | PTE_RWX | PTE_A | PTE_D) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Thu Oct 18 15:17:58 2018 (r339422) +++ head/sys/riscv/riscv/locore.S Thu Oct 18 15:25:07 2018 (r339423) @@ -94,7 +94,7 @@ _start: add t3, t4, t2 li t5, 0 2: - li t0, (PTE_V | PTE_RWX | PTE_D) + li t0, (PTE_KERN) slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */ @@ -126,7 +126,7 @@ _start: mv s2, s11 srli s2, s2, PAGE_SHIFT - li t0, (PTE_V | PTE_RWX | PTE_D) + li t0, (PTE_KERN) slli t2, s2, PTE_PPN0_S /* << PTE_PPN0_S */ or t0, t0, t2 Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Oct 18 15:17:58 2018 (r339422) +++ head/sys/riscv/riscv/pmap.c Thu Oct 18 15:25:07 2018 (r339423) @@ -15,7 +15,7 @@ * All rights reserved. * Copyright (c) 2014 The FreeBSD Foundation * All rights reserved. - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -487,7 +487,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi /* superpages */ pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(&l1[l1_slot], entry); } @@ -965,7 +965,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); pn = (pa / PAGE_SIZE); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1063,7 +1063,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) pn = (pa / PAGE_SIZE); l3 = pmap_l3(kernel_pmap, va); - entry = (PTE_V | PTE_RWX); + entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); pmap_load_store(l3, entry); @@ -1465,7 +1465,8 @@ pmap_growkernel(vm_offset_t addr) continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); - if ((pmap_load(l2) & PTE_A) != 0) { + if ((pmap_load(l2) & PTE_V) != 0 && + (pmap_load(l2) & PTE_RWX) == 0) { kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= vm_map_max(kernel_map)) { kernel_vm_end = vm_map_max(kernel_map); @@ -2008,6 +2009,41 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t PMAP_UNLOCK(pmap); } +int +pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t prot) +{ + pt_entry_t orig_l3; + pt_entry_t new_l3; + pt_entry_t *l3; + + l3 = pmap_l3(pmap, va); + if (l3 == NULL) + return (0); + + orig_l3 = pmap_load(l3); + if ((orig_l3 & PTE_V) == 0 || + ((prot & VM_PROT_WRITE) != 0 && (orig_l3 & PTE_W) == 0) || + ((prot & VM_PROT_READ) != 0 && (orig_l3 & PTE_R) == 0)) + return (0); + + new_l3 = orig_l3 | PTE_A; + if ((prot & VM_PROT_WRITE) != 0) + new_l3 |= PTE_D; + + if (orig_l3 != new_l3) { + pmap_load_store(l3, new_l3); + pmap_invalidate_page(pmap, va); + return (1); + } + + /* + * XXX: This case should never happen since it means + * the PTE shouldn't have resulted in a fault. + */ + + return (0); +} + /* * Insert the given physical page (p) at * the specified virtual address (v) in the @@ -2415,8 +2451,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pa = VM_PAGE_TO_PHYS(m); pn = (pa / PAGE_SIZE); - /* RISCVTODO: check permissions */ - entry = (PTE_V | PTE_RWX); + entry = (PTE_V | PTE_R | PTE_X); entry |= (pn << PTE_PPN0_S); /* Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Thu Oct 18 15:17:58 2018 (r339422) +++ head/sys/riscv/riscv/trap.c Thu Oct 18 15:25:07 2018 (r339423) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2017 Ruslan Bukin + * Copyright (c) 2015-2018 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -212,6 +212,9 @@ data_abort(struct trapframe *frame, int lower) ftype = (VM_PROT_READ); } + if (pmap_fault_fixup(map->pmap, va, ftype)) + goto done; + if (map != kernel_map) { /* * Keep swapout from messing with us during this @@ -256,6 +259,7 @@ data_abort(struct trapframe *frame, int lower) } } +done: if (lower) userret(td, frame); } From owner-svn-src-head@freebsd.org Thu Oct 18 15:28:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F1710DF78A; Thu, 18 Oct 2018 15:28:39 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1031B8FFBC; Thu, 18 Oct 2018 15:28:38 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cam.ac.uk; s=20180806.ppsw; h=Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type :MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=02W72wh2gs54Jb5qVurg+332wlmbPf4y8q2FD815+N8=; b=nBOdk9f5TGEJFy3Csu2LSe4BcI GaupXC0FupPaUCKkhsttFEA4KjyejfhDshWmhVLWyBuJTmNtLurMrmpY3w3pwIOQnaSfUXezGg24f feVnZYlXSFfVnrVthWZccp0Kao5TVeJP59lJdS4A/UoRXNnOm7uPffbeFo71uvdeNVbY=; X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:47645) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1gDAE1-0008D9-fN (Exim 4.91) (return-path ); Thu, 18 Oct 2018 16:28:37 +0100 Date: Thu, 18 Oct 2018 16:27:37 +0100 From: Ruslan Bukin To: Ian Lepore Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339421 - in head/sys: arm/arm arm/conf dts/arm riscv/include riscv/riscv Message-ID: <20181018152737.GA53601@bsdpad.com> References: <201810181508.w9IF8FfX034673@repo.freebsd.org> <1539875600.86290.14.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1539875600.86290.14.camel@freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: 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, 18 Oct 2018 15:28:39 -0000 On Thu, Oct 18, 2018 at 09:13:20AM -0600, Ian Lepore wrote: > On Thu, 2018-10-18 at 15:08 +0000, Ruslan Bukin wrote: > > Author: br > > Date: Thu Oct 18 15:08:14 2018 > > New Revision: 339421 > > URL: https://svnweb.freebsd.org/changeset/base/339421 > > > > Log: > >   Support RISC-V implementations that do not manage the A and D bits > >   (e.g. RocketChip, lowRISC and derivatives). > >    > >   RISC-V page table entries support A (accessed) and D (dirty) bits. The > >   spec makes hardware support for these bits optional. Implementations that > >   do not manage these bits in hardware raise page faults for accesses to a > >   valid page without A set and writes to a writable page without D set. > >   Check for these types of faults when handling a page fault and fixup the > >   PTE without calling vm_fault if they occur. > >    > >   Reviewed by: jhb, markj > >   Approved by: re (gjb) > >   Sponsored by: DARPA, AFRL > >   Differential Revision: https://reviews.freebsd.org/D17424 > > > > Modified: > >   head/sys/arm/arm/pl310.c > >   head/sys/arm/conf/GENERIC > >   head/sys/arm/conf/GENERIC-MMCCAM > >   head/sys/arm/conf/SOCDK > >   head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts > >   head/sys/riscv/include/pmap.h > >   head/sys/riscv/include/pte.h > >   head/sys/riscv/riscv/locore.S > >   head/sys/riscv/riscv/pmap.c > >   head/sys/riscv/riscv/trap.c > > > > It looks like some unintended arm files got included in this commit. > Thanks, fixed! Ruslan From owner-svn-src-head@freebsd.org Thu Oct 18 15:35:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DF410DFA3B; Thu, 18 Oct 2018 15:35:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA6470670; Thu, 18 Oct 2018 15:35:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8169221C29; Thu, 18 Oct 2018 15:35:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IFZEmm050182; Thu, 18 Oct 2018 15:35:14 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IFZEoI050181; Thu, 18 Oct 2018 15:35:14 GMT (envelope-from des@FreeBSD.org) Message-Id: <201810181535.w9IFZEoI050181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 18 Oct 2018 15:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339424 - in head: libexec/rc/rc.d usr.sbin/unbound/setup X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: libexec/rc/rc.d usr.sbin/unbound/setup X-SVN-Commit-Revision: 339424 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.27 Precedence: list List-Id: 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, 18 Oct 2018 15:35:15 -0000 Author: des Date: Thu Oct 18 15:35:13 2018 New Revision: 339424 URL: https://svnweb.freebsd.org/changeset/base/339424 Log: Add support for DNS-over-TLS to the local_unbound service. Approved by: re (kib) Modified: head/libexec/rc/rc.d/local_unbound head/usr.sbin/unbound/setup/local-unbound-setup.sh Modified: head/libexec/rc/rc.d/local_unbound ============================================================================== --- head/libexec/rc/rc.d/local_unbound Thu Oct 18 15:25:07 2018 (r339423) +++ head/libexec/rc/rc.d/local_unbound Thu Oct 18 15:35:13 2018 (r339424) @@ -33,6 +33,7 @@ load_rc_config $name : ${local_unbound_controlconf:=${local_unbound_workdir}/control.conf} : ${local_unbound_anchor:=${local_unbound_workdir}/root.key} : ${local_unbound_forwarders:=} +: ${local_unbound_tls:=} do_as_unbound() { @@ -63,6 +64,10 @@ local_unbound_configtest() # local_unbound_setup() { + local tls_flag + if checkyesno local_unbound_tls ; then + tls_flag="-t" + fi echo "Performing initial setup." ${command}-setup -n \ -u unbound \ @@ -71,6 +76,7 @@ local_unbound_setup() -f ${local_unbound_forwardconf} \ -o ${local_unbound_controlconf} \ -a ${local_unbound_anchor} \ + ${tls_flag} \ ${local_unbound_forwarders} } Modified: head/usr.sbin/unbound/setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/setup/local-unbound-setup.sh Thu Oct 18 15:25:07 2018 (r339423) +++ head/usr.sbin/unbound/setup/local-unbound-setup.sh Thu Oct 18 15:35:13 2018 (r339424) @@ -29,6 +29,9 @@ # $FreeBSD$ # +D="${DESTDIR}" +echo "destination: ${D}" + # # Configuration variables # @@ -47,15 +50,30 @@ resolv_conf="" resolvconf_conf="" service="" start_unbound="" +use_tls="" forwarders="" # # Global variables # self=$(basename $(realpath "$0")) +bkdir=/var/backups bkext=$(date "+%Y%m%d.%H%M%S") # +# Regular expressions +# +RE_octet="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])" +RE_ipv4="(${RE_octet}(\\.${RE_octet}){3})" +RE_word="([0-9A-Fa-f]{1,4})" +RE_ipv6="((${RE_word}:){1,}(:|(:${RE_word})*)|::1)" +RE_port="([1-9][0-9]{0,3}|[1-5][0-9]{4,4}|6([0-4][0-9]{3}|5([0-4][0-9]{2}|5([0-2][0-9]|3[0-5]))))" +RE_dnsname="([0-9A-Za-z-]{1,}(\\.[0-9A-Za-z-]{1,})*\\.?)" +RE_forward_addr="((${RE_ipv4}|${RE_ipv6})(@${RE_port})?)" +RE_forward_name="(${RE_dnsname}(@${RE_port})?)" +RE_forward_tls="(${RE_forward_addr}(#${RE_dnsname})?)" + +# # Set default values for unset configuration variables. # set_defaults() { @@ -73,6 +91,7 @@ set_defaults() { : ${resolvconf_conf:=/etc/resolvconf.conf} : ${service:=local_unbound} : ${start_unbound:=yes} + : ${use_tls:=no} } # @@ -195,13 +214,16 @@ gen_forward_conf() { do_not_edit echo "forward-zone:" echo " name: ." - for forwarder ; do - if expr "${forwarder}" : "^[0-9A-Fa-f:.]\{1,\}$" >/dev/null ; then - echo " forward-addr: ${forwarder}" - else - echo " forward-host: ${forwarder}" - fi - done + for forwarder ; do echo "${forwarder}" ; done | + if [ "${use_tls}" = "yes" ] ; then + echo " forward-tls-upstream: yes" + sed -nE \ + -e "s/^(${RE_forward_tls})$/ forward-addr: \\1/p" + else + sed -nE \ + -e "s/^${RE_forward_addr}\$/ forward-addr: \\1/p" \ + -e "s/^${RE_forward_name}\$/ forward-host: \\1/p" + fi } # @@ -237,6 +259,9 @@ gen_unbound_conf() { echo " chroot: ${chrootdir}" echo " pidfile: ${pidfile}" echo " auto-trust-anchor-file: ${anchor}" + if [ "${use_tls}" = "yes" ] ; then + echo " tls-cert-bundle: /etc/ssl/cert.pem" + fi echo "" if [ -f "${forward_conf}" ] ; then echo "include: ${forward_conf}" @@ -257,26 +282,34 @@ gen_unbound_conf() { # backup() { local file="$1" - if [ -f "${file}" ] ; then - local bkfile="${file}.${bkext}" + if [ -f "${D}${file}" ] ; then + local bkfile="${bkdir}/${file##*/}.${bkext}" echo "Original ${file} saved as ${bkfile}" - mv "${file}" "${bkfile}" + mv "${D}${file}" "${D}${bkfile}" fi } # +# Wrapper for mktemp which respects DESTDIR +# +tmp() { + local file="$1" + mktemp -u "${D}${file}.XXXXX" +} + +# # Replace one file with another, making a backup copy of the first, # but only if the new file is different from the old. # replace() { local file="$1" local newfile="$2" - if [ ! -f "${file}" ] ; then + if [ ! -f "${D}${file}" ] ; then echo "${file} created" - mv "${newfile}" "${file}" - elif ! cmp -s "${file}" "${newfile}" ; then + mv "${newfile}" "${D}${file}" + elif ! cmp -s "${D}${file}" "${newfile}" ; then backup "${file}" - mv "${newfile}" "${file}" + mv "${newfile}" "${D}${file}" else echo "${file} not modified" rm "${newfile}" @@ -315,7 +348,7 @@ main() { # # Parse and validate command-line options # - while getopts "a:C:c:f:no:p:R:r:s:u:w:" option ; do + while getopts "a:C:c:f:no:p:R:r:s:tu:w:" option ; do case $option in a) anchor="$OPTARG" @@ -350,6 +383,9 @@ main() { s) service="$OPTARG" ;; + t) + use_tls="yes" + ;; u) user="$OPTARG" ;; @@ -376,7 +412,7 @@ main() { ;; "") echo "Extracting forwarders from ${resolv_conf}." - forwarders=$(get_nameservers <"${resolv_conf}") + forwarders=$(get_nameservers <"${D}${resolv_conf}") style=dynamic ;; *) @@ -398,7 +434,7 @@ main() { echo "Forwarding disabled, unbound will recurse." backup "${forward_conf}" else - local tmp_forward_conf=$(mktemp -u "${forward_conf}.XXXXX") + local tmp_forward_conf=$(tmp "${forward_conf}") gen_forward_conf ${forwarders} | unexpand >"${tmp_forward_conf}" replace "${forward_conf}" "${tmp_forward_conf}" fi @@ -406,21 +442,21 @@ main() { # # Generate lan-zones.conf. # - local tmp_lanzones_conf=$(mktemp -u "${lanzones_conf}.XXXXX") + local tmp_lanzones_conf=$(tmp "${lanzones_conf}") gen_lanzones_conf | unexpand >"${tmp_lanzones_conf}" replace "${lanzones_conf}" "${tmp_lanzones_conf}" # # Generate control.conf. # - local tmp_control_conf=$(mktemp -u "${control_conf}.XXXXX") + local tmp_control_conf=$(tmp "${control_conf}") gen_control_conf | unexpand >"${tmp_control_conf}" replace "${control_conf}" "${tmp_control_conf}" # # Generate unbound.conf. # - local tmp_unbound_conf=$(mktemp -u "${unbound_conf}.XXXXX") + local tmp_unbound_conf=$(tmp "${unbound_conf}") set_chrootdir gen_unbound_conf | unexpand >"${tmp_unbound_conf}" replace "${unbound_conf}" "${tmp_unbound_conf}" @@ -445,15 +481,15 @@ main() { # Rewrite resolvconf.conf so resolvconf updates forward.conf # instead of resolv.conf. # - local tmp_resolvconf_conf=$(mktemp -u "${resolvconf_conf}.XXXXX") + local tmp_resolvconf_conf=$(tmp "${resolvconf_conf}") gen_resolvconf_conf "${style}" | unexpand >"${tmp_resolvconf_conf}" replace "${resolvconf_conf}" "${tmp_resolvconf_conf}" # # Finally, rewrite resolv.conf. # - local tmp_resolv_conf=$(mktemp -u "${resolv_conf}.XXXXX") - gen_resolv_conf <"${resolv_conf}" | unexpand >"${tmp_resolv_conf}" + local tmp_resolv_conf=$(tmp "${resolv_conf}") + gen_resolv_conf <"${D}${resolv_conf}" | unexpand >"${tmp_resolv_conf}" replace "${resolv_conf}" "${tmp_resolv_conf}" } From owner-svn-src-head@freebsd.org Thu Oct 18 18:33:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BB5DEFE05C; Thu, 18 Oct 2018 18:33:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7A3376E6A; Thu, 18 Oct 2018 18:33:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2A1423A24; Thu, 18 Oct 2018 18:33:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IIXicK042541; Thu, 18 Oct 2018 18:33:44 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IIXi7M042540; Thu, 18 Oct 2018 18:33:44 GMT (envelope-from des@FreeBSD.org) Message-Id: <201810181833.w9IIXi7M042540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 18 Oct 2018 18:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339427 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 339427 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.29 Precedence: list List-Id: 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, 18 Oct 2018 18:33:45 -0000 Author: des Date: Thu Oct 18 18:33:44 2018 New Revision: 339427 URL: https://svnweb.freebsd.org/changeset/base/339427 Log: The local_unbound service will configure and bootstrap itself, but only if a network connection is available. This is not an issue when running 'service local_unbound setup' interactively, but can be on a diskless system where local_unbound self-configures on every boot. To address this, add explicit dependencies on netwait and defaultroute. Submitted by: eugen Approved by: re (gjb) Modified: head/libexec/rc/rc.d/local_unbound Modified: head/libexec/rc/rc.d/local_unbound ============================================================================== --- head/libexec/rc/rc.d/local_unbound Thu Oct 18 17:33:30 2018 (r339426) +++ head/libexec/rc/rc.d/local_unbound Thu Oct 18 18:33:44 2018 (r339427) @@ -4,7 +4,7 @@ # # PROVIDE: local_unbound -# REQUIRE: FILESYSTEMS netif resolv +# REQUIRE: FILESYSTEMS defaultroute netwait resolv # BEFORE: NETWORKING # KEYWORD: shutdown From owner-svn-src-head@freebsd.org Thu Oct 18 19:07:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB9FEFF28F; Thu, 18 Oct 2018 19:07:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 635D378835; Thu, 18 Oct 2018 19:07:16 +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 5CD5123F68; Thu, 18 Oct 2018 19:07:16 +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 w9IJ7GZf058740; Thu, 18 Oct 2018 19:07:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IJ7GdT058739; Thu, 18 Oct 2018 19:07:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810181907.w9IJ7GdT058739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 18 Oct 2018 19:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339428 - head X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 339428 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.29 Precedence: list List-Id: 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, 18 Oct 2018 19:07:16 -0000 Author: gjb Date: Thu Oct 18 19:07:15 2018 New Revision: 339428 URL: https://svnweb.freebsd.org/changeset/base/339428 Log: Correct the comment for the 20181015 entry in ObsoleteFiles.inc. Reported by: rpokala Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Oct 18 18:33:44 2018 (r339427) +++ head/ObsoleteFiles.inc Thu Oct 18 19:07:15 2018 (r339428) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20181015: Stale libcasper(3) files following 20181009: OpenSSL 1.1.1 +# 20181015: Stale libcasper(3) files following r329452 OLD_LIBS+=lib/casper/libcap_sysctl.so.0 OLD_LIBS+=lib/casper/libcap_grp.so.0 OLD_LIBS+=lib/casper/libcap_pwd.so.0 From owner-svn-src-head@freebsd.org Thu Oct 18 19:12:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B6AEFF5CB; Thu, 18 Oct 2018 19:12:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C62E8793A5; Thu, 18 Oct 2018 19:12:36 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6AA9222BC5; Thu, 18 Oct 2018 15:12:36 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute3.internal (MEProxy); Thu, 18 Oct 2018 15:12:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=fm1; bh=J12kN47JcanCBwgNXwZ5oqV8MOjE9dzL/wdkqoOL8 28=; b=G0Y7A2sIYMOlnSiwbLqf7HgHoyS+UO4fWW7PXkDUZJiV9vzu2S0j1/GTW Mr/vknpLmShDggXAUg9+RqBfAjx1gYAj524kYyizpDvVftC8ocBHbXEooQmveTOF xX1IrgVW5OU/SkwmBlptGDANuhJ6Maf5G7+QtZPLx5n8/WxPDidKUcrACqwzSral ReCLLBdP9DP3pTcxZJ6hPvZWJv02Tho3WpYW9+neaGmC+t2YwRixmr2wI523xJAJ sA8yV8+eD6f/FjOkdZ49fPXtM0xqCPEvquGXK/seosclR7JZEuw5brKmm4esFevc qmhXfR0GirPAxc35OJoyCbVrwXDHA== X-ME-Sender: X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 99) id E667C9410D; Thu, 18 Oct 2018 15:12:35 -0400 (EDT) Message-Id: <1539889955.648460.1546878736.13544E2C@webmail.messagingengine.com> From: Mark Felder To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-cc4e8f33 Subject: Re: svn commit: r337669 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/ztest cddl/usr.bin/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common... Date: Thu, 18 Oct 2018 14:12:35 -0500 References: <201808120045.w7C0jsYR077215@repo.freebsd.org> In-Reply-To: <201808120045.w7C0jsYR077215@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Oct 2018 19:12:37 -0000 On Sat, Aug 11, 2018, at 19:45, Matt Macy wrote: > Author: mmacy > Date: Sun Aug 12 00:45:53 2018 > New Revision: 337669 > URL: https://svnweb.freebsd.org/changeset/base/337669 > > Log: > MFV/ZoL: Implement large_dnode pool feature > I just noticed this feature is missing from zpool-features.7 man page. Is there an entry we can borrow from ZoL or OpenZFS? -- Mark Felder ports-secteam & portmgr member feld@FreeBSD.org From owner-svn-src-head@freebsd.org Thu Oct 18 19:16:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7517EFF6A7; Thu, 18 Oct 2018 19:16:26 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4078B79555; Thu, 18 Oct 2018 19:16:25 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w9IJGIj3063825 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Oct 2018 21:16:18 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: des@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w9IJGHQu010089 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 19 Oct 2018 02:16:17 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r339427 - head/libexec/rc/rc.d To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810181833.w9IIXi7M042540@repo.freebsd.org> From: Eugene Grosbein Message-ID: <3e564aed-efee-b39a-16b8-bb46008cbfa6@grosbein.net> Date: Fri, 19 Oct 2018 02:16:11 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201810181833.w9IIXi7M042540@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM,SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 Oct 2018 19:16:26 -0000 19.10.2018 1:33, Dag-Erling Smørgrav wrote: > Author: des > Date: Thu Oct 18 18:33:44 2018 > New Revision: 339427 > URL: https://svnweb.freebsd.org/changeset/base/339427 > > Log: > The local_unbound service will configure and bootstrap itself, but only > if a network connection is available. This is not an issue when running > 'service local_unbound setup' interactively, but can be on a diskless > system where local_unbound self-configures on every boot. To address > this, add explicit dependencies on netwait and defaultroute. > > Submitted by: eugen > Approved by: re (gjb) > > Modified: > head/libexec/rc/rc.d/local_unbound > > Modified: head/libexec/rc/rc.d/local_unbound > ============================================================================== > --- head/libexec/rc/rc.d/local_unbound Thu Oct 18 17:33:30 2018 (r339426) > +++ head/libexec/rc/rc.d/local_unbound Thu Oct 18 18:33:44 2018 (r339427) > @@ -4,7 +4,7 @@ > # > > # PROVIDE: local_unbound > -# REQUIRE: FILESYSTEMS netif resolv > +# REQUIRE: FILESYSTEMS defaultroute netwait resolv > # BEFORE: NETWORKING > # KEYWORD: shutdown Thank you! From owner-svn-src-head@freebsd.org Thu Oct 18 19:21:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8411EFF958; Thu, 18 Oct 2018 19:21:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E15879A19; Thu, 18 Oct 2018 19:21:19 +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 6923F24259; Thu, 18 Oct 2018 19:21:19 +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 w9IJLJ0V065705; Thu, 18 Oct 2018 19:21:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IJLIEu065703; Thu, 18 Oct 2018 19:21:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201810181921.w9IJLIEu065703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Oct 2018 19:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339430 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 339430 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.29 Precedence: list List-Id: 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, 18 Oct 2018 19:21:20 -0000 Author: tuexen Date: Thu Oct 18 19:21:18 2018 New Revision: 339430 URL: https://svnweb.freebsd.org/changeset/base/339430 Log: The handling of RST segments in the SYN-RCVD state exists in the code paths. Both are not consistent and the one on the syn cache code does not conform to the relevant specifications (Page 69 of RFC 793 and Section 4.2 of RFC 5961). This patch fixes this: * The sequence numbers checks are fixed as specified on page Page 69 RFC 793. * The sysctl variable net.inet.tcp.insecure_rst is now honoured and the behaviour as specified in Section 4.2 of RFC 5961. Approved by: re (gjb@) Reviewed by: bz@, glebius@, rrs@, Differential Revision: https://reviews.freebsd.org/D17595 Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Oct 18 19:19:45 2018 (r339429) +++ head/sys/netinet/tcp_input.c Thu Oct 18 19:21:18 2018 (r339430) @@ -1165,7 +1165,7 @@ tfo_socket_result: * causes. */ if (thflags & TH_RST) { - syncache_chkrst(&inc, th); + syncache_chkrst(&inc, th, m); goto dropunlock; } /* Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Oct 18 19:19:45 2018 (r339429) +++ head/sys/netinet/tcp_syncache.c Thu Oct 18 19:21:18 2018 (r339430) @@ -131,7 +131,7 @@ static void syncache_drop(struct syncache *, struct s static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); static int syncache_respond(struct syncache *, struct syncache_head *, - const struct mbuf *); + const struct mbuf *, int); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -489,7 +489,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - syncache_respond(sc, sch, NULL); + syncache_respond(sc, sch, NULL, TH_SYN|TH_ACK); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -537,9 +537,10 @@ syncache_lookup(struct in_conninfo *inc, struct syncac * This function is called when we get a RST for a * non-existent connection, so that we can see if the * connection is in the syn cache. If it is, zap it. + * If required send a challenge ACK. */ void -syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th) +syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m) { struct syncache *sc; struct syncache_head *sch; @@ -590,19 +591,36 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr * send a reset with the sequence number at the rightmost edge * of our receive window, and we have to handle this case. */ - if (SEQ_GEQ(th->th_seq, sc->sc_irs) && - SEQ_LEQ(th->th_seq, sc->sc_irs + sc->sc_wnd)) { - syncache_drop(sc, sch); - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: Our SYN|ACK was rejected, " - "connection attempt aborted by remote endpoint\n", - s, __func__); - TCPSTAT_INC(tcps_sc_reset); + if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) && + SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) || + (sc->sc_wnd == 0 && th->th_seq == sc->sc_irs + 1)) { + if (V_tcp_insecure_rst || + th->th_seq == sc->sc_irs + 1) { + syncache_drop(sc, sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, + "%s; %s: Our SYN|ACK was rejected, " + "connection attempt aborted by remote " + "endpoint\n", + s, __func__); + TCPSTAT_INC(tcps_sc_reset); + } else { + TCPSTAT_INC(tcps_badrst); + /* Send challenge ACK. */ + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: RST with invalid " + " SEQ %u != NXT %u (+WND %u), " + "sending challenge ACK\n", + s, __func__, + th->th_seq, sc->sc_irs + 1, sc->sc_wnd); + syncache_respond(sc, sch, m, TH_ACK); + } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: RST with invalid SEQ %u != " - "IRS %u (+WND %u), segment ignored\n", - s, __func__, th->th_seq, sc->sc_irs, sc->sc_wnd); + "NXT %u (+WND %u), segment ignored\n", + s, __func__, + th->th_seq, sc->sc_irs + 1, sc->sc_wnd); TCPSTAT_INC(tcps_badrst); } @@ -1413,7 +1431,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, m) == 0) { + if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1577,7 +1595,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, m) == 0) { + if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1618,12 +1636,12 @@ tfo_expanded: } /* - * Send SYN|ACK to the peer. Either in response to the peer's SYN, + * Send SYN|ACK or ACK to the peer. Either in response to a peer's segment, * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. */ static int syncache_respond(struct syncache *sc, struct syncache_head *sch, - const struct mbuf *m0) + const struct mbuf *m0, int flags) { struct ip *ip = NULL; struct mbuf *m; @@ -1709,15 +1727,18 @@ syncache_respond(struct syncache *sc, struct syncache_ th->th_sport = sc->sc_inc.inc_lport; th->th_dport = sc->sc_inc.inc_fport; - th->th_seq = htonl(sc->sc_iss); + if (flags & TH_SYN) + th->th_seq = htonl(sc->sc_iss); + else + th->th_seq = htonl(sc->sc_iss + 1); th->th_ack = htonl(sc->sc_irs + 1); th->th_off = sizeof(struct tcphdr) >> 2; th->th_x2 = 0; - th->th_flags = TH_SYN|TH_ACK; + th->th_flags = flags; th->th_win = htons(sc->sc_wnd); th->th_urp = 0; - if (sc->sc_flags & SCF_ECN) { + if ((flags & TH_SYN) && (sc->sc_flags & SCF_ECN)) { th->th_flags |= TH_ECE; TCPSTAT_INC(tcps_ecn_shs); } @@ -1726,29 +1747,31 @@ syncache_respond(struct syncache *sc, struct syncache_ if ((sc->sc_flags & SCF_NOOPT) == 0) { to.to_flags = 0; - to.to_mss = mssopt; - to.to_flags = TOF_MSS; - if (sc->sc_flags & SCF_WINSCALE) { - to.to_wscale = sc->sc_requested_r_scale; - to.to_flags |= TOF_SCALE; + if (flags & TH_SYN) { + to.to_mss = mssopt; + to.to_flags = TOF_MSS; + if (sc->sc_flags & SCF_WINSCALE) { + to.to_wscale = sc->sc_requested_r_scale; + to.to_flags |= TOF_SCALE; + } + if (sc->sc_flags & SCF_SACK) + to.to_flags |= TOF_SACKPERM; +#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) + if (sc->sc_flags & SCF_SIGNATURE) + to.to_flags |= TOF_SIGNATURE; +#endif + if (sc->sc_tfo_cookie) { + to.to_flags |= TOF_FASTOPEN; + to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; + to.to_tfo_cookie = sc->sc_tfo_cookie; + /* don't send cookie again when retransmitting response */ + sc->sc_tfo_cookie = NULL; + } } if (sc->sc_flags & SCF_TIMESTAMP) { to.to_tsval = sc->sc_tsoff + tcp_ts_getticks(); to.to_tsecr = sc->sc_tsreflect; to.to_flags |= TOF_TS; - } - if (sc->sc_flags & SCF_SACK) - to.to_flags |= TOF_SACKPERM; -#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE) - if (sc->sc_flags & SCF_SIGNATURE) - to.to_flags |= TOF_SIGNATURE; -#endif - if (sc->sc_tfo_cookie) { - to.to_flags |= TOF_FASTOPEN; - to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; - to.to_tfo_cookie = sc->sc_tfo_cookie; - /* don't send cookie again when retransmitting response */ - sc->sc_tfo_cookie = NULL; } optlen = tcp_addoptions(&to, (u_char *)(th + 1)); Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Thu Oct 18 19:19:45 2018 (r339429) +++ head/sys/netinet/tcp_syncache.h Thu Oct 18 19:21:18 2018 (r339430) @@ -46,7 +46,7 @@ int syncache_expand(struct in_conninfo *, struct tcpo int syncache_add(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct inpcb *, struct socket **, struct mbuf *, void *, void *); -void syncache_chkrst(struct in_conninfo *, struct tcphdr *); +void syncache_chkrst(struct in_conninfo *, struct tcphdr *, struct mbuf *); void syncache_badack(struct in_conninfo *); int syncache_pcblist(struct sysctl_req *req, int max_pcbs, int *pcbs_exported); From owner-svn-src-head@freebsd.org Thu Oct 18 20:20:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BE5F73D69; Thu, 18 Oct 2018 20:20:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29A6E7CF29; Thu, 18 Oct 2018 20:20:42 +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 2496724BC1; Thu, 18 Oct 2018 20:20:42 +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 w9IKKgQ2097506; Thu, 18 Oct 2018 20:20:42 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IKKfOS097505; Thu, 18 Oct 2018 20:20:41 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201810182020.w9IKKfOS097505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Oct 2018 20:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339431 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339431 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.29 Precedence: list List-Id: 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, 18 Oct 2018 20:20:42 -0000 Author: bz Date: Thu Oct 18 20:20:41 2018 New Revision: 339431 URL: https://svnweb.freebsd.org/changeset/base/339431 Log: In r78161 the lookup_set linker method was introduced which optionally returns the section start and stop locations as well as a count if the caller asks for them. There was only one out-of-file consumer of count which did not actually use it and hence was eliminated in r339407. In r194784 parse_dpcpu(), and in r195699 parse_vnet() (a copy of the former) started to use the link_elf_lookup_set() interface internally also asking for the count. count is computed as the difference of the void **stop - void **start locations and as such, if the absoulte numbers (stop - start) % sizeof(void *) != 0 a round-down happens, e.g., **stop 0x1003 - **start 0x1000 => count 0. To get the section size instead of "count is the number of pointer elements in the section", the parse_*() functions do a count *= sizeof(void *). They use the result to allocate memory and copy the section data into the "master" and per-instance memory regions with a size of count. As a result of count possibly round-down this can miss the last bytes of the section. The good news is that we do not touch out of bounds memory during these operations (we may at a later stage if the last bytes would overflow the master sections). Given relocation in elf_relocaddr() works based on the absolute numbers of start and stop, this means that we can possibly try to access relocated data which was never copied and hence we get random garbage or at best zeroed memory. Stop the two (last) consumers of count (the parse_*() functions) from using count as well, and calculate the section size based on the absolute numbers of stop and start and use the proper size for the memory allocation and data copies. This will make the symbols in the last bytes of the pcpu or vnet sections be presented as expected. PR: 232289 Approved by: re (gjb) MFC after: 2 weeks Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Oct 18 19:21:18 2018 (r339430) +++ head/sys/kern/link_elf.c Thu Oct 18 20:20:41 2018 (r339431) @@ -618,27 +618,29 @@ parse_dynamic(elf_file_t ef) static int parse_dpcpu(elf_file_t ef) { - int count; - int error; + int error, size; ef->pcpu_start = 0; ef->pcpu_stop = 0; error = link_elf_lookup_set(&ef->lf, "pcpu", (void ***)&ef->pcpu_start, - (void ***)&ef->pcpu_stop, &count); + (void ***)&ef->pcpu_stop, NULL); /* Error just means there is no pcpu set to relocate. */ if (error != 0) return (0); - count *= sizeof(void *); + size = (uintptr_t)ef->pcpu_stop - (uintptr_t)ef->pcpu_start; + /* Empty set? */ + if (size < 1) + return (0); /* * Allocate space in the primary pcpu area. Copy in our * initialization from the data section and then initialize * all per-cpu storage from that. */ - ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(count); + ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(size); if (ef->pcpu_base == 0) return (ENOSPC); - memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); - dpcpu_copy((void *)ef->pcpu_base, count); + memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, size); + dpcpu_copy((void *)ef->pcpu_base, size); elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, ef->pcpu_base); @@ -649,27 +651,29 @@ parse_dpcpu(elf_file_t ef) static int parse_vnet(elf_file_t ef) { - int count; - int error; + int error, size; ef->vnet_start = 0; ef->vnet_stop = 0; error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start, - (void ***)&ef->vnet_stop, &count); + (void ***)&ef->vnet_stop, NULL); /* Error just means there is no vnet data set to relocate. */ if (error != 0) return (0); - count *= sizeof(void *); + size = (uintptr_t)ef->vnet_stop - (uintptr_t)ef->vnet_start; + /* Empty set? */ + if (size < 1) + return (0); /* * Allocate space in the primary vnet area. Copy in our * initialization from the data section and then initialize * all per-vnet storage from that. */ - ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(count); + ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(size); if (ef->vnet_base == 0) return (ENOSPC); - memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); - vnet_data_copy((void *)ef->vnet_base, count); + memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, size); + vnet_data_copy((void *)ef->vnet_base, size); elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, ef->vnet_base); From owner-svn-src-head@freebsd.org Thu Oct 18 20:49:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E71CAF749E4; Thu, 18 Oct 2018 20:49:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE0F7DFE8; Thu, 18 Oct 2018 20:49:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 921D0250C3; Thu, 18 Oct 2018 20:49:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9IKnHv3012326; Thu, 18 Oct 2018 20:49:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9IKnG5u012323; Thu, 18 Oct 2018 20:49:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810182049.w9IKnG5u012323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 18 Oct 2018 20:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339432 - in head/sys/amd64: amd64 include pci X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include pci X-SVN-Commit-Revision: 339432 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.29 Precedence: list List-Id: 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, 18 Oct 2018 20:49:18 -0000 Author: kib Date: Thu Oct 18 20:49:16 2018 New Revision: 339432 URL: https://svnweb.freebsd.org/changeset/base/339432 Log: Do not flush cache for PCIe config window. Apparently AMD machines cannot tolerate this. This was uncovered by r339386, where cache flush started really flushing the requested range. Introduce pmap_mapdev_pciecfg(), which simply does not flush cache comparing with pmap_mapdev(). It assumes that the MCFG region was never accessed through the cacheable mapping, which is most likely true for machine to boot at all. Note that i386 does not need the change, since the architecture handles access per-page due to the KVA shortage, and page remapping already does not flush the cache. Reported and tested by: mjg, Mike Tancsa Reviewed by: alc Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D17612 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/pci/pci_cfgreg.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Oct 18 20:20:41 2018 (r339431) +++ head/sys/amd64/amd64/pmap.c Thu Oct 18 20:49:16 2018 (r339432) @@ -637,7 +637,8 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); -static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, + bool noflush); static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); @@ -7098,8 +7099,8 @@ pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mas * routine is intended to be used for mapping device memory, * NOT real memory. */ -void * -pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) +static void * +pmap_mapdev_internal(vm_paddr_t pa, vm_size_t size, int mode, bool noflush) { struct pmap_preinit_mapping *ppim; vm_offset_t va, offset; @@ -7142,7 +7143,10 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mo */ if (pa < dmaplimit && pa + size <= dmaplimit) { va = PHYS_TO_DMAP(pa); - if (!pmap_change_attr(va, size, mode)) + PMAP_LOCK(kernel_pmap); + i = pmap_change_attr_locked(va, size, mode, noflush); + PMAP_UNLOCK(kernel_pmap); + if (!i) return ((void *)(va + offset)); } va = kva_alloc(size); @@ -7152,22 +7156,37 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mo for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); pmap_invalidate_range(kernel_pmap, va, va + tmpsize); - pmap_invalidate_cache_range(va, va + tmpsize); + if (!noflush) + pmap_invalidate_cache_range(va, va + tmpsize); return ((void *)(va + offset)); } void * +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) +{ + + return (pmap_mapdev_internal(pa, size, mode, false)); +} + +void * pmap_mapdev(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_attr(pa, size, PAT_UNCACHEABLE)); + return (pmap_mapdev_internal(pa, size, PAT_UNCACHEABLE, false)); } void * +pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size) +{ + + return (pmap_mapdev_internal(pa, size, PAT_UNCACHEABLE, true)); +} + +void * pmap_mapbios(vm_paddr_t pa, vm_size_t size) { - return (pmap_mapdev_attr(pa, size, PAT_WRITE_BACK)); + return (pmap_mapdev_internal(pa, size, PAT_WRITE_BACK, false)); } void @@ -7306,13 +7325,13 @@ pmap_change_attr(vm_offset_t va, vm_size_t size, int m int error; PMAP_LOCK(kernel_pmap); - error = pmap_change_attr_locked(va, size, mode); + error = pmap_change_attr_locked(va, size, mode, false); PMAP_UNLOCK(kernel_pmap); return (error); } static int -pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) +pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool noflush) { vm_offset_t base, offset, tmpva; vm_paddr_t pa_start, pa_end, pa_end1; @@ -7429,7 +7448,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode); + pa_end - pa_start, mode, noflush); if (error != 0) break; /* Start physical address run. */ @@ -7459,7 +7478,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode); + pa_end - pa_start, mode, noflush); if (error != 0) break; /* Start physical address run. */ @@ -7487,7 +7506,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size /* Run ended, update direct map. */ error = pmap_change_attr_locked( PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode); + pa_end - pa_start, mode, noflush); if (error != 0) break; /* Start physical address run. */ @@ -7502,7 +7521,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size pa_end1 = MIN(pa_end, dmaplimit); if (pa_start != pa_end1) error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), - pa_end1 - pa_start, mode); + pa_end1 - pa_start, mode, noflush); } /* @@ -7511,7 +7530,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache_range(base, tmpva); + if (!noflush) + pmap_invalidate_cache_range(base, tmpva); } return (error); } Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Thu Oct 18 20:20:41 2018 (r339431) +++ head/sys/amd64/include/pmap.h Thu Oct 18 20:49:16 2018 (r339432) @@ -430,6 +430,7 @@ void pmap_large_unmap(void *sva, vm_size_t len); void *pmap_mapbios(vm_paddr_t, vm_size_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); +void *pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size); boolean_t pmap_page_is_mapped(vm_page_t m); void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); void pmap_pinit_pml4(vm_page_t); Modified: head/sys/amd64/pci/pci_cfgreg.c ============================================================================== --- head/sys/amd64/pci/pci_cfgreg.c Thu Oct 18 20:20:41 2018 (r339431) +++ head/sys/amd64/pci/pci_cfgreg.c Thu Oct 18 20:49:16 2018 (r339432) @@ -271,7 +271,7 @@ pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t base); /* XXX: We should make sure this really fits into the direct map. */ - pcie_base = (vm_offset_t)pmap_mapdev(base, (maxbus + 1) << 20); + pcie_base = (vm_offset_t)pmap_mapdev_pciecfg(base, (maxbus + 1) << 20); pcie_minbus = minbus; pcie_maxbus = maxbus; cfgmech = CFGMECH_PCIE; From owner-svn-src-head@freebsd.org Fri Oct 19 00:37:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A514F7A4C3; Fri, 19 Oct 2018 00:37: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0C0A85EC6; Fri, 19 Oct 2018 00:37:49 +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 B70B02767F; Fri, 19 Oct 2018 00:37:49 +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 w9J0bnQJ031627; Fri, 19 Oct 2018 00:37:49 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9J0blks031617; Fri, 19 Oct 2018 00:37:47 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810190037.w9J0blks031617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 19 Oct 2018 00:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339436 - in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head: . contrib/gcc gnu/usr.bin/cc/cc_tools lib/clang release sys/conf sys/sys X-SVN-Commit-Revision: 339436 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.29 Precedence: list List-Id: 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, 19 Oct 2018 00:37:50 -0000 Author: gjb Date: Fri Oct 19 00:37:47 2018 New Revision: 339436 URL: https://svnweb.freebsd.org/changeset/base/339436 Log: - Update head to 13.0-CURRENT. - Bump MACHINE_TRIPLE, TARGET_TRIPLE, FBSD_MAJOR, FBSD_CC_VER, FREEBSD_CC_VERSION, OS_VERSION. - Update comment in UPDATING regarding debugging options. - Remove debug.witness.trace=0 from installation media. - Bump __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/UPDATING head/contrib/gcc/config.gcc head/gnu/usr.bin/cc/cc_tools/freebsd-native.h head/lib/clang/freebsd_cc_version.h head/lib/clang/llvm.build.mk head/release/Makefile head/sys/conf/newvers.sh head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Oct 19 00:24:23 2018 (r339435) +++ head/Makefile.inc1 Fri Oct 19 00:37:47 2018 (r339436) @@ -126,9 +126,9 @@ TARGET_ABI= gnueabi .endif .endif MACHINE_ABI?= unknown -MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 +MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd13.0 TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 +TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd13.0 KNOWN_ARCHES?= aarch64/arm64 \ amd64 \ arm \ Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 19 00:24:23 2018 (r339435) +++ head/UPDATING Fri Oct 19 00:37:47 2018 (r339436) @@ -16,8 +16,8 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. -NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: - FreeBSD 12.x has many debugging features turned on, in both the kernel +NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: + FreeBSD 13.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of system primitives, and encourage loud failure through extra sanity checking and fail stop semantics. They also substantially impact Modified: head/contrib/gcc/config.gcc ============================================================================== --- head/contrib/gcc/config.gcc Fri Oct 19 00:24:23 2018 (r339435) +++ head/contrib/gcc/config.gcc Fri Oct 19 00:37:47 2018 (r339436) @@ -434,6 +434,8 @@ case ${target} in tm_defines="${tm_defines} FBSD_MAJOR=11" ;; *-*-freebsd12 | *-*-freebsd12.*) tm_defines="${tm_defines} FBSD_MAJOR=12" ;; + *-*-freebsd13 | *-*-freebsd13.*) + tm_defines="${tm_defines} FBSD_MAJOR=13" ;; *) echo 'Please update *-*-freebsd* in gcc/config.gcc' exit 1 Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Fri Oct 19 00:24:23 2018 (r339435) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Fri Oct 19 00:37:47 2018 (r339436) @@ -7,8 +7,8 @@ #define FREEBSD_NATIVE 1 /* Fake out gcc/config/freebsd.h. */ -#define FBSD_MAJOR 12 -#define FBSD_CC_VER 1200001 /* form like __FreeBSD_version */ +#define FBSD_MAJOR 13 +#define FBSD_CC_VER 1300000 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Fri Oct 19 00:24:23 2018 (r339435) +++ head/lib/clang/freebsd_cc_version.h Fri Oct 19 00:37:47 2018 (r339436) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200016 +#define FREEBSD_CC_VERSION 1300000 Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Oct 19 00:24:23 2018 (r339435) +++ head/lib/clang/llvm.build.mk Fri Oct 19 00:37:47 2018 (r339436) @@ -17,7 +17,7 @@ CFLAGS+= -I${LLVM_SRCS}/include CFLAGS+= -DLLVM_BUILD_GLOBAL_ISEL CFLAGS+= -D__STDC_LIMIT_MACROS CFLAGS+= -D__STDC_CONSTANT_MACROS -#CFLAGS+= -DNDEBUG +CFLAGS+= -DNDEBUG TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} @@ -33,7 +33,7 @@ TARGET_ABI= -gnueabi TARGET_ABI= .endif VENDOR= unknown -OS_VERSION= freebsd12.0 +OS_VERSION= freebsd13.0 LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI} LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION} Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Fri Oct 19 00:24:23 2018 (r339435) +++ head/release/Makefile Fri Oct 19 00:37:47 2018 (r339436) @@ -210,7 +210,6 @@ disc1: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc @@ -238,7 +237,6 @@ bootonly: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc @@ -263,7 +261,6 @@ dvd: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Oct 19 00:24:23 2018 (r339435) +++ head/sys/conf/newvers.sh Fri Oct 19 00:37:47 2018 (r339436) @@ -45,8 +45,8 @@ # included if the tree is modified. TYPE="FreeBSD" -REVISION="12.0" -BRANCH="ALPHA10" +REVISION="13.0" +BRANCH="CURRENT" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Oct 19 00:24:23 2018 (r339435) +++ head/sys/sys/param.h Fri Oct 19 00:37:47 2018 (r339436) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200085 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Oct 19 03:22:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76033F7F7B0; Fri, 19 Oct 2018 03:22:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15CD68B75D; Fri, 19 Oct 2018 03:22:57 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id k206-v6so2875776ite.0; Thu, 18 Oct 2018 20:22:57 -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=IQ7xgEno/Sq7WdvsshbnFJ+H8IUl479bx87hxlY/rDc=; b=q/CadF86Iq2sfrqckexx5IAyOrEaIYFWc1NAc/uacgSjugCBoFYCXgRoZxlBloyExB 9Ns7t1k6zUa4q5DR3DamRCkfSlbMjFk0nROv3G50nr0SVrTMgO7eG6USHa3YdPA+VDWX MndwEepeGDZAVALs1WS5iFzVi0mluAvUPJYs//2KWxb+ydwXcjZLrCVRWXeulrzVFCxu aaPBXppIZpzxUCP1OLHBGr7nhnhBfbBtnPAWrYrfIoCiNseJuTgvYcGJEjWBb/42CGQF 83Uj/evNtzC+ay7YyaboF9HptG3gXxaHnQ0xXRq1oIqoHOtjti0nb9x7k3V3tEw61sgq KIQQ== X-Gm-Message-State: ABuFfoj7lPeW6frhHvdZ3CEHC/dXwcJogUDRioIUOxYE/YMt4tDQL3pe +Pps5Cv10uUYln2erMVTAjvWZK6VYyQrqGSp0Gz0l24nrv8= X-Google-Smtp-Source: ACcGV624D10EuO1XOaxgt5Qp0ZS0fD3FCtd2nVI++OML7UIvbjgq4u6XSXsNJyFfHU/sNdgMktsLghhoud97N8GgWz4= X-Received: by 2002:a02:59d6:: with SMTP id v83-v6mr4284847jad.129.1539919370445; Thu, 18 Oct 2018 20:22:50 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 18 Oct 2018 19:23:59 -0400 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Antoine Brodin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, gerald@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Oct 2018 03:22:58 -0000 On Tue, 16 Oct 2018 at 01:39, Antoine Brodin wrote: > > The attached patch for the gcc ports fixes the failures for me. I think this is probably the right approach, although I also have an ELF Tool Chain fix in D17596 which is waiting on the code freeze to end. From owner-svn-src-head@freebsd.org Fri Oct 19 13:54:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D266FCB8F4; Fri, 19 Oct 2018 13:54:23 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from ainaz.pair.com (ainaz.pair.com [IPv6:2607:f440::d144:242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E31B57E691; Fri, 19 Oct 2018 13:54:22 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from ainaz.pair.com (localhost [127.0.0.1]) by ainaz.pair.com (Postfix) with ESMTP id 3D0D4B53EDB; Fri, 19 Oct 2018 09:54:16 -0400 (EDT) Received: from [192.168.43.207] (unknown [154.138.16.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ainaz.pair.com (Postfix) with ESMTPSA id 8F277B53E29; Fri, 19 Oct 2018 09:54:13 -0400 (EDT) Date: Fri, 19 Oct 2018 15:54:09 +0200 (CEST) From: Gerald Pfeifer To: Ed Maste cc: Antoine Brodin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy In-Reply-To: Message-ID: References: <201810132126.w9DLQ73C022496@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Oct 2018 13:54:23 -0000 On Thu, 18 Oct 2018, Ed Maste wrote: > I think this is probably the right approach, although I also have an > ELF Tool Chain fix in D17596 which is waiting on the code freeze to > end. I'm a little confused: This was broken most recently (as the mail bomb that my inbox received from the pkg cluster and others indicates), so at this point in the release cycle shouldn't (a) the change causing all this be reverted, *or* (b) a follow-up patch committed immediately, whatever looks less risky? Gerald From owner-svn-src-head@freebsd.org Fri Oct 19 20:18:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29D20FE4ACE; Fri, 19 Oct 2018 20:18:48 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC088BDFF; Fri, 19 Oct 2018 20:18:47 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-10-49.flashcable.ch [91.190.10.49]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 51EEFC147B; Fri, 19 Oct 2018 22:18:37 +0200 (CEST) Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Gerald Pfeifer , Ed Maste Cc: Antoine Brodin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810132126.w9DLQ73C022496@repo.freebsd.org> From: Andreas Tobler Message-ID: <5fc97978-c59a-168b-b82b-aff189bb022a@FreeBSD.org> Date: Fri, 19 Oct 2018 22:18:36 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 7bit X-Scanned-By: Asterix Submit on 127.0.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Oct 2018 20:18:48 -0000 On 19.10.18 15:54, Gerald Pfeifer wrote: > On Thu, 18 Oct 2018, Ed Maste wrote: >> I think this is probably the right approach, although I also have an >> ELF Tool Chain fix in D17596 which is waiting on the code freeze to >> end. > > I'm a little confused: This was broken most recently (as the mail > bomb that my inbox received from the pkg cluster and others indicates), > so at this point in the release cycle shouldn't > (a) the change causing all this be reverted, *or* > (b) a follow-up patch committed immediately, > whatever looks less risky? > Good to know, then I can stop investigating the bootstrap comparison failures. Thanks, Andreas From owner-svn-src-head@freebsd.org Fri Oct 19 22:19:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20FACFE8D94; Fri, 19 Oct 2018 22:19:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B734970196; Fri, 19 Oct 2018 22:19:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f173.google.com with SMTP id c23-v6so5993488itd.5; Fri, 19 Oct 2018 15:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AMPuOebLF4A10e0h+wTjQgUU3/bEW8hMA7psOA+lEqI=; b=Kqkrof7iF+CQi2Ba7kcHANiMCycwViDs1F4yY/NjDuK8BEuYDKajjHEKkYp8k1LDb5 2bqHvUvBnwP1ZF8pM0zb/ug463CyWr4JZ0h6GLy6ce1y0xnQnQaBQSbpLxMb9ZAkN/yd J2XXoiej0M7ASgrPBStWHF1Sq1GvPyYmjG2BFXJqY6x1QIlJbh5pJjibq205T+POUtKw osSNv/4S60+Q7ec0EH1bhY2QERBu/wxgVc85BPK1oc5PMdbYF+ALE1/W9EwvH54x+Qgx zwnMl3KapsSqgBtsUAV6noUBzTHTvAOwzb604816lxGtkgVXh5kMXvtCa9wsunV4CZt3 YNhA== X-Gm-Message-State: ABuFfojxgf084o3YskLkUkGSksGiDO8vgeDVGTu1I1lgLe6uDlOHwZ+3 CUGi683DVwr47ODlt1NgClgTi5GCdgw3C7QDbPpdPaMN X-Google-Smtp-Source: ACcGV62WWjMlG9ZnlS6QnDn782lLdFSOe42UA/TuqYSoVRbkZytUQHc+TCT56QDRC/DH62bzp2VsiX3ZZZxCl1WUH1w= X-Received: by 2002:a24:430d:: with SMTP id s13-v6mr4308664itb.33.1539987590727; Fri, 19 Oct 2018 15:19:50 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Fri, 19 Oct 2018 14:21:02 -0400 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: gerald@pfeifer.com Cc: Antoine Brodin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 19 Oct 2018 22:19:52 -0000 On Fri, 19 Oct 2018 at 09:54, Gerald Pfeifer wrote: > > On Thu, 18 Oct 2018, Ed Maste wrote: > > I think this is probably the right approach, although I also have an > > ELF Tool Chain fix in D17596 which is waiting on the code freeze to > > end. > > I'm a little confused: This was broken most recently (as the mail > bomb that my inbox received from the pkg cluster and others indicates), > so at this point in the release cycle shouldn't > (a) the change causing all this be reverted, *or* Unfortunately there are subsequent changes that depend on the original fix which would also have to be unwound, it's not as easy as just reverting this one. > (b) a follow-up patch committed immediately, > whatever looks less risky? The follow-up patch is ready but is waiting on re@. At this point I expect I can commit in two days and then will need to re-request to merge to stable/12. From owner-svn-src-head@freebsd.org Sat Oct 20 16:59:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9791CFEC8BE; Sat, 20 Oct 2018 16:59:44 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBBF7B727; Sat, 20 Oct 2018 16:59:44 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4898920BD7; Sat, 20 Oct 2018 16:59:44 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KGxiuI092275; Sat, 20 Oct 2018 16:59:44 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KGxiT3092274; Sat, 20 Oct 2018 16:59:44 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201810201659.w9KGxiT3092274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Sat, 20 Oct 2018 16:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339448 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 339448 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.29 Precedence: list List-Id: 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, 20 Oct 2018 16:59:44 -0000 Author: tobik (ports committer) Date: Sat Oct 20 16:59:43 2018 New Revision: 339448 URL: https://svnweb.freebsd.org/changeset/base/339448 Log: vidcontrol(1): Fix a typo in the description of -f While here: - Fix markup in -c - Fix mandoc -Tlint and igor warnings Reviewed by: 0mp, bjk Approved by: bjk Differential Revision: https://reviews.freebsd.org/D17428 Modified: head/usr.sbin/vidcontrol/vidcontrol.1 Modified: head/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.1 Sat Oct 20 16:52:18 2018 (r339447) +++ head/usr.sbin/vidcontrol/vidcontrol.1 Sat Oct 20 16:59:43 2018 (r339448) @@ -13,7 +13,7 @@ .\" @(#)vidcontrol.1 .\" $FreeBSD$ .\" -.Dd January 19, 2016 +.Dd October 20, 2018 .Dt VIDCONTROL 1 .Os .Sh NAME @@ -53,7 +53,7 @@ utility is used to set various options for the or .Xr vt 4 console driver, -such as video mode, colors, cursor shape, screen output map, font and screen +such as video mode, colors, cursor shape, screen output map, font, and screen saver timeout. Only a small subset of options is supported by .Xr vt 4 . @@ -109,10 +109,10 @@ below. .It Ar foreground Op Ar background Change colors when displaying text. Specify the foreground color -(e.g.\& +(e.g., .Dq vidcontrol white ) , or both a foreground and background colors -(e.g.\& +(e.g., .Dq vidcontrol yellow blue ) . Use the .Cm show @@ -128,13 +128,13 @@ Clear the history buffer. .It Fl c Ar setting Ns Op , Ns Ar setting ... Change the cursor appearance. The change is specified by a non-empty comma-separated list of -.Cm setting Ns s . +.Ar setting Ns s . Each -.Cm setting +.Ar setting overrides or modifies previous ones in left to right order. .Pp The following override -.Cm setting Ns s +.Ar setting Ns s are available: .Bl -tag -width indent .It Cm normal @@ -150,22 +150,22 @@ The name .Dq destructive is bad for backwards compatibility. This -.Cm setting +.Ar setting should not force destructiveness, and it now only gives destructiveness in some configurations (typically for hardware cursors in text mode). Blinking limits destructiveness. This -.Cm setting +.Ar setting should now be spelled .Cm normal , Ns Cm blink , Ns Cm noblock . A non-blinking destructive cursor would be unusable, so old versions of .Nm -didn't support it, -and this version doesn't have an override for it. -.It Cm base Ns = Ns Ar value, Cm height Ns = Ns Ar value +did not support it, +and this version does not have an override for it. +.It Cm base Ns = Ns Ar value , Cm height Ns = Ns Ar value Set the specified scanline parameters. These parameters are only active in .Cm noblock @@ -187,7 +187,7 @@ are clamped to fit in the character cell when the curs .El .Pp The following modifier -.Cm setting Ns s +.Ar setting Ns s are available: .Bl -tag -width indent .It Cm blink , noblink @@ -217,7 +217,7 @@ Set or clear the hidden attribute. .El .Pp The following (non-sticky) flags control application of the -.Cm setting Ns s : +.Ar setting Ns s : .Bl -tag -width indent .It Cm charcolors Apply @@ -258,7 +258,7 @@ Together with .Cm local , this gives 2 selection bits which select between 4 destinations. .It Cm shapeonly -Ignore any changes to the +Ignore any changes to the .Cm block and .Cm hidden @@ -313,7 +313,7 @@ When using both .Ar size and -.Ar font +.Ar file can be omitted, and the default font will be loaded. .Pp Note that older video cards, such as MDA and CGA, do not support @@ -572,7 +572,7 @@ the output. The first 10 bytes are always arranged as follows: .Bl -column "Byte range" "Contents" -offset indent .It Sy "Byte Range Contents" -.It "1 thru 8 Literal text" Dq Li SCRSHOT_ +.It "1 - 8 Literal text" Dq Li SCRSHOT_ .It "9 File format version number" .It "10 Remaining number of bytes in the header" .El @@ -625,7 +625,7 @@ for more details. The video card driver may let you change default configuration options, such as the default font, so that you do not need to set up the options at boot time. -See video card driver manuals, (e.g.\& +See video card driver manuals, (e.g., .Xr vga 4 ) for details. .Sh FILES @@ -662,7 +662,7 @@ Furthermore, you can also omit font size .Pp .Dl vidcontrol -f iso-8x16 .Pp -Moreover, the suffix specifying the font size can be also omitted; in +Moreover, the suffix specifying the font size can also be omitted; in this case, .Nm will use the size of the currently displayed font to construct the From owner-svn-src-head@freebsd.org Sat Oct 20 17:00:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAE0EFEC93A; Sat, 20 Oct 2018 17:00:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 811B17B886; Sat, 20 Oct 2018 17:00:19 +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 7C02520BE9; Sat, 20 Oct 2018 17:00:19 +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 w9KH0JNi092434; Sat, 20 Oct 2018 17:00:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KH0JeG092433; Sat, 20 Oct 2018 17:00:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201810201700.w9KH0JeG092433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 20 Oct 2018 17:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339449 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 339449 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:00:20 -0000 Author: mjg Date: Sat Oct 20 17:00:18 2018 New Revision: 339449 URL: https://svnweb.freebsd.org/changeset/base/339449 Log: amd64: relax constraints in curthread and curpcb This makes the compiler less likely to reload the content from %gs. The 'P' modifier drops all synteax prefixes and 'n' constraint treats input as a known at compilation time immediate integer. Example reloading victim was spinlock_enter. Stolen from: OpenBSD Reported by: jtl Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17615 Modified: head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat Oct 20 16:59:43 2018 (r339448) +++ head/sys/amd64/include/pcpu.h Sat Oct 20 17:00:18 2018 (r339449) @@ -227,8 +227,7 @@ __curthread(void) { struct thread *td; - __asm("movq %%gs:%1,%0" : "=r" (td) - : "m" (*(char *)OFFSETOF_CURTHREAD)); + __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); return (td); } #ifdef __clang__ @@ -242,7 +241,7 @@ __curpcb(void) { struct pcb *pcb; - __asm("movq %%gs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (OFFSETOF_CURPCB)); return (pcb); } #define curpcb (__curpcb()) From owner-svn-src-head@freebsd.org Sat Oct 20 17:22:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04000FED841; Sat, 20 Oct 2018 17:22:05 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE43F7C87E; Sat, 20 Oct 2018 17:22:04 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A951D210EF; Sat, 20 Oct 2018 17:22:04 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHM4ec007151; Sat, 20 Oct 2018 17:22:04 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHM4F5007150; Sat, 20 Oct 2018 17:22:04 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201810201722.w9KHM4F5007150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 20 Oct 2018 17:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339450 - in head: usr.bin/last usr.sbin/lastlogin X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: in head: usr.bin/last usr.sbin/lastlogin X-SVN-Commit-Revision: 339450 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:22:05 -0000 Author: bcr (doc committer) Date: Sat Oct 20 17:22:04 2018 New Revision: 339450 URL: https://svnweb.freebsd.org/changeset/base/339450 Log: A single comma was missing to separate the "see also" items in last.1 and lastlogin.8. Add it back. PR: 231187 Submitted by: david.marec@davenulle.org Modified: head/usr.bin/last/last.1 head/usr.sbin/lastlogin/lastlogin.8 Modified: head/usr.bin/last/last.1 ============================================================================== --- head/usr.bin/last/last.1 Sat Oct 20 17:00:18 2018 (r339449) +++ head/usr.bin/last/last.1 Sat Oct 20 17:22:04 2018 (r339450) @@ -208,7 +208,7 @@ login data base .Xr lastcomm 1 , .Xr getutxent 3 , .Xr ac 8 , -.Xr lastlogin 8 +.Xr lastlogin 8 , .Xr libxo 3 , .Xr xo_parse_args 3 .Sh HISTORY Modified: head/usr.sbin/lastlogin/lastlogin.8 ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.8 Sat Oct 20 17:00:18 2018 (r339449) +++ head/usr.sbin/lastlogin/lastlogin.8 Sat Oct 20 17:22:04 2018 (r339450) @@ -93,7 +93,7 @@ last login database .Sh SEE ALSO .Xr last 1 , .Xr getutxent 3 , -.Xr ac 8 +.Xr ac 8 , .Xr libxo 3 , .Xr xo_parse_args 3 .Sh AUTHORS From owner-svn-src-head@freebsd.org Sat Oct 20 17:27:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120DCFEDB44; Sat, 20 Oct 2018 17:27:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7BB37CD76; Sat, 20 Oct 2018 17:27:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF06521140; Sat, 20 Oct 2018 17:27:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHRrNJ008174; Sat, 20 Oct 2018 17:27:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHRroT008173; Sat, 20 Oct 2018 17:27:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810201727.w9KHRroT008173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 17:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339451 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 339451 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:27:54 -0000 Author: emaste Date: Sat Oct 20 17:27:53 2018 New Revision: 339451 URL: https://svnweb.freebsd.org/changeset/base/339451 Log: objcopy: restore behaviour required by GCC's build In r339350 filter_reloc() was removed, to fix the case of stripping statically linked binaries with relocations (which may come from ifunc use, for example). As a side effect this changed the behaviour when stripping object files - the output was broken both before and after r339350, in different ways. Unfortunately GCC's build process relies on the previous behaviour, so: - Revert r339350, restoring filter_reloc(). - Fix an unitialized variable use (commited as r3638 in ELF Tool Chain). - Change filter_reloc() to omit relocations referencing removed symbols, while retaining relocations with no symbol reference. - Retain the entire relocation section if it references the dynamic symbol table (fix from kaiw in D17596). PR: 232176 Reported by: antoine Reviewed by: kaiw MFC with: r339350 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17596 Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Sat Oct 20 17:22:04 2018 (r339450) +++ head/contrib/elftoolchain/elfcopy/sections.c Sat Oct 20 17:27:53 2018 (r339451) @@ -39,6 +39,7 @@ ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); static void check_section_rename(struct elfcopy *ecp, struct section *s); +static void filter_reloc(struct elfcopy *ecp, struct section *s); static int get_section_flags(struct elfcopy *ecp, const char *name); static void insert_sections(struct elfcopy *ecp); static void insert_to_strtab(struct section *t, const char *s); @@ -573,6 +574,14 @@ copy_content(struct elfcopy *ecp) continue; /* + * If strip action is STRIP_ALL, relocation info need + * to be stripped. Skip filtering otherwisw. + */ + if (ecp->strip == STRIP_ALL && + (s->type == SHT_REL || s->type == SHT_RELA)) + filter_reloc(ecp, s); + + /* * The section indices in the SHT_GROUP section needs * to be updated since we might have stripped some * sections and changed section numbering. @@ -661,6 +670,140 @@ update_section_group(struct elfcopy *ecp, struct secti s->sz -= 4; } + s->nocopy = 1; +} + +/* + * Filter relocation entries, only keep those entries whose + * symbol is in the keep list. + */ +static void +filter_reloc(struct elfcopy *ecp, struct section *s) +{ + const char *name; + GElf_Shdr ish; + GElf_Rel rel; + GElf_Rela rela; + Elf32_Rel *rel32; + Elf64_Rel *rel64; + Elf32_Rela *rela32; + Elf64_Rela *rela64; + Elf_Data *id; + uint64_t cap, n, nrels, sym; + int elferr, i; + + if (gelf_getshdr(s->is, &ish) == NULL) + errx(EXIT_FAILURE, "gelf_getehdr() failed: %s", + elf_errmsg(-1)); + + /* We don't want to touch relocation info for dynamic symbols. */ + if ((ecp->flags & SYMTAB_EXIST) == 0) { + /* + * No symbol table in output. If sh_link points to a section + * that exists in the output object, this relocation section + * is for dynamic symbols. Don't touch it. + */ + if (ish.sh_link != 0 && ecp->secndx[ish.sh_link] != 0) + return; + } else { + /* Symbol table exist, check if index equals. */ + if (ish.sh_link != elf_ndxscn(ecp->symtab->is)) + return; + } + +#define COPYREL(REL, SZ) do { \ + if (nrels == 0) { \ + if ((REL##SZ = malloc(cap * \ + sizeof(*REL##SZ))) == NULL) \ + err(EXIT_FAILURE, "malloc failed"); \ + } \ + if (nrels >= cap) { \ + cap *= 2; \ + if ((REL##SZ = realloc(REL##SZ, cap * \ + sizeof(*REL##SZ))) == NULL) \ + err(EXIT_FAILURE, "realloc failed"); \ + } \ + REL##SZ[nrels].r_offset = REL.r_offset; \ + REL##SZ[nrels].r_info = REL.r_info; \ + if (s->type == SHT_RELA) \ + rela##SZ[nrels].r_addend = rela.r_addend; \ + nrels++; \ +} while (0) + + nrels = 0; + cap = 4; /* keep list is usually small. */ + rel32 = NULL; + rel64 = NULL; + rela32 = NULL; + rela64 = NULL; + if ((id = elf_getdata(s->is, NULL)) == NULL) + errx(EXIT_FAILURE, "elf_getdata() failed: %s", + elf_errmsg(-1)); + n = ish.sh_size / ish.sh_entsize; + for(i = 0; (uint64_t)i < n; i++) { + if (s->type == SHT_REL) { + if (gelf_getrel(id, i, &rel) != &rel) + errx(EXIT_FAILURE, "gelf_getrel failed: %s", + elf_errmsg(-1)); + sym = GELF_R_SYM(rel.r_info); + } else { + if (gelf_getrela(id, i, &rela) != &rela) + errx(EXIT_FAILURE, "gelf_getrel failed: %s", + elf_errmsg(-1)); + sym = GELF_R_SYM(rela.r_info); + } + /* + * If a relocation references a symbol and we are omitting + * either that symbol or the entire symbol table we cannot + * produce valid output, and so just omit the relocation. + * Broken output like this is generally not useful, but some + * uses of elfcopy/strip rely on it - for example, GCC's build + * process uses it to check for build reproducibility by + * stripping objects and comparing them. + * + * Relocations that do not reference a symbol are retained. + */ + if (sym != 0) { + if (ish.sh_link == 0 || ecp->secndx[ish.sh_link] == 0) + continue; + name = elf_strptr(ecp->ein, elf_ndxscn(ecp->strtab->is), + sym); + if (name == NULL) + errx(EXIT_FAILURE, "elf_strptr failed: %s", + elf_errmsg(-1)); + if (lookup_symop_list(ecp, name, SYMOP_KEEP) == NULL) + continue; + } + if (ecp->oec == ELFCLASS32) { + if (s->type == SHT_REL) + COPYREL(rel, 32); + else + COPYREL(rela, 32); + } else { + if (s->type == SHT_REL) + COPYREL(rel, 64); + else + COPYREL(rela, 64); + } + } + elferr = elf_errno(); + if (elferr != 0) + errx(EXIT_FAILURE, "elf_getdata() failed: %s", + elf_errmsg(elferr)); + + if (ecp->oec == ELFCLASS32) { + if (s->type == SHT_REL) + s->buf = rel32; + else + s->buf = rela32; + } else { + if (s->type == SHT_REL) + s->buf = rel64; + else + s->buf = rela64; + } + s->sz = gelf_fsize(ecp->eout, (s->type == SHT_REL ? ELF_T_REL : + ELF_T_RELA), nrels, EV_CURRENT); s->nocopy = 1; } From owner-svn-src-head@freebsd.org Sat Oct 20 17:36:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C926FEE00A; Sat, 20 Oct 2018 17:36:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7D3C7D2FC; Sat, 20 Oct 2018 17:36:01 +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 ACFF3212E7; Sat, 20 Oct 2018 17:36:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHa1NI013259; Sat, 20 Oct 2018 17:36:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHa0Cf013253; Sat, 20 Oct 2018 17:36:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201736.w9KHa0Cf013253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 17:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339452 - in head: share/man/man9 sys/kern sys/sys sys/vm sys/x86/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys sys/vm sys/x86/acpica X-SVN-Commit-Revision: 339452 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:36:02 -0000 Author: markj Date: Sat Oct 20 17:36:00 2018 New Revision: 339452 URL: https://svnweb.freebsd.org/changeset/base/339452 Log: Create some global domainsets and refactor NUMA registration. Pre-defined policies are useful when integrating the domainset(9) policy machinery into various kernel memory allocators. The refactoring will make it easier to add NUMA support for other architectures. No functional change intended. Reviewed by: alc, gallatin, jeff, kib Tested by: pho (part of a larger patch) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17416 Modified: head/share/man/man9/domainset.9 head/sys/kern/kern_cpuset.c head/sys/sys/domainset.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/x86/acpica/srat.c Modified: head/share/man/man9/domainset.9 ============================================================================== --- head/share/man/man9/domainset.9 Sat Oct 20 17:27:53 2018 (r339451) +++ head/share/man/man9/domainset.9 Sat Oct 20 17:36:00 2018 (r339452) @@ -24,14 +24,11 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2018 +.Dd October 20, 2018 .Dt DOMAINSET 9 .Os .Sh NAME .Nm domainset(9) -\(em -.Nm domainset_create , -.Nm sysctl_handle_domainset . .Nd domainset functions and operation .Sh SYNOPSIS .In sys/_domainset.h @@ -46,6 +43,8 @@ struct domainset { }; .Ed .Pp +.Fn DOMAINSET_RR +.Fn DOMAINSET_PREF domain .Ft struct domainset * .Fn domainset_create "const struct domainset *key" .Ft int @@ -98,6 +97,12 @@ This gives good distribution among memory domains whil efficiency higher and is preferential to round-robin for general use. .El .Pp +The +.Fn DOMAINSET_RR +and +.Fn DOMAINSET_PREF +provide pointers to global pre-defined policies for use when the +desired policy is known at compile time. The .Fn domainset_create function takes a partially filled in domainset as a key and returns a Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sat Oct 20 17:27:53 2018 (r339451) +++ head/sys/kern/kern_cpuset.c Sat Oct 20 17:36:00 2018 (r339452) @@ -119,6 +119,8 @@ __FBSDID("$FreeBSD$"); */ LIST_HEAD(domainlist, domainset); +struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; +struct domainset __read_mostly domainset_roundrobin; static uma_zone_t cpuset_zone; static uma_zone_t domainset_zone; @@ -1369,28 +1371,53 @@ cpuset_setithread(lwpid_t id, int cpu) } /* + * Initialize static domainsets after NUMA information is available. This is + * called very early during boot. + */ +void +domainset_init(void) +{ + struct domainset *dset; + int i; + + dset = &domainset_roundrobin; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + dset->ds_prefer = -1; + _domainset_create(dset, NULL); + + for (i = 0; i < vm_ndomains; i++) { + dset = &domainset_prefer[i]; + DOMAINSET_COPY(&all_domains, &dset->ds_mask); + dset->ds_policy = DOMAINSET_POLICY_PREFER; + dset->ds_prefer = i; + _domainset_create(dset, NULL); + } +} + +/* * Create the domainset for cpuset 0, 1 and cpuset 2. */ void domainset_zero(void) { struct domainset *dset; - int i; mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); dset = &domainset0; - DOMAINSET_ZERO(&dset->ds_mask); - for (i = 0; i < vm_ndomains; i++) - DOMAINSET_SET(i, &dset->ds_mask); + DOMAINSET_COPY(&all_domains, &dset->ds_mask); dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH; dset->ds_prefer = -1; - (void)domainset_empty_vm(dset); curthread->td_domain.dr_policy = _domainset_create(dset, NULL); domainset_copy(dset, &domainset2); domainset2.ds_policy = DOMAINSET_POLICY_INTERLEAVE; kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL); + + /* Remove empty domains from the global policies. */ + LIST_FOREACH(dset, &cpuset_domains, ds_link) + (void)domainset_empty_vm(dset); } /* Modified: head/sys/sys/domainset.h ============================================================================== --- head/sys/sys/domainset.h Sat Oct 20 17:27:53 2018 (r339451) +++ head/sys/sys/domainset.h Sat Oct 20 17:36:00 2018 (r339452) @@ -32,8 +32,8 @@ #define _SYS_DOMAINSET_H_ #include - #include +#include #define _NDOMAINSETBITS _BITSET_BITS #define _NDOMAINSETWORDS __bitset_words(DOMAINSET_SETSIZE) @@ -96,6 +96,12 @@ struct domainset { domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */ }; +extern struct domainset domainset_prefer[MAXMEMDOM]; +#define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)]) +extern struct domainset domainset_roundrobin; +#define DOMAINSET_RR() (&domainset_roundrobin) + +void domainset_init(void); void domainset_zero(void); /* Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sat Oct 20 17:27:53 2018 (r339451) +++ head/sys/vm/vm_phys.c Sat Oct 20 17:36:00 2018 (r339452) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -584,6 +585,33 @@ vm_phys_init(void) } rw_init(&vm_phys_fictitious_reg_lock, "vmfctr"); +} + +/* + * Register info about the NUMA topology of the system. + * + * Invoked by platform-dependent code prior to vm_phys_init(). + */ +void +vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, + int *locality) +{ +#ifdef NUMA + int i; + + vm_ndomains = ndomains; + mem_affinity = affinity; + mem_locality = locality; + + for (i = 0; i < vm_ndomains; i++) + DOMAINSET_SET(i, &all_domains); + + domainset_init(); +#else + (void)ndomains; + (void)affinity; + (void)locality; +#endif } /* Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Sat Oct 20 17:27:53 2018 (r339451) +++ head/sys/vm/vm_phys.h Sat Oct 20 17:36:00 2018 (r339452) @@ -88,6 +88,8 @@ void vm_phys_free_contig(vm_page_t m, u_long npages); void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa); +void vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, + int *locality); vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); void vm_phys_set_pool(int pool, vm_page_t m, int order); Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Sat Oct 20 17:27:53 2018 (r339451) +++ head/sys/x86/acpica/srat.c Sat Oct 20 17:36:00 2018 (r339452) @@ -153,10 +153,6 @@ parse_slit(void) acpi_unmap_table(slit); slit = NULL; -#ifdef NUMA - /* Tell the VM about it! */ - mem_locality = vm_locality_table; -#endif return (0); } @@ -481,13 +477,6 @@ parse_srat(void) return (-1); } -#ifdef NUMA - vm_ndomains = ndomain; - for (int i = 0; i < vm_ndomains; i++) - DOMAINSET_SET(i, &all_domains); - mem_affinity = mem_info; -#endif - return (0); } @@ -511,7 +500,8 @@ parse_acpi_tables(void *dummy) if (parse_srat() < 0) return; init_mem_locality(); - (void) parse_slit(); + (void)parse_slit(); + vm_phys_register_domains(ndomain, mem_info, vm_locality_table); } SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, NULL); From owner-svn-src-head@freebsd.org Sat Oct 20 17:40:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFEFFEE1B1; Sat, 20 Oct 2018 17:40:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D70797D56C; Sat, 20 Oct 2018 17:40:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1D8821312; Sat, 20 Oct 2018 17:40:30 +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 w9KHeUSv013509; Sat, 20 Oct 2018 17:40:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHeULd013508; Sat, 20 Oct 2018 17:40:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201740.w9KHeULd013508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 17:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339453 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339453 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:40:31 -0000 Author: markj Date: Sat Oct 20 17:40:30 2018 New Revision: 339453 URL: https://svnweb.freebsd.org/changeset/base/339453 Log: Remove some obsolete compatibility code. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsock.c ============================================================================== --- head/usr.sbin/rtsold/rtsock.c Sat Oct 20 17:36:00 2018 (r339452) +++ head/usr.sbin/rtsold/rtsock.c Sat Oct 20 17:40:30 2018 (r339453) @@ -65,19 +65,15 @@ ((ap)->sa_len ? ROUNDUP((ap)->sa_len, sizeof(u_long)) \ : sizeof(u_long))) -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ static int rtsock_input_ifannounce(int, struct rt_msghdr *, char *); -#endif static struct { u_char type; size_t minlen; int (*func)(int, struct rt_msghdr *, char *); } rtsock_dispatch[] = { -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ { RTM_IFANNOUNCE, sizeof(struct if_announcemsghdr), rtsock_input_ifannounce }, -#endif { 0, 0, NULL }, }; @@ -135,7 +131,6 @@ rtsock_input(int s) return (ret); } -#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/ static int rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim) { @@ -174,4 +169,3 @@ rtsock_input_ifannounce(int s __unused, struct rt_msgh return (0); } -#endif Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:36:00 2018 (r339452) +++ head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:40:30 2018 (r339453) @@ -33,10 +33,9 @@ * $FreeBSD$ */ -#include +#include #include #include -#include #include #include @@ -98,10 +97,6 @@ static int do_dump; static const char *dumpfilename = RTSOL_DUMPFILE; #endif -#if 0 -static int ifreconfig(char *); -#endif - static int make_packet(struct ifinfo *); static struct timespec *rtsol_check_timer(void); @@ -217,16 +212,6 @@ main(int argc, char **argv) pidfilename); } -#if (__FreeBSD_version < 900000) - if (Fflag) { - setinet6sysctl(IPV6CTL_FORWARDING, 0); - } else { - /* warn if forwarding is up */ - if (getinet6sysctl(IPV6CTL_FORWARDING)) - warnx("kernel is configured as a router, not a host"); - } -#endif - #ifndef SMALL /* initialization to dump internal status to a file */ signal(SIGUSR1, rtsold_set_dump_file); @@ -458,33 +443,6 @@ iflist_init(void) free(ifi); } } - -#if 0 -static int -ifreconfig(char *ifname) -{ - struct ifinfo *ifi, *prev; - int rv; - - prev = NULL; - TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { - if (strncmp(ifi->ifname, ifname, sizeof(ifi->ifname)) == 0) - break; - prev = ifi; - } - prev->next = ifi->next; - - rv = ifconfig(ifname); - - /* reclaim it after ifconfig() in case ifname is pointer inside ifi */ - if (ifi->rs_data) - free(ifi->rs_data); - free(ifi->sdl); - free(ifi); - - return (rv); -} -#endif struct rainfo * find_rainfo(struct ifinfo *ifi, struct sockaddr_in6 *sin6) From owner-svn-src-head@freebsd.org Sat Oct 20 17:42:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3D9FEE486; Sat, 20 Oct 2018 17:42:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2931D7DA3C; Sat, 20 Oct 2018 17:42:39 +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 E8793214A3; Sat, 20 Oct 2018 17:42:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHgccm018285; Sat, 20 Oct 2018 17:42:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHgc74018284; Sat, 20 Oct 2018 17:42:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810201742.w9KHgc74018284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 17:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339454 - head/lib/clang/include/lld/Common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/clang/include/lld/Common X-SVN-Commit-Revision: 339454 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:42:41 -0000 Author: emaste Date: Sat Oct 20 17:42:38 2018 New Revision: 339454 URL: https://svnweb.freebsd.org/changeset/base/339454 Log: Bump LLD_REVISION_STRING for 13-CURRENT Modified: head/lib/clang/include/lld/Common/Version.inc Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Sat Oct 20 17:40:30 2018 (r339453) +++ head/lib/clang/include/lld/Common/Version.inc Sat Oct 20 17:42:38 2018 (r339454) @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // - -#define LLD_REVISION_STRING "335540-1200005" +#define LLD_REVISION_STRING "335540-1300000" From owner-svn-src-head@freebsd.org Sat Oct 20 17:43:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D645FEE4ED; Sat, 20 Oct 2018 17:43:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B71D87DBB5; Sat, 20 Oct 2018 17:43:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2157214A4; Sat, 20 Oct 2018 17:43:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHhRoV018366; Sat, 20 Oct 2018 17:43:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHhRvq018364; Sat, 20 Oct 2018 17:43:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201743.w9KHhRvq018364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 17:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339455 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339455 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:43:28 -0000 Author: markj Date: Sat Oct 20 17:43:27 2018 New Revision: 339455 URL: https://svnweb.freebsd.org/changeset/base/339455 Log: Staticize a couple of functions. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:42:38 2018 (r339454) +++ head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:43:27 2018 (r339455) @@ -97,6 +97,8 @@ static int do_dump; static const char *dumpfilename = RTSOL_DUMPFILE; #endif +static char **autoifprobe(void); +static int ifconfig(char *ifname); static int make_packet(struct ifinfo *); static struct timespec *rtsol_check_timer(void); @@ -325,7 +327,7 @@ main(int argc, char **argv) return (0); } -int +static int ifconfig(char *ifname) { struct ifinfo *ifi; @@ -775,7 +777,7 @@ warnmsg(int priority, const char *func, const char *ms /* * return a list of interfaces which is suitable to sending an RS. */ -char ** +static char ** autoifprobe(void) { static char **argv = NULL; Modified: head/usr.sbin/rtsold/rtsold.h ============================================================================== --- head/usr.sbin/rtsold/rtsold.h Sat Oct 20 17:42:38 2018 (r339454) +++ head/usr.sbin/rtsold/rtsold.h Sat Oct 20 17:43:27 2018 (r339455) @@ -157,14 +157,12 @@ extern int Fflag; extern int uflag; extern const char *otherconf_script; extern const char *resolvconf_script; -extern int ifconfig(char *); extern void iflist_init(void); struct ifinfo *find_ifinfo(int); struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); void rtsol_timer_update(struct ifinfo *); extern void warnmsg(int, const char *, const char *, ...) __attribute__((__format__(__printf__, 3, 4))); -extern char **autoifprobe(void); extern int ra_opt_handler(struct ifinfo *); /* if.c */ From owner-svn-src-head@freebsd.org Sat Oct 20 17:44:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8EAFEE5BC; Sat, 20 Oct 2018 17:44:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9499B7DD31; Sat, 20 Oct 2018 17:44:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F9B2214A5; Sat, 20 Oct 2018 17:44:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHiOlK018471; Sat, 20 Oct 2018 17:44:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHiNgo018467; Sat, 20 Oct 2018 17:44:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201744.w9KHiNgo018467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 17:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339456 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339456 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:44:25 -0000 Author: markj Date: Sat Oct 20 17:44:23 2018 New Revision: 339456 URL: https://svnweb.freebsd.org/changeset/base/339456 Log: Remove dead code. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/usr.sbin/rtsold/if.c ============================================================================== --- head/usr.sbin/rtsold/if.c Sat Oct 20 17:43:27 2018 (r339455) +++ head/usr.sbin/rtsold/if.c Sat Oct 20 17:44:23 2018 (r339456) @@ -332,37 +332,6 @@ if_nametosdl(char *name) return (ret_sdl); } -int -getinet6sysctl(int code) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) < 0) - return (-1); - else - return (value); -} - -int -setinet6sysctl(int code, int newval) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, - &newval, sizeof(newval)) < 0) - return (-1); - else - return (value); -} - /*------------------------------------------------------------*/ /* get ia6_flags for link-local addr on if. returns -1 on error. */ Modified: head/usr.sbin/rtsold/rtsock.c ============================================================================== --- head/usr.sbin/rtsold/rtsock.c Sat Oct 20 17:43:27 2018 (r339455) +++ head/usr.sbin/rtsold/rtsock.c Sat Oct 20 17:44:23 2018 (r339456) @@ -57,14 +57,6 @@ #include #include "rtsold.h" -#define ROUNDUP(a, size) \ - (((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a)) - -#define NEXT_SA(ap) (ap) = (struct sockaddr *) \ - ((caddr_t)(ap) + \ - ((ap)->sa_len ? ROUNDUP((ap)->sa_len, sizeof(u_long)) \ - : sizeof(u_long))) - static int rtsock_input_ifannounce(int, struct rt_msghdr *, char *); static struct { Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:43:27 2018 (r339455) +++ head/usr.sbin/rtsold/rtsold.c Sat Oct 20 17:44:23 2018 (r339456) @@ -431,21 +431,6 @@ bad: return (-1); } -void -iflist_init(void) -{ - struct ifinfo *ifi; - - while ((ifi = TAILQ_FIRST(&ifinfo_head)) != NULL) { - TAILQ_REMOVE(&ifinfo_head, ifi, ifi_next); - if (ifi->sdl != NULL) - free(ifi->sdl); - if (ifi->rs_data != NULL) - free(ifi->rs_data); - free(ifi); - } -} - struct rainfo * find_rainfo(struct ifinfo *ifi, struct sockaddr_in6 *sin6) { @@ -726,9 +711,6 @@ rtsol_timer_update(struct ifinfo *ifi) #undef MILLION } - -/* timer related utility functions */ -#define MILLION 1000000 #ifndef SMALL static void Modified: head/usr.sbin/rtsold/rtsold.h ============================================================================== --- head/usr.sbin/rtsold/rtsold.h Sat Oct 20 17:43:27 2018 (r339455) +++ head/usr.sbin/rtsold/rtsold.h Sat Oct 20 17:44:23 2018 (r339456) @@ -157,7 +157,6 @@ extern int Fflag; extern int uflag; extern const char *otherconf_script; extern const char *resolvconf_script; -extern void iflist_init(void); struct ifinfo *find_ifinfo(int); struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); void rtsol_timer_update(struct ifinfo *); @@ -172,8 +171,6 @@ extern int interface_status(struct ifinfo *); extern int lladdropt_length(struct sockaddr_dl *); extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); extern struct sockaddr_dl *if_nametosdl(char *); -extern int getinet6sysctl(int); -extern int setinet6sysctl(int, int); /* rtsol.c */ extern int rssock; From owner-svn-src-head@freebsd.org Sat Oct 20 17:45:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E47EFEE66E; Sat, 20 Oct 2018 17:45:43 +0000 (UTC) (envelope-from rigoletto@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 319567DE9F; Sat, 20 Oct 2018 17:45:43 +0000 (UTC) (envelope-from rigoletto@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25532214A6; Sat, 20 Oct 2018 17:45:43 +0000 (UTC) (envelope-from rigoletto@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KHjh9R018578; Sat, 20 Oct 2018 17:45:43 GMT (envelope-from rigoletto@FreeBSD.org) Received: (from rigoletto@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHjgGP018576; Sat, 20 Oct 2018 17:45:42 GMT (envelope-from rigoletto@FreeBSD.org) Message-Id: <201810201745.w9KHjgGP018576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rigoletto set sender to rigoletto@FreeBSD.org using -f From: =?UTF-8?Q?Alexandre_C=2e_Guimar=c3=a3es?= Date: Sat, 20 Oct 2018 17:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339457 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: rigoletto X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 339457 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:45:43 -0000 Author: rigoletto (ports committer) Date: Sat Oct 20 17:45:42 2018 New Revision: 339457 URL: https://svnweb.freebsd.org/changeset/base/339457 Log: Add myself to calendar, and update mentors-mentee relationships. Reviewed by: mat (mentor) Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D17396 Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Oct 20 17:44:23 2018 (r339456) +++ head/share/misc/committers-ports.dot Sat Oct 20 17:45:42 2018 (r339457) @@ -220,6 +220,7 @@ rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.o rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] rezny [label="Matthew Rezny\nrezny@FreeBSD.org\n2017/01/09"] riggs [label="Thomas Zander\nriggs@FreeBSD.org\n2014/01/09"] +rigoletto [label="Alexandre C. Guimaraes\nrigoletto@FreeBSD.org\n2018/10/01"] rm [label="Ruslan Makhmatkhanov\nrm@FreeBSD.org\n2011/11/06"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] robak [label="Bartek Rutkowski\nrobak@FreeBSD.org\n2014/06/10"] @@ -549,6 +550,7 @@ mat -> tcberner mat -> thierry mat -> tobik mat -> woodsb02 +mat -> rigoletto matthew -> leres matthew -> lifanov @@ -708,6 +710,7 @@ tcberner -> joneum tcberner -> yuri tcberner -> fernape tcberner -> arrowd +tcberner -> rigoletto thierry -> jadawin thierry -> riggs Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Oct 20 17:44:23 2018 (r339456) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Oct 20 17:45:42 2018 (r339457) @@ -44,6 +44,7 @@ 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 +01/27 Alexandre C. Guimaraes born in Rio de Janeiro, Rio de Janeiro, Brazil, 1982 01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 From owner-svn-src-head@freebsd.org Sat Oct 20 17:48:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7061AFEE7BC; Sat, 20 Oct 2018 17:48:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14B167E092; Sat, 20 Oct 2018 17:48: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 0897B214B1; Sat, 20 Oct 2018 17:48: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 w9KHm5SN018728; Sat, 20 Oct 2018 17:48:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KHm5WF018727; Sat, 20 Oct 2018 17:48:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201748.w9KHm5WF018727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 17:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339458 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 339458 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.29 Precedence: list List-Id: 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, 20 Oct 2018 17:48:06 -0000 Author: markj Date: Sat Oct 20 17:48:05 2018 New Revision: 339458 URL: https://svnweb.freebsd.org/changeset/base/339458 Log: Fix formatting. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/stdio/fopen.3 Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Sat Oct 20 17:45:42 2018 (r339457) +++ head/lib/libc/stdio/fopen.3 Sat Oct 20 17:48:05 2018 (r339458) @@ -119,8 +119,8 @@ or the first letter. This is strictly for compatibility with .St -isoC and has effect only for -.Fn fmemopen -; otherwise +.Fn fmemopen ; +otherwise .Dq Li b is ignored. .Pp From owner-svn-src-head@freebsd.org Sat Oct 20 18:00:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6A6BFEED1B; Sat, 20 Oct 2018 18:00:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68F427E76F; Sat, 20 Oct 2018 18:00:14 +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 627E021667; Sat, 20 Oct 2018 18:00:14 +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 w9KI0EuL024401; Sat, 20 Oct 2018 18:00:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KI0EOO024400; Sat, 20 Oct 2018 18:00:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810201800.w9KI0EOO024400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 18:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339460 - head/usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtsold X-SVN-Commit-Revision: 339460 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:00:14 -0000 Author: markj Date: Sat Oct 20 18:00:13 2018 New Revision: 339460 URL: https://svnweb.freebsd.org/changeset/base/339460 Log: Fix a dead store. We would fail to clear DNS search list configuration if a router stopped specifying the DNSSL RA option. I suspect that the bug was mostly harmless, as the RDNSS and DNSSL options are typically used together and omitting the RDNSS option would have the same effect. CID: 1006219 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/rtsold/rtsol.c Modified: head/usr.sbin/rtsold/rtsol.c ============================================================================== --- head/usr.sbin/rtsold/rtsol.c Sat Oct 20 18:00:12 2018 (r339459) +++ head/usr.sbin/rtsold/rtsol.c Sat Oct 20 18:00:13 2018 (r339460) @@ -616,7 +616,6 @@ ra_opt_handler(struct ifinfo *ifi) TAILQ_INSERT_TAIL(&sm_rdnss_head, smp3, sm_next); ifi->ifi_rdnss = IFI_DNSOPT_STATE_RECEIVED; - break; case ND_OPT_DNSSL: if (TS_CMP(&now, &rao->rao_expire, >)) { @@ -656,10 +655,7 @@ ra_opt_handler(struct ifinfo *ifi) sm_next); dlen += strlen(rao->rao_msg) + strlen(resstr_sp); - break; - ifi->ifi_dnssl = IFI_DNSOPT_STATE_RECEIVED; - default: break; } continue; From owner-svn-src-head@freebsd.org Sat Oct 20 18:00:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86367FEED16; Sat, 20 Oct 2018 18:00:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 373AC7E76E; Sat, 20 Oct 2018 18:00:13 +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 3169421666; Sat, 20 Oct 2018 18:00:13 +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 w9KI0DkC024356; Sat, 20 Oct 2018 18:00:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KI0CCP024352; Sat, 20 Oct 2018 18:00:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201800.w9KI0CCP024352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339459 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 339459 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:00:13 -0000 Author: cem Date: Sat Oct 20 18:00:12 2018 New Revision: 339459 URL: https://svnweb.freebsd.org/changeset/base/339459 Log: ixl/iavf(4): Fix GCC 6.4.0 build Don't define redundant prototypes. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ixl/if_iavf.c head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Sat Oct 20 17:48:05 2018 (r339458) +++ head/sys/dev/ixl/if_iavf.c Sat Oct 20 18:00:12 2018 (r339459) @@ -126,7 +126,6 @@ static int iavf_sysctl_queue_interrupt_table(SYSCTL_HA static int iavf_sysctl_vf_reset(SYSCTL_HANDLER_ARGS); static int iavf_sysctl_vflr_reset(SYSCTL_HANDLER_ARGS); -char *iavf_vc_speed_to_string(enum virtchnl_link_speed link_speed); static void iavf_save_tunables(struct iavf_sc *); static enum i40e_status_code iavf_process_adminq(struct iavf_sc *, u16 *); Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Sat Oct 20 17:48:05 2018 (r339458) +++ head/sys/dev/ixl/ixl_pf.h Sat Oct 20 18:00:12 2018 (r339459) @@ -267,9 +267,6 @@ char * ixl_switch_element_string(struct sbuf *, struct i40e_aqc_switch_config_element_resp *); void ixl_add_sysctls_mac_stats(struct sysctl_ctx_list *, struct sysctl_oid_list *, struct i40e_hw_port_stats *); -void ixl_add_sysctls_eth_stats(struct sysctl_ctx_list *, - struct sysctl_oid_list *, - struct i40e_eth_stats *); void ixl_media_status(struct ifnet *, struct ifmediareq *); int ixl_media_change(struct ifnet *); From owner-svn-src-head@freebsd.org Sat Oct 20 18:01:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CD2FEEF06; Sat, 20 Oct 2018 18:01:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBCB7EA7B; Sat, 20 Oct 2018 18:01:16 +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 59BCD21693; Sat, 20 Oct 2018 18:01:16 +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 w9KI1GrS025887; Sat, 20 Oct 2018 18:01:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KI1GLD025886; Sat, 20 Oct 2018 18:01:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201801.w9KI1GLD025886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339461 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 339461 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:01:16 -0000 Author: cem Date: Sat Oct 20 18:01:15 2018 New Revision: 339461 URL: https://svnweb.freebsd.org/changeset/base/339461 Log: nvdimm(4): Fix GCC 6.4.0 build -Wformat= pedantically complains that the void* pointer is passed to a %s format. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/nvdimm/nvdimm.c Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Sat Oct 20 18:00:13 2018 (r339460) +++ head/sys/dev/nvdimm/nvdimm.c Sat Oct 20 18:01:15 2018 (r339461) @@ -222,7 +222,7 @@ nvdimm_count_devs(ACPI_HANDLE handle __unused, void *a status = AcpiGetName(handle, ACPI_FULL_PATHNAME, &name); if (ACPI_FAILURE(status)) return_ACPI_STATUS(status); - printf("nvdimm: enumerated %s\n", name.Pointer); + printf("nvdimm: enumerated %s\n", (char *)name.Pointer); AcpiOsFree(name.Pointer); } From owner-svn-src-head@freebsd.org Sat Oct 20 18:01:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA5E8FEEF8F; Sat, 20 Oct 2018 18:01:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A13E07F16C; Sat, 20 Oct 2018 18:01:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C2A6216C6; Sat, 20 Oct 2018 18:01:48 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KI1mVH025954; Sat, 20 Oct 2018 18:01:48 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KI1mYV025953; Sat, 20 Oct 2018 18:01:48 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810201801.w9KI1mYV025953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 20 Oct 2018 18:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339462 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 339462 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:01:49 -0000 Author: eugen Date: Sat Oct 20 18:01:48 2018 New Revision: 339462 URL: https://svnweb.freebsd.org/changeset/base/339462 Log: Make upgrade from previous FreeBSD versions less painful and make previously working configuration like this work again: gif_interfaces="gif0" gifconfig_gif0="1.1.1.1 2.2.2.2" ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252" PR: 204700 MFC after: 1 month Modified: head/libexec/rc/network.subr Modified: head/libexec/rc/network.subr ============================================================================== --- head/libexec/rc/network.subr Sat Oct 20 18:01:15 2018 (r339461) +++ head/libexec/rc/network.subr Sat Oct 20 18:01:48 2018 (r339462) @@ -1393,7 +1393,7 @@ clone_up() _list="$_list $ifn" fi tmpargs=$(get_if_var $ifn gifconfig_IF) - eval ifconfig_${ifn}=\"tunnel \$tmpargs\" + eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\" done if [ -n "${_list# }" ]; then echo "Created clone interfaces: ${_list# }." From owner-svn-src-head@freebsd.org Sat Oct 20 18:08:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D2FBFEF40C; Sat, 20 Oct 2018 18:08:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43C837F8BD; Sat, 20 Oct 2018 18:08:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E9DF21800; Sat, 20 Oct 2018 18:08:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KI8iCK029560; Sat, 20 Oct 2018 18:08:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KI8hKJ029556; Sat, 20 Oct 2018 18:08:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201808.w9KI8hKJ029556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339463 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 339463 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:08:44 -0000 Author: cem Date: Sat Oct 20 18:08:43 2018 New Revision: 339463 URL: https://svnweb.freebsd.org/changeset/base/339463 Log: Add flags variants to linker_files / stack(9) symbol resolution Some best-effort consumers may find trylock behavior for stack(9) symbol resolution acceptable. Expose that behavior to such consumers. This API is ugly. If in the future the modules and linker file list locking is cleaned up such that the linker_files list can be iterated safely without acquiring a sleepable lock, this API should be removed. However, most of the time nothing will be holding the linker files lock exclusive and the acquisition can proceed. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17620 Modified: head/sys/kern/kern_linker.c head/sys/kern/subr_stack.c head/sys/sys/linker.h head/sys/sys/stack.h Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Oct 20 18:01:48 2018 (r339462) +++ head/sys/kern/kern_linker.c Sat Oct 20 18:08:43 2018 (r339463) @@ -1021,15 +1021,33 @@ linker_ddb_search_symbol_name(caddr_t value, char *buf * obey locking protocols, and offer a significantly less complex interface. */ int -linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, - long *offset) +linker_search_symbol_name_flags(caddr_t value, char *buf, u_int buflen, + long *offset, int flags) { int error; - sx_slock(&kld_sx); + KASSERT((flags & (M_NOWAIT | M_WAITOK)) != 0 && + (flags & (M_NOWAIT | M_WAITOK)) != (M_NOWAIT | M_WAITOK), + ("%s: bad flags: 0x%x", __func__, flags)); + + if (flags & M_NOWAIT) { + if (!sx_try_slock(&kld_sx)) + return (EWOULDBLOCK); + } else + sx_slock(&kld_sx); + error = linker_debug_search_symbol_name(value, buf, buflen, offset); sx_sunlock(&kld_sx); return (error); +} + +int +linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, + long *offset) +{ + + return (linker_search_symbol_name_flags(value, buf, buflen, offset, + M_WAITOK)); } /* Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Sat Oct 20 18:01:48 2018 (r339462) +++ head/sys/kern/subr_stack.c Sat Oct 20 18:08:43 2018 (r339463) @@ -48,7 +48,7 @@ FEATURE(stack, "Support for capturing kernel stack"); static MALLOC_DEFINE(M_STACK, "stack", "Stack Traces"); static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, - long *offset); + long *offset, int flags); static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); struct stack * @@ -102,7 +102,7 @@ stack_print(const struct stack *st) KASSERT(st->depth <= STACK_MAX, ("bogus stack")); for (i = 0; i < st->depth; i++) { (void)stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), - &offset); + &offset, M_WAITOK); printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], namebuf, offset); } @@ -120,7 +120,7 @@ stack_print_short(const struct stack *st) if (i > 0) printf(" "); if (stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), - &offset) == 0) + &offset, M_WAITOK) == 0) printf("%s+%#lx", namebuf, offset); else printf("%p", (void *)st->pcs[i]); @@ -165,25 +165,36 @@ stack_print_short_ddb(const struct stack *st) #endif /* - * Two print routines -- one for use from DDB and DDB-like contexts, the - * other for use in the live kernel. + * Format stack into sbuf from live kernel. + * + * flags - M_WAITOK or M_NOWAIT (EWOULDBLOCK). */ -void -stack_sbuf_print(struct sbuf *sb, const struct stack *st) +int +stack_sbuf_print_flags(struct sbuf *sb, const struct stack *st, int flags) { char namebuf[64]; long offset; - int i; + int i, error; KASSERT(st->depth <= STACK_MAX, ("bogus stack")); for (i = 0; i < st->depth; i++) { - (void)stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), - &offset); + error = stack_symbol(st->pcs[i], namebuf, sizeof(namebuf), + &offset, flags); + if (error == EWOULDBLOCK) + return (error); sbuf_printf(sb, "#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], namebuf, offset); } + return (0); } +void +stack_sbuf_print(struct sbuf *sb, const struct stack *st) +{ + + (void)stack_sbuf_print_flags(sb, st, M_WAITOK); +} + #if defined(DDB) || defined(WITNESS) void stack_sbuf_print_ddb(struct sbuf *sb, const struct stack *st) @@ -246,16 +257,19 @@ stack_ktr(u_int mask, const char *file, int line, cons * and bypasses linker locking, and the other that doesn't. */ static int -stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset) +stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset, + int flags) { + int error; - if (linker_search_symbol_name((caddr_t)pc, namebuf, buflen, - offset) != 0) { - *offset = 0; - strlcpy(namebuf, "??", buflen); - return (ENOENT); - } else - return (0); + error = linker_search_symbol_name_flags((caddr_t)pc, namebuf, buflen, + offset, flags); + if (error == 0 || error == EWOULDBLOCK) + return (error); + + *offset = 0; + strlcpy(namebuf, "??", buflen); + return (ENOENT); } static int Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Sat Oct 20 18:01:48 2018 (r339462) +++ head/sys/sys/linker.h Sat Oct 20 18:08:43 2018 (r339463) @@ -183,6 +183,8 @@ int linker_ddb_search_symbol_name(caddr_t value, char /* * stack(9) helper for situations where kernel locking is required. */ +int linker_search_symbol_name_flags(caddr_t value, char *buf, u_int buflen, + long *offset, int flags); int linker_search_symbol_name(caddr_t value, char *buf, u_int buflen, long *offset); Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Sat Oct 20 18:01:48 2018 (r339462) +++ head/sys/sys/stack.h Sat Oct 20 18:08:43 2018 (r339463) @@ -47,6 +47,8 @@ void stack_print_short(const struct stack *); void stack_print_short_ddb(const struct stack *); void stack_sbuf_print(struct sbuf *, const struct stack *); void stack_sbuf_print_ddb(struct sbuf *, const struct stack *); +int stack_sbuf_print_flags(struct sbuf *, const struct stack *, + int); #ifdef KTR void stack_ktr(u_int, const char *, int, const struct stack *, u_int, int); From owner-svn-src-head@freebsd.org Sat Oct 20 18:11:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61CF3FEF799; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4B7FCE7; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7D72186D; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIBkXK031406; Sat, 20 Oct 2018 18:11:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIBkgw031405; Sat, 20 Oct 2018 18:11:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810201811.w9KIBkgw031405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Oct 2018 18:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339464 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 339464 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:11:47 -0000 Author: kp Date: Sat Oct 20 18:11:46 2018 New Revision: 339464 URL: https://svnweb.freebsd.org/changeset/base/339464 Log: pfctl: Dup strings When we set the ifname we have to copy the string, rather than just keep the pointer. PR: 231323 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17507 Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Sat Oct 20 18:08:43 2018 (r339463) +++ head/sbin/pfctl/parse.y Sat Oct 20 18:11:46 2018 (r339464) @@ -4408,7 +4408,7 @@ route_host : STRING { $$ = calloc(1, sizeof(struct node_host)); if ($$ == NULL) err(1, "route_host: calloc"); - $$->ifname = $1; + $$->ifname = strdup($1); set_ipmask($$, 128); $$->next = NULL; $$->tail = $$; @@ -4418,7 +4418,7 @@ route_host : STRING { $$ = $3; for (n = $3; n != NULL; n = n->next) - n->ifname = $2; + n->ifname = strdup($2); } ; From owner-svn-src-head@freebsd.org Sat Oct 20 18:13:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AE4FEFAAD; Sat, 20 Oct 2018 18:13:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA3C8016F; Sat, 20 Oct 2018 18:13:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 105E0219C2; Sat, 20 Oct 2018 18:13:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIDplH034811; Sat, 20 Oct 2018 18:13:51 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIDp5S034810; Sat, 20 Oct 2018 18:13:51 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810201813.w9KIDp5S034810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 20 Oct 2018 18:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339465 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 339465 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:13:52 -0000 Author: eugen Date: Sat Oct 20 18:13:51 2018 New Revision: 339465 URL: https://svnweb.freebsd.org/changeset/base/339465 Log: rc.initdiskless: add support for auxiliary NVRAM. Currently, rc.inidiskless assumes that local system configuration changes are kept in some mountable file system. For example, nanobsd uses dedicated partition mounted as /cfg for this. However, small embedded devices like MIPS routers may have no enough flash space to keep full-blown file system but have only one or couple small flash blocks to keep persistent local configuration overrides. This change extends rc.initdiskless and introduces ability to run auxiliary command /conf/T/M/extract that is supposed to extract configuration overrides from such local storage. For example, the command /conf/default/etc/extract may contain something like: cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg bsdcpio command extracts compressed archive from the storage to /etc assuming the storage is exposed by the kernel as /dev/map/cfg to userland. PR: 204215 MFC after: 1 month Modified: head/libexec/rc/rc.initdiskless Modified: head/libexec/rc/rc.initdiskless ============================================================================== --- head/libexec/rc/rc.initdiskless Sat Oct 20 18:11:46 2018 (r339464) +++ head/libexec/rc/rc.initdiskless Sat Oct 20 18:13:51 2018 (r339465) @@ -111,6 +111,15 @@ # created for /SUBDIR if necessary). The presence of this file # prevents the copy from /conf/T/SUBDIR/ # +# /conf/T/M/extract +# This is alternative to SUBDIR.cpio.gz and remount. +# Similar to remount case, a memory filesystem is created +# for /M and initialized from a template but no mounting +# performed. Instead, this file is run passing /M as singe +# argument. It is expected to extract template override to /M +# using auxiliary storage found in some embedded systems +# having NVRAM too small to hold mountable file system. +# # /conf/T/SUBDIR.remove # The list of paths contained in the file are rm -rf'd # relative to /SUBDIR. @@ -343,8 +352,8 @@ done # - Create all required MFS filesystems and populate them from # our templates. Support both a direct template and a dir.cpio.gz -# archive. Support dir.remove files containing a list of relative -# paths to remove. +# archive. Support for auxiliary NVRAM. Support dir.remove files containing +# a list of relative paths to remove. # # The dir.cpio.gz form is there to make the copy process more efficient, # so if the cpio archive is present, it prevents the files from dir/ @@ -365,6 +374,15 @@ for i in ${templates} ; do create_md $subdir echo "Loading /$subdir from cpio archive $j" (cd / ; /rescue/tar -xpf $j) + fi + done + for j in /conf/$i/*/extract ; do + if [ -x $j ]; then + subdir=${j%*/extract} + subdir=${subdir##*/} + create_md $subdir + echo "Loading /$subdir using auxiliary command $j" + $j /$subdir fi done for j in /conf/$i/*.remove ; do From owner-svn-src-head@freebsd.org Sat Oct 20 18:18:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E887BFEFDB7; Sat, 20 Oct 2018 18:18:29 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC7A8050F; Sat, 20 Oct 2018 18:18:29 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69F47219CC; Sat, 20 Oct 2018 18:18:29 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIITuR035271; Sat, 20 Oct 2018 18:18:29 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIISM0035268; Sat, 20 Oct 2018 18:18:28 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810201818.w9KIISM0035268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Oct 2018 18:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339466 - in head/sbin/pfctl/tests: . files X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sbin/pfctl/tests: . files X-SVN-Commit-Revision: 339466 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:18:30 -0000 Author: kp Date: Sat Oct 20 18:18:28 2018 New Revision: 339466 URL: https://svnweb.freebsd.org/changeset/base/339466 Log: pfctl tests: Basic test case for PR 231323 PR: 231323 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17508 Added: head/sbin/pfctl/tests/files/pf1005.in (contents, props changed) head/sbin/pfctl/tests/files/pf1005.ok (contents, props changed) Modified: head/sbin/pfctl/tests/files/pfctl_test_descr.sh head/sbin/pfctl/tests/pfctl_test.sh Added: head/sbin/pfctl/tests/files/pf1005.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf1005.in Sat Oct 20 18:18:28 2018 (r339466) @@ -0,0 +1,3 @@ +rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121 +pass out log quick on lo0 route-to lo0 from any to any +pass in log quick on lo0 route-to (lo0 localhost) from any to any Added: head/sbin/pfctl/tests/files/pf1005.ok ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/files/pf1005.ok Sat Oct 20 18:18:28 2018 (r339466) @@ -0,0 +1,2 @@ +pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state +pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep state Modified: head/sbin/pfctl/tests/files/pfctl_test_descr.sh ============================================================================== --- head/sbin/pfctl/tests/files/pfctl_test_descr.sh Sat Oct 20 18:13:51 2018 (r339465) +++ head/sbin/pfctl/tests/files/pfctl_test_descr.sh Sat Oct 20 18:18:28 2018 (r339466) @@ -79,3 +79,4 @@ pf1001_descr () { echo "Binat" ; } pf1002_descr () { echo "Set timeout interval" ; } pf1003_descr () { echo "ALTQ" ; } pf1004_descr () { echo "ALTQ with Codel" ; } +pf1005_descr () { echo "PR 231323" ; } Modified: head/sbin/pfctl/tests/pfctl_test.sh ============================================================================== --- head/sbin/pfctl/tests/pfctl_test.sh Sat Oct 20 18:13:51 2018 (r339465) +++ head/sbin/pfctl/tests/pfctl_test.sh Sat Oct 20 18:18:28 2018 (r339466) @@ -22,7 +22,7 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0032 0034 0035 0038 0039 0040 0041 0047 0048 0049 0050 0052 0053 0055 0056 0057 0060 0061 0065 0067 0069 0070 0071 0072 0074 0075 0077 0078 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 -0097 0098 0100 0101 0102 0104 1001 1002 1003 1004" +0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" . $(atf_get_srcdir)/files/pfctl_test_descr.sh From owner-svn-src-head@freebsd.org Sat Oct 20 18:30:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10087FF0270; Sat, 20 Oct 2018 18:30:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BADA380D32; Sat, 20 Oct 2018 18:30:13 +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 B5B1C21BE3; Sat, 20 Oct 2018 18:30:13 +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 w9KIUDOo040623; Sat, 20 Oct 2018 18:30:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIUDaM040622; Sat, 20 Oct 2018 18:30:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810201830.w9KIUDaM040622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 18:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339467 - head/sys/dev/ep X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/ep X-SVN-Commit-Revision: 339467 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:30:14 -0000 Author: emaste Date: Sat Oct 20 18:30:13 2018 New Revision: 339467 URL: https://svnweb.freebsd.org/changeset/base/339467 Log: Remove incorrect BSD-2-Clause-FreeBSD SPDX tag Modified: head/sys/dev/ep/if_epreg.h Modified: head/sys/dev/ep/if_epreg.h ============================================================================== --- head/sys/dev/ep/if_epreg.h Sat Oct 20 18:18:28 2018 (r339466) +++ head/sys/dev/ep/if_epreg.h Sat Oct 20 18:30:13 2018 (r339467) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Sat Oct 20 18:31:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8CFFFF03A7; Sat, 20 Oct 2018 18:31:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D1CF81075; Sat, 20 Oct 2018 18:31:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9810221D3A; Sat, 20 Oct 2018 18:31:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIVc24043929; Sat, 20 Oct 2018 18:31:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIVbtN043921; Sat, 20 Oct 2018 18:31:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201831.w9KIVbtN043921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339468 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 339468 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:31:39 -0000 Author: cem Date: Sat Oct 20 18:31:36 2018 New Revision: 339468 URL: https://svnweb.freebsd.org/changeset/base/339468 Log: Replace ttyprintf with sbuf_printf and tty drain routine Add string variants of cnputc and tty_putchar, and use them from the tty sbuf drain routine. Suggested by: ed@ Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_cons.c head/sys/kern/subr_prf.c head/sys/kern/tty_info.c head/sys/kern/tty_ttydisc.c head/sys/sys/cons.h head/sys/sys/systm.h head/sys/sys/tty.h Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/kern/kern_cons.c Sat Oct 20 18:31:36 2018 (r339468) @@ -522,9 +522,9 @@ cnputc(int c) } void -cnputs(char *p) +cnputsn(const char *p, size_t n) { - int c; + size_t i; int unlock_reqd = 0; if (use_cnputs_mtx) { @@ -539,11 +539,17 @@ cnputs(char *p) unlock_reqd = 1; } - while ((c = *p++) != '\0') - cnputc(c); + for (i = 0; i < n; i++) + cnputc(p[i]); if (unlock_reqd) mtx_unlock_spin(&cnputs_mtx); +} + +void +cnputs(char *p) +{ + cnputsn(p, strlen(p)); } static int consmsgbuf_size = 8192; Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/kern/subr_prf.c Sat Oct 20 18:31:36 2018 (r339468) @@ -258,27 +258,6 @@ vtprintf(struct proc *p, int pri, const char *fmt, va_ msgbuftrigger = 1; } -/* - * Ttyprintf displays a message on a tty; it should be used only by - * the tty driver, or anything that knows the underlying tty will not - * be revoke(2)'d away. Other callers should use tprintf. - */ -int -ttyprintf(struct tty *tp, const char *fmt, ...) -{ - va_list ap; - struct putchar_arg pca; - int retval; - - va_start(ap, fmt); - pca.tty = tp; - pca.flags = TOTTY; - pca.p_bufr = NULL; - retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); - return (retval); -} - static int _vprintf(int level, int flags, const char *fmt, va_list ap) { Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/kern/tty_info.c Sat Oct 20 18:31:36 2018 (r339468) @@ -46,10 +46,13 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include #include +#include #include #include #include @@ -209,6 +212,27 @@ proc_compare(struct proc *p1, struct proc *p2) return (p2->p_pid > p1->p_pid); /* tie - return highest pid */ } +static int +sbuf_tty_drain(void *a, const char *d, int len) +{ + struct tty *tp; + int rc; + + tp = a; + + if (kdb_active) { + cnputsn(d, len); + return (len); + } + if (tp != NULL && panicstr == NULL) { + rc = tty_putstrn(tp, d, len); + if (rc != 0) + return (-ENXIO); + return (len); + } + return (-ENXIO); +} + /* * Report on state of foreground process group. */ @@ -219,6 +243,7 @@ tty_info(struct tty *tp) struct proc *p, *ppick; struct thread *td, *tdpick; const char *stateprefix, *state; + struct sbuf sb; long rss; int load, pctcpu; pid_t pid; @@ -230,24 +255,27 @@ tty_info(struct tty *tp) if (tty_checkoutq(tp) == 0) return; + (void)sbuf_new(&sb, tp->t_prbuf, sizeof(tp->t_prbuf), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_tty_drain, tp); + /* Print load average. */ load = (averunnable.ldavg[0] * 100 + FSCALE / 2) >> FSHIFT; - ttyprintf(tp, "%sload: %d.%02d ", tp->t_column == 0 ? "" : "\n", + sbuf_printf(&sb, "%sload: %d.%02d ", tp->t_column == 0 ? "" : "\n", load / 100, load % 100); if (tp->t_session == NULL) { - ttyprintf(tp, "not a controlling terminal\n"); - return; + sbuf_printf(&sb, "not a controlling terminal\n"); + goto out; } if (tp->t_pgrp == NULL) { - ttyprintf(tp, "no foreground process group\n"); - return; + sbuf_printf(&sb, "no foreground process group\n"); + goto out; } PGRP_LOCK(tp->t_pgrp); if (LIST_EMPTY(&tp->t_pgrp->pg_members)) { PGRP_UNLOCK(tp->t_pgrp); - ttyprintf(tp, "empty foreground process group\n"); - return; + sbuf_printf(&sb, "empty foreground process group\n"); + goto out; } /* @@ -305,11 +333,15 @@ tty_info(struct tty *tp) PROC_UNLOCK(p); /* Print command, pid, state, rtime, utime, stime, %cpu, and rss. */ - ttyprintf(tp, + sbuf_printf(&sb, " cmd: %s %d [%s%s] %ld.%02ldr %ld.%02ldu %ld.%02lds %d%% %ldk\n", comm, pid, stateprefix, state, (long)rtime.tv_sec, rtime.tv_usec / 10000, (long)utime.tv_sec, utime.tv_usec / 10000, (long)stime.tv_sec, stime.tv_usec / 10000, pctcpu / 100, rss); + +out: + sbuf_finish(&sb); + sbuf_delete(&sb); } Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/kern/tty_ttydisc.c Sat Oct 20 18:31:36 2018 (r339468) @@ -1251,17 +1251,27 @@ ttydisc_getc_poll(struct tty *tp) */ int -tty_putchar(struct tty *tp, char c) +tty_putstrn(struct tty *tp, const char *p, size_t n) { + size_t i; + tty_lock_assert(tp, MA_OWNED); if (tty_gone(tp)) return (-1); - ttydisc_echo_force(tp, c, 0); + for (i = 0; i < n; i++) + ttydisc_echo_force(tp, p[i], 0); + tp->t_writepos = tp->t_column; ttyinq_reprintpos_set(&tp->t_inq); ttydevsw_outwakeup(tp); return (0); +} + +int +tty_putchar(struct tty *tp, char c) +{ + return (tty_putstrn(tp, &c, 1)); } Modified: head/sys/sys/cons.h ============================================================================== --- head/sys/sys/cons.h Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/sys/cons.h Sat Oct 20 18:31:36 2018 (r339468) @@ -137,6 +137,7 @@ int cngetc(void); void cngets(char *, size_t, int); void cnputc(int); void cnputs(char *); +void cnputsn(const char *, size_t); int cnunavailable(void); void constty_set(struct tty *tp); void constty_clear(void); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/sys/systm.h Sat Oct 20 18:31:36 2018 (r339468) @@ -290,7 +290,6 @@ int vasprintf(char **ret, struct malloc_type *mtp, con int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0); int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); -int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); int sscanf(const char *, char const * _Nonnull, ...) __scanflike(2, 3); int vsscanf(const char * _Nonnull, char const * _Nonnull, __va_list) __scanflike(2, 0); long strtol(const char *, char **, int); Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Sat Oct 20 18:30:13 2018 (r339467) +++ head/sys/sys/tty.h Sat Oct 20 18:31:36 2018 (r339468) @@ -132,6 +132,13 @@ struct tty { void *t_devswsoftc; /* (c) Soft config, for drivers. */ void *t_hooksoftc; /* (t) Soft config, for hooks. */ struct cdev *t_dev; /* (c) Primary character device. */ + +#ifndef PRINTF_BUFR_SIZE +#define TTY_PRINTF_SIZE 256 +#else +#define TTY_PRINTF_SIZE PRINTF_BUFR_SIZE +#endif + char t_prbuf[TTY_PRINTF_SIZE]; /* (t) */ }; /* @@ -194,6 +201,7 @@ void tty_wakeup(struct tty *tp, int flags); /* System messages. */ int tty_checkoutq(struct tty *tp); int tty_putchar(struct tty *tp, char c); +int tty_putstrn(struct tty *tp, const char *p, size_t n); int tty_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td); From owner-svn-src-head@freebsd.org Sat Oct 20 18:32:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46707FF0629; Sat, 20 Oct 2018 18:32:35 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF272813FC; Sat, 20 Oct 2018 18:32:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA2E921D95; Sat, 20 Oct 2018 18:32:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIWYK9045408; Sat, 20 Oct 2018 18:32:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIWY3c045405; Sat, 20 Oct 2018 18:32:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810201832.w9KIWY3c045405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 18:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339469 - in head/sys/dev: ep vx X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/dev: ep vx X-SVN-Commit-Revision: 339469 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:32:35 -0000 Author: emaste Date: Sat Oct 20 18:32:34 2018 New Revision: 339469 URL: https://svnweb.freebsd.org/changeset/base/339469 Log: Remove incorrect BSD-2-Clause-FreeBSD SPDX tags Modified: head/sys/dev/ep/if_epvar.h head/sys/dev/vx/if_vxreg.h head/sys/dev/vx/if_vxvar.h Modified: head/sys/dev/ep/if_epvar.h ============================================================================== --- head/sys/dev/ep/if_epvar.h Sat Oct 20 18:31:36 2018 (r339468) +++ head/sys/dev/ep/if_epvar.h Sat Oct 20 18:32:34 2018 (r339469) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/vx/if_vxreg.h ============================================================================== --- head/sys/dev/vx/if_vxreg.h Sat Oct 20 18:31:36 2018 (r339468) +++ head/sys/dev/vx/if_vxreg.h Sat Oct 20 18:32:34 2018 (r339469) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/vx/if_vxvar.h ============================================================================== --- head/sys/dev/vx/if_vxvar.h Sat Oct 20 18:31:36 2018 (r339468) +++ head/sys/dev/vx/if_vxvar.h Sat Oct 20 18:32:34 2018 (r339469) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Sat Oct 20 18:37:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2466FF09A9; Sat, 20 Oct 2018 18:37:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 698CB81860; Sat, 20 Oct 2018 18:37:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6479621D9D; Sat, 20 Oct 2018 18:37:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIbMeG045868; Sat, 20 Oct 2018 18:37:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIbMOh045867; Sat, 20 Oct 2018 18:37:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810201837.w9KIbMOh045867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Oct 2018 18:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339470 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 339470 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:37:22 -0000 Author: kp Date: Sat Oct 20 18:37:21 2018 New Revision: 339470 URL: https://svnweb.freebsd.org/changeset/base/339470 Log: pf synproxy will do the 3WHS on behalf of the target machine, and once the 3WHS is completed, establish the backend connection. The trigger for "3WHS completed" is the reception of the first ACK. However, we should not proceed if that ACK also has RST or FIN set. PR: 197484 Obtained from: OpenBSD MFC after: 2 weeks Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Oct 20 18:32:34 2018 (r339469) +++ head/sys/netpfil/pf/pf.c Sat Oct 20 18:37:21 2018 (r339470) @@ -4401,7 +4401,7 @@ pf_test_state_tcp(struct pf_state **state, int directi TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); - } else if (!(th->th_flags & TH_ACK) || + } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { REASON_SET(reason, PFRES_SYNPROXY); From owner-svn-src-head@freebsd.org Sat Oct 20 18:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB579FF0F47; Sat, 20 Oct 2018 18:42:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 821CE81EE9; Sat, 20 Oct 2018 18:42:29 +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 639B121F2A; Sat, 20 Oct 2018 18:42:29 +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 w9KIgTeJ050787; Sat, 20 Oct 2018 18:42:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIgTtk050786; Sat, 20 Oct 2018 18:42:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201842.w9KIgTtk050786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339471 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339471 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:42:30 -0000 Author: cem Date: Sat Oct 20 18:42:28 2018 New Revision: 339471 URL: https://svnweb.freebsd.org/changeset/base/339471 Log: tty info (^T): Add optional kernel stack(9) traces It is often useful for developers and administrators to determine a running thread's stack for debugging purposes. With this feature, using ^T will print that information For now, the feature is disabled by default. Enable with sysctl kern.tty_info_kstacks=1. Discussed with: markj Reviewed by: oshogbo Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17621 Modified: head/sys/kern/tty_info.c Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Sat Oct 20 18:37:21 2018 (r339470) +++ head/sys/kern/tty_info.c Sat Oct 20 18:42:28 2018 (r339471) @@ -49,11 +49,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include +#include #include #include @@ -233,6 +236,11 @@ sbuf_tty_drain(void *a, const char *d, int len) return (-ENXIO); } +static bool tty_info_kstacks = false; +SYSCTL_BOOL(_kern, OID_AUTO, tty_info_kstacks, CTLFLAG_RWTUN, + &tty_info_kstacks, 0, + "Enable printing kernel stack(9) traces on ^T (tty info)"); + /* * Report on state of foreground process group. */ @@ -240,12 +248,13 @@ void tty_info(struct tty *tp) { struct timeval rtime, utime, stime; + struct stack stack; struct proc *p, *ppick; struct thread *td, *tdpick; const char *stateprefix, *state; struct sbuf sb; long rss; - int load, pctcpu; + int load, pctcpu, sterr; pid_t pid; char comm[MAXCOMLEN + 1]; struct rusage ru; @@ -320,6 +329,15 @@ tty_info(struct tty *tp) else state = "unknown"; pctcpu = (sched_pctcpu(td) * 10000 + FSCALE / 2) >> FSHIFT; + if (tty_info_kstacks) { + stack_zero(&stack); + if (TD_IS_SWAPPED(td) || TD_IS_RUNNING(td)) + sterr = stack_save_td_running(&stack, td); + else { + stack_save_td(&stack, td); + sterr = 0; + } + } thread_unlock(td); if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) rss = 0; @@ -340,6 +358,9 @@ tty_info(struct tty *tp) (long)utime.tv_sec, utime.tv_usec / 10000, (long)stime.tv_sec, stime.tv_usec / 10000, pctcpu / 100, rss); + + if (tty_info_kstacks && sterr == 0) + stack_sbuf_print_flags(&sb, &stack, M_NOWAIT); out: sbuf_finish(&sb); From owner-svn-src-head@freebsd.org Sat Oct 20 18:46:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7610FF10A8; Sat, 20 Oct 2018 18:46:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC9F8216B; Sat, 20 Oct 2018 18:46:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8326A21F3F; Sat, 20 Oct 2018 18:46:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIkbQF051051; Sat, 20 Oct 2018 18:46:37 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIkbSv051050; Sat, 20 Oct 2018 18:46:37 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810201846.w9KIkbSv051050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 20 Oct 2018 18:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339472 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 339472 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:46:38 -0000 Author: eugen Date: Sat Oct 20 18:46:36 2018 New Revision: 339472 URL: https://svnweb.freebsd.org/changeset/base/339472 Log: rc.initdiskless: fix commentary grammar after r339465 MFC after: 1 month Modified: head/libexec/rc/rc.initdiskless Modified: head/libexec/rc/rc.initdiskless ============================================================================== --- head/libexec/rc/rc.initdiskless Sat Oct 20 18:42:28 2018 (r339471) +++ head/libexec/rc/rc.initdiskless Sat Oct 20 18:46:36 2018 (r339472) @@ -115,7 +115,7 @@ # This is alternative to SUBDIR.cpio.gz and remount. # Similar to remount case, a memory filesystem is created # for /M and initialized from a template but no mounting -# performed. Instead, this file is run passing /M as singe +# performed. Instead, this file is run passing /M as single # argument. It is expected to extract template override to /M # using auxiliary storage found in some embedded systems # having NVRAM too small to hold mountable file system. From owner-svn-src-head@freebsd.org Sat Oct 20 18:47:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 522A6FF1186; Sat, 20 Oct 2018 18:47:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08D35822EC; Sat, 20 Oct 2018 18:47:46 +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 03A7A21F42; Sat, 20 Oct 2018 18:47:46 +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 w9KIljml051146; Sat, 20 Oct 2018 18:47:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIljk5051145; Sat, 20 Oct 2018 18:47:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810201847.w9KIljk5051145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 18:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339473 - head/contrib/elftoolchain/libelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 339473 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:47:46 -0000 Author: emaste Date: Sat Oct 20 18:47:45 2018 New Revision: 339473 URL: https://svnweb.freebsd.org/changeset/base/339473 Log: libelf: also test for 64-bit ELF in _libelf_is_mips64el Although _libelf_is_mips64el is only called in contexts where we've already checked that e_class is ELFCLASS64 but this may change in the future. Add a safety belt so that we don't access an invalid e_ehdr64 union member if it does. Reported by: jkoshy (in review D17380) Modified: head/contrib/elftoolchain/libelf/gelf_mips64el.c Modified: head/contrib/elftoolchain/libelf/gelf_mips64el.c ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_mips64el.c Sat Oct 20 18:46:36 2018 (r339472) +++ head/contrib/elftoolchain/libelf/gelf_mips64el.c Sat Oct 20 18:47:45 2018 (r339473) @@ -34,7 +34,7 @@ int _libelf_is_mips64el(Elf *e) { - return (e->e_kind == ELF_K_ELF && + return (e->e_kind == ELF_K_ELF && e->e_class == ELFCLASS64 && e->e_u.e_elf.e_ehdr.e_ehdr64->e_machine == EM_MIPS && e->e_u.e_elf.e_ehdr.e_ehdr64->e_ident[EI_DATA] == ELFDATA2LSB); } From owner-svn-src-head@freebsd.org Sat Oct 20 18:53:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8DB0FF15BC; Sat, 20 Oct 2018 18:53:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFD4827FA; Sat, 20 Oct 2018 18:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54504220EC; Sat, 20 Oct 2018 18:53:33 +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 w9KIrXJh055999; Sat, 20 Oct 2018 18:53:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIrX2e055998; Sat, 20 Oct 2018 18:53:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201853.w9KIrX2e055998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 18:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339474 - head/bin/stty X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/bin/stty X-SVN-Commit-Revision: 339474 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.29 Precedence: list List-Id: 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, 20 Oct 2018 18:53:33 -0000 Author: cem Date: Sat Oct 20 18:53:32 2018 New Revision: 339474 URL: https://svnweb.freebsd.org/changeset/base/339474 Log: stty.1: Document kern.tty_info_kstacks behavior (r339471) Reported by: bdrewery Reviewed by: bdrewery Sponsored by: Dell EMC Isilon Modified: head/bin/stty/stty.1 Modified: head/bin/stty/stty.1 ============================================================================== --- head/bin/stty/stty.1 Sat Oct 20 18:47:45 2018 (r339473) +++ head/bin/stty/stty.1 Sat Oct 20 18:53:32 2018 (r339474) @@ -32,7 +32,7 @@ .\" @(#)stty.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 2, 2018 +.Dd October 20, 2018 .Dt STTY 1 .Os .Sh NAME @@ -459,6 +459,13 @@ The status line consists of the system load average, the current command name, its process ID, the event the process is waiting on (or the status of the process), the user and system times, percent cpu, and current memory usage. +.Pp +If the +.Xr sysctl 8 +variable +.Va kern.tty_info_kstacks +is set to a non-zero value, the status message also includes the kernel program +stack of the foreground thread. .It Cm columns Ar number The terminal size is recorded as having .Ar number From owner-svn-src-head@freebsd.org Sat Oct 20 18:53:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0399FF15F2 for ; Sat, 20 Oct 2018 18:53:58 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 663108290C for ; Sat, 20 Oct 2018 18:53:58 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-ed1-x52b.google.com with SMTP id w19-v6so34297936eds.1 for ; Sat, 20 Oct 2018 11:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+CXiIFzO/mGdx9DHuwwJhA2oSBUR3hzEkqUaUMrY8R4=; b=P/ZvAX+GZNIPkMWRYUrDmWgy5ZvIdoxy1R2mgHNTrEpRYQOPztD2IdRAw+sjYlPj+W 6+D2HeqI8+ae7QIZ57ESPAvTHvC8wYT1+/mrvB7k/AKpcV+uK9uTNmIG+n4XMd/B07A4 16w0oU+eFskuIiJ+Zjz+Bq7t974VxMtuw9vixkC6/xDUzslNG0wzyCPfnc6+DeMNVpvn oG+c1Rp1FZqEp/Z6P3jX96oEwdcvIAUSBJPmb5jwPryTR8ug6W4jWhWqr6LnJLNXFW4O FeZx1mArCTh7gd77E6cgjalMZ0XF8m4QDvLsi/0p4bt05spx1I8yseoZbsRr7IXgXLMW cPPA== 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=+CXiIFzO/mGdx9DHuwwJhA2oSBUR3hzEkqUaUMrY8R4=; b=qDKms09p1ixWLjs5D8VlM/oZpi9L+aQFdh4H/n9Auy3Zp5ubuQ7yDUYVJ+zh1r7OkH M0n5Dirnc884KJy0DlqLn5hCieKENzGqYKs/1eg4MxV0xkF6cBy2KIq8wMQKBacKzVMa 1yQWgxQniZCC6PxAtTuuCv5mxo4aGncxQ2LkPP9seeZTxXFzJwqkcmzoXtyltnPUA/LN LGbFTXWsKNdxJWQje+NJmm8W+D/zbRs/hXHThC4yEO5qx69PhY/zuHqaaebmI3NV48ye VfqWDR7FRe8EIJPImWfV8YOxgjrbswAr3ntFkDtgYfiyGrz249mbz0rqSII4lMWbPytK ei8A== X-Gm-Message-State: ABuFfohcBxKdX/nHOWsJT2XAEJnflpG4YiFOCl5lfUeb08a3XmTiaOV0 LbXB9+axUhWV9FS16g/A5Y3dK1/OkMyXCzZnd/niZlzv X-Google-Smtp-Source: ACcGV603EhIczT5aGfaFQpsHVBwJTBw6/1JrtpAqtT+mZsTuE7z9tHRKazq1aCTJSG4TMiWq7aG60iPiTDC2TxVL63k= X-Received: by 2002:a50:a825:: with SMTP id j34-v6mr9642280edc.258.1540061636647; Sat, 20 Oct 2018 11:53:56 -0700 (PDT) MIME-Version: 1.0 References: <201810201831.w9KIVbtN043921@repo.freebsd.org> In-Reply-To: <201810201831.w9KIVbtN043921@repo.freebsd.org> From: Ed Schouten Date: Sat, 20 Oct 2018 20:53:31 +0200 Message-ID: Subject: Re: svn commit: r339468 - in head/sys: kern sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Oct 2018 18:53:59 -0000 Hi there, Op za 20 okt. 2018 om 20:31 schreef Conrad Meyer : > +static int > +sbuf_tty_drain(void *a, const char *d, int len) > +{ > + struct tty *tp; > + int rc; > + > + tp = a; > + > + if (kdb_active) { > + cnputsn(d, len); > + return (len); > + } > + if (tp != NULL && panicstr == NULL) { > + rc = tty_putstrn(tp, d, len); > + if (rc != 0) > + return (-ENXIO); > + return (len); > + } > + return (-ENXIO); > +} Disclaimer: Long time since I did a lot with the TTY code. Can kdb_active, tp == NULL and panicstr != NULL even occur in this case? tty_info() can only get called in non-degenerate cases, right? -- Ed Schouten From owner-svn-src-head@freebsd.org Sat Oct 20 19:14:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B9E9FF1ED9; Sat, 20 Oct 2018 19:14:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 506E5833F9; Sat, 20 Oct 2018 19:14:47 +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 4B5D822430; Sat, 20 Oct 2018 19:14:47 +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 w9KJElq4066494; Sat, 20 Oct 2018 19:14:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KJEkaK066492; Sat, 20 Oct 2018 19:14:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810201914.w9KJEkaK066492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Oct 2018 19:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339475 - in head: . sys/dev/drm2 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/dev/drm2 X-SVN-Commit-Revision: 339475 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.29 Precedence: list List-Id: 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, 20 Oct 2018 19:14:47 -0000 Author: imp Date: Sat Oct 20 19:14:46 2018 New Revision: 339475 URL: https://svnweb.freebsd.org/changeset/base/339475 Log: Add updating entry for DRM Update messaging for which drm module to install. Add guidance on what hardware is supported (which should be copied into the release notes). Note: the in tree drivers are abandonware. There has been no organized support for them for many years, and the plan is to still remove them for all but arm once the transition to drm-*kmod is complete. Also note that WITHOUT_MODULE_DRM and WITHOUT_MODULE_DRM2 should generally be added to src.conf for anybody using the drm-*kmod ports. That will become default in 13 soon, however. Approved by: FreeBSD Graphics Team Relnotes: Yes MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D17451 Modified: head/UPDATING head/sys/dev/drm2/drm_os_freebsd.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Oct 20 18:53:32 2018 (r339474) +++ head/UPDATING Sat Oct 20 19:14:46 2018 (r339475) @@ -31,6 +31,31 @@ 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".) +20181015: + Ports for the DRM modules have been simplified. Now, amd64 users should + just install the drm-kmod port. All others should install + drm-legacy-kmod. + + Graphics hardware that's newer than about 2010 usually works with + drm-kmod. For hardware older than 2013, however, some users will need + to use drm-legacy-kmod if drm-kmod doesn't work for them. Hardware older + than 2008 usually only works in drm-legacy-kmod. The graphics team can + only commit to hardware made since 2013 due to the complexity of the + market and difficulty to test all the older cards effectively. If you + have hardware supported by drm-kmod, you are strongly encouraged to use + that as you will get better support. + + Other than KPI chasing, drm-legacy-kmod will not be updated. As outlined + elsewhere, the drm and drm2 modules will be eliminated from the src base + soon (with a limited exception for arm). Please update to the package asap + and report any issues to x11@freebsd.org. + + Generally, anybody using the drm*-kmod packages should add + WITHOUT_DRM_MODULE=t and WITHOUT_DRM2_MODULE=t to avoid nasty + cross-threading surprises, especially with automatic driver + loading from X11 startup. These will become the defaults in 13-current + shortly. + 20181009: OpenSSL has been updated to version 1.1.1. This update included additional various API changes througout the base system. It is Modified: head/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- head/sys/dev/drm2/drm_os_freebsd.h Sat Oct 20 18:53:32 2018 (r339474) +++ head/sys/dev/drm2/drm_os_freebsd.h Sat Oct 20 19:14:46 2018 (r339475) @@ -154,8 +154,8 @@ typedef void irqreturn_t; *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) + \ (vm_offset_t)(offset)) = htole64(val) -#ifdef __LP64__ -#define DRM_PORT "graphics/drm-stable-kmod" +#ifdef amd64 +#define DRM_PORT "graphics/drm-kmod" #else #define DRM_PORT "graphics/drm-legacy-kmod" #endif From owner-svn-src-head@freebsd.org Sat Oct 20 19:16:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192A4FF1FB8; Sat, 20 Oct 2018 19:16:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA58F835F1; Sat, 20 Oct 2018 19:16:43 +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 B30CF2244E; Sat, 20 Oct 2018 19:16:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KJGhMG066644; Sat, 20 Oct 2018 19:16:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KJGh0H066643; Sat, 20 Oct 2018 19:16:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201916.w9KJGh0H066643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 19:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339476 - head/sys/i386/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/i386/conf X-SVN-Commit-Revision: 339476 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.29 Precedence: list List-Id: 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, 20 Oct 2018 19:16:44 -0000 Author: cem Date: Sat Oct 20 19:16:43 2018 New Revision: 339476 URL: https://svnweb.freebsd.org/changeset/base/339476 Log: Add a MINIMAL config for i386, based on amd64 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D17560 Added: head/sys/i386/conf/MINIMAL (contents, props changed) Added: head/sys/i386/conf/MINIMAL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/MINIMAL Sat Oct 20 19:16:43 2018 (r339476) @@ -0,0 +1,149 @@ +# +# MINIMAL -- Mostly Minimal kernel configuration file for FreeBSD/i386 +# +# Many definitions of minimal are possible. The one this file follows is +# GENERIC, minus all functionality that can be replaced by loading kernel +# modules. +# +# Exceptions: +# o While UFS is buildable as a module, the current module lacks +# some features (ACL, GJOURNAL) that GENERIC includes. +# o acpi as a module has been reported flakey and not well tested, so +# is included in the kernel. +# o random is included due to uncertaty... +# o Many networking things are included +# +# For now, please run changes to these list past imp@freebsd.org +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +cpu I486_CPU +cpu I586_CPU +cpu I686_CPU +ident MINIMAL + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support + +options SCHED_ULE # ULE scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options TCP_OFFLOAD # TCP offload +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS +options MD_ROOT # MD is a potential root device +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 +options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options AUDIT # Security event auditing +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities +options MAC # TrustedBSD MAC Framework +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use (turn off in stable branch): +options DDB # Support DDB. +options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# Make an SMP-capable kernel by default +options SMP # Symmetric MultiProcessor Kernel +options EARLY_AP_STARTUP +device apic + +# CPU frequency control +device cpufreq + +# Bus support. +device acpi +options ACPI_DMAR +device pci + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse + +device kbdmux # keyboard multiplexer + +device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) + +device splash # Splash screen and screen saver support + +# syscons is the default console driver, resembling an SCO console +device sc +options SC_PIXEL_MODE # add support for the raster text mode + +# vt is the new video console driver +device vt +device vt_vga +device vt_efifb + +device agp # support several AGP chipsets + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device gif # IPv6 and IPv4 tunneling + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Xen HVM Guest Optimizations +# NOTE: XENHVM depends on xenpci. They must be added or removed together. +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver From owner-svn-src-head@freebsd.org Sat Oct 20 19:18:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0937FF208D; Sat, 20 Oct 2018 19:18:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B52837C0; Sat, 20 Oct 2018 19:18:30 +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 A093B22455; Sat, 20 Oct 2018 19:18:30 +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 w9KJIUbA066787; Sat, 20 Oct 2018 19:18:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KJIUHb066786; Sat, 20 Oct 2018 19:18:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810201918.w9KJIUHb066786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Oct 2018 19:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339477 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 339477 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.29 Precedence: list List-Id: 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, 20 Oct 2018 19:18:31 -0000 Author: imp Date: Sat Oct 20 19:18:30 2018 New Revision: 339477 URL: https://svnweb.freebsd.org/changeset/base/339477 Log: Now that we've branched, turn off building DRM and DRM2 by default. We no longer build the drm/drm2 modules by default. See UPDATING for which package to install instead. drm and drm2 have been completely unsupported abandonware for a long time now. Please report issues with the pkg modules to x11@freebsd.org. Approved by: FreeBSD Graphics Team Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sat Oct 20 19:16:43 2018 (r339476) +++ head/sys/conf/kern.opts.mk Sat Oct 20 19:18:30 2018 (r339477) @@ -38,8 +38,6 @@ __DEFAULT_YES_OPTIONS = \ IPSEC_SUPPORT \ ISCSI \ KERNEL_SYMBOLS \ - MODULE_DRM \ - MODULE_DRM2 \ NETGRAPH \ PF \ REPRODUCIBLE_BUILD \ @@ -52,6 +50,8 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ + MODULE_DRM \ + MODULE_DRM2 \ NAND \ OFED \ RATELIMIT From owner-svn-src-head@freebsd.org Sat Oct 20 19:42:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 936CBFF2D71; Sat, 20 Oct 2018 19:42:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A864847B8; Sat, 20 Oct 2018 19:42:39 +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 4570D22925; Sat, 20 Oct 2018 19:42:39 +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 w9KJgdYH082142; Sat, 20 Oct 2018 19:42:39 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KJgdUk082141; Sat, 20 Oct 2018 19:42:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201942.w9KJgdUk082141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 19:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339478 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339478 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.29 Precedence: list List-Id: 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, 20 Oct 2018 19:42:39 -0000 Author: cem Date: Sat Oct 20 19:42:38 2018 New Revision: 339478 URL: https://svnweb.freebsd.org/changeset/base/339478 Log: dev_refthread: Do not initialize *ref when reference was not acquired Like the companion API devvn_refthread, leave *ref uninitialized when a reference was not acquired. Initializing to 1 provides a vaguely correct-looking but bogus value for broken callers to (mistakenly) pass to dev_relthread() when refthread fails. Make it even more clear to consumers that dev_relthread is only valid when dev_refthread succeeds. Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16885 Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Oct 20 19:18:30 2018 (r339477) +++ head/sys/kern/kern_conf.c Sat Oct 20 19:42:38 2018 (r339478) @@ -202,7 +202,8 @@ dev_refthread(struct cdev *dev, int *ref) csw = NULL; } dev_unlock(); - *ref = 1; + if (csw != NULL) + *ref = 1; return (csw); } From owner-svn-src-head@freebsd.org Sat Oct 20 19:45:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D033FF2F15; Sat, 20 Oct 2018 19:45:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 345D184A05; Sat, 20 Oct 2018 19:45:00 +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 2F59722930; Sat, 20 Oct 2018 19:45:00 +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 w9KJj09A082305; Sat, 20 Oct 2018 19:45:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KJj0OF082304; Sat, 20 Oct 2018 19:45:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810201945.w9KJj0OF082304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 19:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339479 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339479 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.29 Precedence: list List-Id: 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, 20 Oct 2018 19:45:00 -0000 Author: cem Date: Sat Oct 20 19:44:59 2018 New Revision: 339479 URL: https://svnweb.freebsd.org/changeset/base/339479 Log: Fortuna: Clean up reseeding key material to closer match FS&K When reseeding, only incorporate actual key material. Do not include e.g. the derived key schedules or other AES context. I don't think the extra material was harmful here, just not beneficial. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16934 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Sat Oct 20 19:42:38 2018 (r339478) +++ head/sys/dev/random/fortuna.c Sat Oct 20 19:44:59 2018 (r339479) @@ -285,7 +285,8 @@ random_fortuna_reseed_internal(uint32_t *entropy_data, */ randomdev_hash_init(&context); randomdev_hash_iterate(&context, zero_region, RANDOM_ZERO_BLOCKSIZE); - randomdev_hash_iterate(&context, &fortuna_state.fs_key, sizeof(fortuna_state.fs_key)); + randomdev_hash_iterate(&context, &fortuna_state.fs_key.key.keyMaterial, + fortuna_state.fs_key.key.keyLen / 8); randomdev_hash_iterate(&context, entropy_data, RANDOM_KEYSIZE*blockcount); randomdev_hash_finish(&context, hash); randomdev_hash_init(&context); From owner-svn-src-head@freebsd.org Sat Oct 20 19:59:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EDBFF37F9; Sat, 20 Oct 2018 19:59:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 859ED852F6; Sat, 20 Oct 2018 19:59:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id h6-v6so6727301ith.0; Sat, 20 Oct 2018 12:59:56 -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:reply-to :from:date:message-id:subject:to:cc; bh=GO/iCxzNbm2ztMRuoY1hYZ0SftGSVswoDawVLP9KsDc=; b=cNGyDJsLdWk+bAHCQEuRWKMvk/9iU8PoxY64JJOfPUdHhUpj9rek3kgWWFvZcmIm9q mLqkRWijRFkNWTtvuQvc+3OWhYeRaYafIVLbEUL2Ln3C1NIovHqgGlBhcDnlGpUJXSJ0 6+dRdmtDuIz6mO7YkSiuk9b1oxMSrMEHh2xYS6421WHv23Ganzz+FrBRMtmWvSl3/d5J 8UgEvOLZhgwo1V7mCV9S9eIhs7agtuZ31MlKmeToxO3af9bsNMrdyAXDUCk+MPEc1yej EC4leOOxjmNjE6rIT4xXoL1w9M8GdeHgdo/9TONPkD9QChsIfH8pgEaZYdFH8eawrBVQ kXJA== X-Gm-Message-State: ABuFfoiD/PMAYPCH2A0bxO0MGMH/YQBR9UgpM15Jfnjyr6T0VsbQyPdQ VX6ouShg+SoQPNIHslh+vYzNoVJc X-Google-Smtp-Source: ACcGV61j6h39re6UnPmWIKBTmpe10DHXZ2p1bR5NHpykiaPznL+lxmgxOlF85ouJ88skLDkx74tm5w== X-Received: by 2002:a02:9d28:: with SMTP id n37-v6mr31164852jak.80.1540065588457; Sat, 20 Oct 2018 12:59:48 -0700 (PDT) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com. [209.85.166.173]) by smtp.gmail.com with ESMTPSA id h21-v6sm2893343ith.20.2018.10.20.12.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 12:59:48 -0700 (PDT) Received: by mail-it1-f173.google.com with SMTP id i191-v6so8238106iti.5; Sat, 20 Oct 2018 12:59:48 -0700 (PDT) X-Received: by 2002:a24:a089:: with SMTP id o131-v6mr6212582ite.91.1540065587687; Sat, 20 Oct 2018 12:59:47 -0700 (PDT) MIME-Version: 1.0 References: <201810201831.w9KIVbtN043921@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 20 Oct 2018 12:59:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339468 - in head/sys: kern sys To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Oct 2018 19:59:57 -0000 Hi Ed, On Sat, Oct 20, 2018 at 11:54 AM Ed Schouten wrote: > Op za 20 okt. 2018 om 20:31 schreef Conrad Meyer : > > +static int > > +sbuf_tty_drain(void *a, const char *d, int len) > > +{ > > + struct tty *tp; > > + int rc; > > + > > + tp = a; > > + > > + if (kdb_active) { > > + cnputsn(d, len); > > + return (len); > > + } > > + if (tp != NULL && panicstr == NULL) { > > + rc = tty_putstrn(tp, d, len); > > + if (rc != 0) > > + return (-ENXIO); > > + return (len); > > + } > > + return (-ENXIO); > > +} > > Disclaimer: Long time since I did a lot with the TTY code. > > Can kdb_active, tp == NULL and panicstr != NULL even occur in this > case? tty_info() can only get called in non-degenerate cases, right? I think you are correct, but I did not want to investigate to confirm. This was just the direct, conservative conversion of ttyprintf -> putchar. The checks can *probably* be removed. Best regards, Conrad From owner-svn-src-head@freebsd.org Sat Oct 20 20:12:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91332FF3E3E; Sat, 20 Oct 2018 20:12:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 452D485CCA; Sat, 20 Oct 2018 20:12:58 +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 4003922E28; Sat, 20 Oct 2018 20:12:58 +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 w9KKCwHq097427; Sat, 20 Oct 2018 20:12:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKCwOc097426; Sat, 20 Oct 2018 20:12:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202012.w9KKCwOc097426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 20:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339480 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339480 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:12:58 -0000 Author: cem Date: Sat Oct 20 20:12:57 2018 New Revision: 339480 URL: https://svnweb.freebsd.org/changeset/base/339480 Log: Fortuna: Add trivial assert to match FS&K definition FS&K GenerateBlocks function asserts C (counter) != 0. This should also be true in our implementation. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16936 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Sat Oct 20 19:44:59 2018 (r339479) +++ head/sys/dev/random/fortuna.c Sat Oct 20 20:12:57 2018 (r339480) @@ -310,6 +310,8 @@ random_fortuna_genblocks(uint8_t *buf, u_int blockcoun u_int i; RANDOM_RESEED_ASSERT_LOCK_OWNED(); + KASSERT(!uint128_is_zero(fortuna_state.fs_counter), ("FS&K: C != 0")); + for (i = 0; i < blockcount; i++) { /*- * FS&K - r = r|E(K,C) From owner-svn-src-head@freebsd.org Sat Oct 20 20:15:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00DCCFF3F2C; Sat, 20 Oct 2018 20:15:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93B185E90; Sat, 20 Oct 2018 20:15:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A447022E36; Sat, 20 Oct 2018 20:15:06 +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 w9KKF6YW097562; Sat, 20 Oct 2018 20:15:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKF6Ag097561; Sat, 20 Oct 2018 20:15:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202015.w9KKF6Ag097561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 20:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339481 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339481 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:15:07 -0000 Author: cem Date: Sat Oct 20 20:15:06 2018 New Revision: 339481 URL: https://svnweb.freebsd.org/changeset/base/339481 Log: Fortuna: trivial static variable cleanup Remove unnecessary use of function-local static variable. 32 bytes is small enough to live on the stack. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16937 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Sat Oct 20 20:12:57 2018 (r339480) +++ head/sys/dev/random/fortuna.c Sat Oct 20 20:15:06 2018 (r339481) @@ -333,7 +333,7 @@ random_fortuna_genblocks(uint8_t *buf, u_int blockcoun static __inline void random_fortuna_genrandom(uint8_t *buf, u_int bytecount) { - static uint8_t temp[RANDOM_BLOCKSIZE*(RANDOM_KEYS_PER_BLOCK)]; + uint8_t temp[RANDOM_BLOCKSIZE * RANDOM_KEYS_PER_BLOCK]; u_int blockcount; RANDOM_RESEED_ASSERT_LOCK_OWNED(); From owner-svn-src-head@freebsd.org Sat Oct 20 20:34:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50803FF4C67; Sat, 20 Oct 2018 20:34:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F001786B38; Sat, 20 Oct 2018 20:34:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAC7D23176; Sat, 20 Oct 2018 20:34:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KKYaKO007962; Sat, 20 Oct 2018 20:34:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKYaMr007961; Sat, 20 Oct 2018 20:34:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201810202034.w9KKYaMr007961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 20 Oct 2018 20:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339484 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 339484 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:34:37 -0000 Author: eadler Date: Sat Oct 20 20:34:36 2018 New Revision: 339484 URL: https://svnweb.freebsd.org/changeset/base/339484 Log: bsd-family-tree: Announce two new releases - OpenBSD 6.4; NetBSD 7.2 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Oct 20 20:34:30 2018 (r339483) +++ head/share/misc/bsd-family-tree Sat Oct 20 20:34:36 2018 (r339484) @@ -368,13 +368,14 @@ FreeBSD 5.2 | | | | | | | NetBSD 7.1.2 | | | | | | | | | | | | | | OpenBSD 6.3 | - | | | | | | DragonFly 5.2.0 - | | | | | | | + | | | NetBSD | | DragonFly 5.2.0 + | | | 8.0 | | | | | | | | | DragonFly 5.2.1 | | | | | | | | | | | | | DragonFly 5.2.2 - | FreeBSD | | NetBSD 8.0 | | + | FreeBSD | | NetBSD 7.2 | | | 11.2 | | | | | + | | | | | OpenBSD 6.4 | | v | | | | | | | | v | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current @@ -752,6 +753,8 @@ DragonFly 5.2.1 2018-05-20 [DFB] DragonFly 5.2.2 2018-06-18 [DFB] FreeBSD 11.2 2018-06-27 [FBD] NetBSD 8.0 2018-07-17 [NBD] +NetBSD 7.2 2018-08-29 [NBD] +OpenBSD 6.4 2018-10-18 [OBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Sat Oct 20 20:41:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C94C3FF50D7; Sat, 20 Oct 2018 20:41:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F18E86FF6; Sat, 20 Oct 2018 20:41:26 +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 611FA232AB; Sat, 20 Oct 2018 20:41:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KKfQ2f009022; Sat, 20 Oct 2018 20:41:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKfQ07009021; Sat, 20 Oct 2018 20:41:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202041.w9KKfQ07009021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 20:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339485 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 339485 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:41:27 -0000 Author: cem Date: Sat Oct 20 20:41:25 2018 New Revision: 339485 URL: https://svnweb.freebsd.org/changeset/base/339485 Log: Add a dev_refthread.9 document. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential: https://reviews.freebsd.org/D16897 Added: head/share/man/man9/dev_refthread.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Oct 20 20:34:36 2018 (r339484) +++ head/share/man/man9/Makefile Sat Oct 20 20:41:25 2018 (r339485) @@ -113,6 +113,7 @@ MAN= accept_filter.9 \ device_set_flags.9 \ DEVICE_SHUTDOWN.9 \ DEV_MODULE.9 \ + dev_refthread.9 \ devstat.9 \ devtoname.9 \ disk.9 \ @@ -878,6 +879,8 @@ MLINKS+=DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \ DB_COMMAND.9 DB_SHOW_COMMAND.9 MLINKS+=DECLARE_MODULE.9 DECLARE_MODULE_TIED.9 MLINKS+=dev_clone.9 drain_dev_clone_events.9 +MLINKS+=dev_refthread.9 devvn_refthread.9 \ + dev_refthread.9 dev_relthread.9 MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \ devfs_set_cdevpriv.9 devfs_get_cdevpriv.9 MLINKS+=device_add_child.9 device_add_child_ordered.9 Added: head/share/man/man9/dev_refthread.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/dev_refthread.9 Sat Oct 20 20:41:25 2018 (r339485) @@ -0,0 +1,153 @@ +.\" Copyright (c) 2018 Conrad Meyer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 29, 2018 +.Dt DEV_REFTHREAD 9 +.Os +.Sh NAME +.Nm dev_refthread , +.Nm devvn_refthread , +.Nm dev_relthread +.Nd safely access device methods +.Sh SYNOPSIS +.In sys/param.h +.In sys/conf.h +.Ft "struct cdevsw *" +.Fn dev_refthread "struct cdev *dev" "int *ref" +.Ft "struct cdevsw *" +.Fn devvn_refthread "struct vnode *vp" "struct cdev **devp" "int *ref" +.Ft void +.Fn dev_relthread "struct cdev *dev" "int ref" +.Sh DESCRIPTION +The +.Fn dev_refthread +(or +.Fn devvn_refthread ) +and +.Fn dev_relthread +routines provide a safe way to access +.Xr devfs 5 +devices that may be concurrently destroyed by +.Fn destroy_dev +(e.g., removable media). +.Pp +If successful, +.Fn dev_refthread +and +.Fn devvn_refthread +acquire a "thread reference" to the associated +.Vt "struct cdev" +and return a non-NULL pointer to the cdev's +.Vt "struct cdevsw" +method table. +For the duration of that reference, the cdev's associated private data and +method table object are valid. +Destruction of the cdev sleeps until the thread reference is released. +.Pp +A reference cannot prevent media removal. +It is an implementation detail of individual drivers how method calls from +callers with +.Fn dev_refthread +references are handled when the device is +pending destruction. +A common behavior for disk devices is to return the +.Er ENXIO +status, but that is not required by this KPI. +.Pp +The +.Fn devvn_refthread +variant of +.Fn dev_refthread +extracts the +.Vt "struct cdev" +pointer out of the +.Dv VCHR +.Xr vnode 9 +automatically before performing the same actions as +.Fn dev_refthread . +Additionally, a pointer to the +.Vt "struct cdev" +is returned to the caller via +.Fa "*devp" . +.Fn devvn_refthread +correctly handles possible parallel reclamation of the vnode. +.Pp +.Fn dev_relthread +is used to release a reference to a +.Vt "struct cdev" . +.Fn dev_relthread +.Sy must +only be invoked when the associated invocation of +.Fn dev_refthread +or +.Fn devvn_refthread +returned a non-NULL +.Vt "struct cdevsw *" . +.Sh CONTEXT +.Vt struct cdev +objects have two reference counts, +.Va si_refcount +and +.Va si_threadcount . +The +.Fn dev_refthread , +.Fn devvn_refthread , +and +.Fn dev_relthread +functions manipulate the +.Va si_threadcount . +The +.Va si_threadcount +reference guarantees the liveness of the +.Vt struct cdev +object. +The other +.Va si_refcount +reference provides only the weaker guarantee that the memory backing the +.Vt struct cdev +has not been freed. +.Sh RETURN VALUES +If +.Fn dev_refthread +or +.Fn devvn_refthread +are unsuccessful, they return +.Dv NULL . +.Bf Em +If these routines are unsuccessful, they do not increment the +.Vt "struct cdev" +.Va si_threadcount +and do not initialize the value pointed to by the +.Fa "*ref" +parameter in any way. +.Ef +.Sh SEE ALSO +.Xr destroy_dev 9 , +.Xr devfs 5 +.Sh CAVEATS +Do not invoke +.Fn dev_relthread +unless the matching refthread routine succeeded! From owner-svn-src-head@freebsd.org Sat Oct 20 20:45:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F8F6FF52A5; Sat, 20 Oct 2018 20:45:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 250A087556; Sat, 20 Oct 2018 20:45:50 +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 1B5DA23309; Sat, 20 Oct 2018 20:45:50 +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 w9KKjnqF013590; Sat, 20 Oct 2018 20:45:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKjnMa013588; Sat, 20 Oct 2018 20:45:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202045.w9KKjnMa013588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 20:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339486 - in head: share/man/man4 sys/ddb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/ddb X-SVN-Commit-Revision: 339486 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:45:50 -0000 Author: cem Date: Sat Oct 20 20:45:49 2018 New Revision: 339486 URL: https://svnweb.freebsd.org/changeset/base/339486 Log: ddb: Enable 'thread
' Currently, the 'thread' command (to switch the debugger to another thread) only accepts decimal-encoded tids. Use the same parsing logic as 'show thread ' to accept hex-encoded thread pointers in addition to decimal-encoded tids. Document the 'thread' command in ddb.4 and expand the 'show thread' documentation to cover the tid usage. Reported by: bwidawsk Reviewed by: bwidawsk (earlier version), kib (earlier version), markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16962 Modified: head/share/man/man4/ddb.4 head/sys/ddb/db_command.c head/sys/ddb/db_thread.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sat Oct 20 20:41:25 2018 (r339485) +++ head/share/man/man4/ddb.4 Sat Oct 20 20:45:49 2018 (r339486) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2018 +.Dd September 21, 2018 .Dt DDB 4 .Os .Sh NAME @@ -1013,13 +1013,17 @@ For exact interpretation of output, visit header file. .\" .Pp -.It Ic show Cm thread Op Ar addr +.It Ic show Cm thread Op Ar addr | tid If no .Ar addr +or +.Ar tid is specified, show detailed information about current thread. -Otherwise, information about thread at -.Ar addr -is printed. +Otherwise, print information about the thread with ID +.Ar tid +or kernel address +.Ar addr . +(If the argument is a decimal number, it is assumed to be a tid.) .\" .Pp .It Ic show Cm threads @@ -1249,6 +1253,13 @@ rather than a traditional memory dump or minidump. reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. +.Pp +.It Ic thread Ar addr | tid +Switch the debugger to the thread with ID +.Ar tid , +if the argument is a decimal number, or address +.Ar addr , +otherwise. .El .Sh VARIABLES The debugger accesses registers and variables as Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Sat Oct 20 20:41:25 2018 (r339485) +++ head/sys/ddb/db_command.c Sat Oct 20 20:45:49 2018 (r339486) @@ -145,7 +145,7 @@ static struct command db_cmds[] = { { "reset", db_reset, 0, NULL }, { "kill", db_kill, CS_OWN, NULL }, { "watchdog", db_watchdog, CS_OWN, NULL }, - { "thread", db_set_thread, CS_OWN, NULL }, + { "thread", db_set_thread, 0, NULL }, { "run", db_run_cmd, CS_OWN, NULL }, { "script", db_script_cmd, CS_OWN, NULL }, { "scripts", db_scripts_cmd, 0, NULL }, Modified: head/sys/ddb/db_thread.c ============================================================================== --- head/sys/ddb/db_thread.c Sat Oct 20 20:41:25 2018 (r339485) +++ head/sys/ddb/db_thread.c Sat Oct 20 20:45:49 2018 (r339486) @@ -55,20 +55,10 @@ void db_set_thread(db_expr_t tid, bool hastid, db_expr_t cnt, char *mod) { struct thread *thr; - db_expr_t radix; int err; - /* - * We parse our own arguments. We don't like the default radix. - */ - radix = db_radix; - db_radix = 10; - hastid = db_expression(&tid); - db_radix = radix; - db_skip_to_eol(); - if (hastid) { - thr = kdb_thr_lookup(tid); + thr = db_lookup_thread(tid, false); if (thr != NULL) { err = kdb_thr_select(thr); if (err != 0) { From owner-svn-src-head@freebsd.org Sat Oct 20 20:49:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D78FF5495 for ; Sat, 20 Oct 2018 20:49:24 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE3A881BF for ; Sat, 20 Oct 2018 20:49:24 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-ed1-x534.google.com with SMTP id z21-v6so34400550edb.11 for ; Sat, 20 Oct 2018 13:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oEsPgl18xXbXNtPZW79hWJt128phxuoBO6Wh/QcHdq8=; b=qDzGTlUf6+tEaacLLjdxlP4c32Pxf1AWA/5NgxaRUdRE3Jg77tIHSevtlgfv/XZ+/h C3i0K9kc6rt0i9U5ofoHCewApXGMxSPCbRgya30mcl46eHOtm1R6+ax88YIbvq7W8YMl 80HjCK8Jqm+FoMCW3auPl5RgDUi5VQWbmoQPEqSZ5BJn3G5cRN7D15bCjYPDO2eFhhcA qzfN1FZJt6YBD7pd8NMRxvsqJQvJOGsT4YL9eXdMj5U5zKyGFB1XA9Wgf2Oq2/btaOsQ APDk4f4T+NuEpQRlz30Qe0juFJVD6MUWztN9Y2BiRCDL+6LgXue+M17qq0McsM2gP5bR b+5A== 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=oEsPgl18xXbXNtPZW79hWJt128phxuoBO6Wh/QcHdq8=; b=qin/6M9Y56xsb4mhX6stFxXetGif3l+kg3Dahsv3QGJEwsZGbWSlsfNmHN64D3nqAf P6ZPs04n1gNytlUGgjEXy6T3waleYuAC4O3/efuOdgIC6X1KoRBtAoO+cl5l+2HRL8P6 VXB51JvZzU40zOeZA786sa2XEOp3XNevHP0SlD/f2cXrz81yi0An4or9ZfM3fUNFGYiZ 01k1OGETZTEgHE0vFWHQylBy1NJDSe0GzPXC1OlOWeOOdOOTdpXTgKVBfFHJbkEe//Jv ggp3A7qjJo7E6UfJx15IU5aJi12v3YuOALH1GJHTkmkbK8R2l+Ys1Ewf+u+giQPv+3Tl QU7g== X-Gm-Message-State: ABuFfog8vw9BwxKimVezcFImZCQoCyo4UC5P5+4vs7xFfnSML3HW9HU1 BLCOrYC+LTH802KfUYS9YpPmSq/VuzWhggq2n7kgnA== X-Google-Smtp-Source: ACcGV63V1oLyzeZOByArQutMGawFHXY4wRp4tQ4jktbCq8tpPtPYIdRaGmNP/0HXy4RaTjVXJHeTyKJRAZ1oSbH/dYQ= X-Received: by 2002:a50:90a6:: with SMTP id c35-v6mr9808052eda.31.1540068563023; Sat, 20 Oct 2018 13:49:23 -0700 (PDT) MIME-Version: 1.0 References: <201810201831.w9KIVbtN043921@repo.freebsd.org> In-Reply-To: From: Ed Schouten Date: Sat, 20 Oct 2018 22:48:57 +0200 Message-ID: Subject: Re: svn commit: r339468 - in head/sys: kern sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Oct 2018 20:49:24 -0000 Op za 20 okt. 2018 om 21:59 schreef Conrad Meyer : > > Can kdb_active, tp == NULL and panicstr != NULL even occur in this > > case? tty_info() can only get called in non-degenerate cases, right? > > I think you are correct, but I did not want to investigate to confirm. > This was just the direct, conservative conversion of ttyprintf -> > putchar. The checks can *probably* be removed. If they can, then certain other parts of this change can be reverted as well (e.g., the addition of cnputsn). -- Ed Schouten From owner-svn-src-head@freebsd.org Sat Oct 20 20:49:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E86AFF54D2; Sat, 20 Oct 2018 20:49:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 050CF882AF; Sat, 20 Oct 2018 20:49:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41C323323; Sat, 20 Oct 2018 20:49:37 +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 w9KKnbfk013919; Sat, 20 Oct 2018 20:49:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKnbW9013918; Sat, 20 Oct 2018 20:49:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202049.w9KKnbW9013918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 20:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339487 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 339487 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:49:38 -0000 Author: cem Date: Sat Oct 20 20:49:37 2018 New Revision: 339487 URL: https://svnweb.freebsd.org/changeset/base/339487 Log: random(4): Translate a comment requirement into a compile-time invariant In various places, random represents the set of sources as a 32-bit word bitmask. It assumes all sources fit within this, i.e., the maximum valid source number is 31. There was a comment specifying this limitation, but we can actually refuse to compile if our assumption is violated instead. We still have a few spare random source slots, but sooner or later someone may need to convert the masks used from raw 32-bit words to bitset(9) APIs. This prevents some kinds of developer foot-shooting when adding new random sources. No functional change. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16982 Modified: head/sys/sys/random.h Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Sat Oct 20 20:45:49 2018 (r339486) +++ head/sys/sys/random.h Sat Oct 20 20:49:37 2018 (r339487) @@ -57,9 +57,6 @@ read_random(void *a __unused, u_int b __unused) * Note: if you add or remove members of random_entropy_source, remember to * also update the strings in the static array random_source_descr[] in * random_harvestq.c. - * - * NOTE: complain loudly to markm@ or on the lists if this enum gets more than 32 - * distinct values (0-31)! ENTROPYSOURCE may be == 32, but not > 32. */ enum random_entropy_source { RANDOM_START = 0, @@ -92,6 +89,8 @@ enum random_entropy_source { RANDOM_PURE_DARN, ENTROPYSOURCE }; +_Static_assert(ENTROPYSOURCE <= 32, + "hardcoded assumption that values fit in a typical word-sized bitset"); #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) #define RANDOM_HARVEST_PURE_MASK (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START)) From owner-svn-src-head@freebsd.org Sat Oct 20 20:49:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFF02FF5516; Sat, 20 Oct 2018 20:49:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 559DA883D1; Sat, 20 Oct 2018 20:49:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ABE72332F; Sat, 20 Oct 2018 20:49:47 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KKnliJ013981; Sat, 20 Oct 2018 20:49:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKnkS7013977; Sat, 20 Oct 2018 20:49:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201810202049.w9KKnkS7013977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Oct 2018 20:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339488 - in head: contrib/dialog contrib/dialog/package contrib/dialog/package/debian contrib/dialog/package/freebsd contrib/dialog/po contrib/dialog/samples contrib/dialog/samples/cop... X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/dialog contrib/dialog/package contrib/dialog/package/debian contrib/dialog/package/freebsd contrib/dialog/po contrib/dialog/samples contrib/dialog/samples/copifuncs contrib/dialog/sam... X-SVN-Commit-Revision: 339488 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:49:48 -0000 Author: bapt Date: Sat Oct 20 20:49:46 2018 New Revision: 339488 URL: https://svnweb.freebsd.org/changeset/base/339488 Log: Update libdialog to 1.3-20180621 Added: head/contrib/dialog/demo.pl - copied unchanged from r339484, vendor/dialog/dist/demo.pl head/contrib/dialog/headers.sh - copied unchanged from r339484, vendor/dialog/dist/headers.sh head/contrib/dialog/package/debian/postinst - copied unchanged from r339484, vendor/dialog/dist/package/debian/postinst head/contrib/dialog/package/dialog.map - copied unchanged from r339484, vendor/dialog/dist/package/dialog.map head/contrib/dialog/package/dialog.sym - copied unchanged from r339484, vendor/dialog/dist/package/dialog.sym head/contrib/dialog/po/fur.po - copied unchanged from r339484, vendor/dialog/dist/po/fur.po head/contrib/dialog/po/gd.po - copied unchanged from r339484, vendor/dialog/dist/po/gd.po head/contrib/dialog/samples/copifuncs/ - copied from r339484, vendor/dialog/dist/samples/copifuncs/ head/contrib/dialog/samples/dselect - copied unchanged from r339484, vendor/dialog/dist/samples/dselect head/contrib/dialog/samples/install/ - copied from r339484, vendor/dialog/dist/samples/install/ head/contrib/dialog/samples/menubox11 - copied unchanged from r339484, vendor/dialog/dist/samples/menubox11 head/contrib/dialog/samples/run_test.sh - copied unchanged from r339484, vendor/dialog/dist/samples/run_test.sh head/contrib/dialog/ttysize.c - copied unchanged from r339484, vendor/dialog/dist/ttysize.c Modified: head/contrib/dialog/CHANGES head/contrib/dialog/VERSION head/contrib/dialog/aclocal.m4 head/contrib/dialog/argv.c head/contrib/dialog/arrows.c head/contrib/dialog/buildlist.c head/contrib/dialog/buttons.c head/contrib/dialog/calendar.c head/contrib/dialog/checklist.c head/contrib/dialog/config.guess head/contrib/dialog/config.sub head/contrib/dialog/configure head/contrib/dialog/configure.in head/contrib/dialog/dialog.1 head/contrib/dialog/dialog.3 head/contrib/dialog/dialog.c head/contrib/dialog/dialog.h head/contrib/dialog/dialog.pl head/contrib/dialog/dlg_keys.c head/contrib/dialog/dlg_keys.h head/contrib/dialog/editbox.c head/contrib/dialog/formbox.c head/contrib/dialog/fselect.c head/contrib/dialog/guage.c head/contrib/dialog/inputbox.c head/contrib/dialog/inputstr.c head/contrib/dialog/makefile.in head/contrib/dialog/menubox.c head/contrib/dialog/mixedform.c head/contrib/dialog/mixedgauge.c head/contrib/dialog/mouse.c head/contrib/dialog/mousewget.c head/contrib/dialog/msgbox.c head/contrib/dialog/package/debian/changelog head/contrib/dialog/package/debian/control head/contrib/dialog/package/debian/copyright head/contrib/dialog/package/debian/rules head/contrib/dialog/package/debian/watch head/contrib/dialog/package/dialog.spec head/contrib/dialog/package/freebsd/Makefile head/contrib/dialog/pause.c head/contrib/dialog/po/de.po head/contrib/dialog/po/dialog.pot head/contrib/dialog/po/es.po head/contrib/dialog/po/hr.po head/contrib/dialog/po/hu.po head/contrib/dialog/po/lv.po head/contrib/dialog/po/ro.po head/contrib/dialog/po/tr.po head/contrib/dialog/prgbox.c head/contrib/dialog/progressbox.c head/contrib/dialog/rangebox.c head/contrib/dialog/rc.c head/contrib/dialog/samples/programbox head/contrib/dialog/samples/programbox2 head/contrib/dialog/samples/progress head/contrib/dialog/samples/progress2 head/contrib/dialog/samples/setup-edit head/contrib/dialog/samples/setup-tempfile head/contrib/dialog/tailbox.c head/contrib/dialog/textbox.c head/contrib/dialog/timebox.c head/contrib/dialog/trace.c head/contrib/dialog/treeview.c head/contrib/dialog/ui_getc.c head/contrib/dialog/util.c head/contrib/dialog/yesno.c head/gnu/lib/libdialog/Makefile head/gnu/lib/libdialog/dlg_config.h head/gnu/usr.bin/dialog/Makefile Directory Properties: head/contrib/dialog/ (props changed) Modified: head/contrib/dialog/CHANGES ============================================================================== --- head/contrib/dialog/CHANGES Sat Oct 20 20:49:37 2018 (r339487) +++ head/contrib/dialog/CHANGES Sat Oct 20 20:49:46 2018 (r339488) @@ -1,9 +1,328 @@ --- $Id: CHANGES,v 1.476 2013/09/24 00:06:47 tom Exp $ +-- $Id: CHANGES,v 1.619 2018/06/21 09:19:45 tom Exp $ -- Thomas E. Dickey This version of dialog was originally from a Debian snapshot. I've done this to it: +2018/06/21 + + improve file-offset computation in textbox.c (Werner Fink). + + fix an overlooked case with real_auto_size() to maximize when + height or width is given as -1. + + build-fixes for configure options "--disable-Xdialog2" and + "--disable-form" + + add traces for each widget to show its parameters. + + modify color scheme for mixedgauge to use the dialog window colors, + like the captions. + + fix a too-small malloc in the mixedgauge widget. + + fix a use-after-free in dlg_remove_callback(). + + improve handling of SIGWINCH for several widgets (Debian #865840). + + menubox, the point of the Debian report was that it would be nice + to increase the window size if the terminal size increases. Did + that as a special case less problematic than decreasing the + terminal size. Added samples/menubox11 to demonstrate by + comparison with menubox10 a problem with debconf which puts extra + newlines in the caption that interfere with autowrap. + + progressbox and derived prgbox, programbox, now handle resizing. + + yesno, window was cleared + + add dlg_ttysize() to support new options, allowing scripts to obtain + some text-formatting details without initializing the terminal. + + add options --print-text-only, and --print-text-size for scripts that + adjust the widget size according to how the captions are formatted. + + improve dialog.pl: + + add demo.pl, to demonstrate the functions + + quote/escape string parameters passed to dialog. + + ensure all "integer" parameters are really integers. + + use actual screensize for list captions rather than assuming 24 + lines. + + when trimming blanks, treat unconverted tabs the same as spaces. + + correct parameter to test when trimming blanks from the script, + e.g., with "--trim" (report by Jarno Suni). + + improve documentation of the various whitespace-filtering options, + to show which take precedence (Debian #867536, cf: Debian #102942). + + modify msgbox.c, yesno.c to bind SCROLLKEY_BINDINGS before + TRAVERSE_BINDINGS so that up/down arrow will by default scroll the + message up/down rather than be aliases for tab-traversal (report by + Fredrik Kers). + + modify dump_one_binding() to show when a binding is overridden. + + improve format of trace-file, making comment-syntax consistent, + as well as showing argv-splitting as a series of comments. + + modify dlg_string_to_argv() to change the quoting behavior to be + more consistent with shell behavior (patch by Denilson Sa Maia). + + modify dlg_getc() to return ESC when a timeout expires, notifying + callers that a quit occurred rather than exiting the application + (suggested by Rodrigo Freitas). + + modify handle_inputs() to ensure cursor-visibility is restored when + there is no input character available (report by Guillaume Vareille). + + improve comment in manual page regarding which widgets can use the + "--help-button" (prompted by discussion with Csanyi Pal). + + add a check for valid object pointer in tailbox's main loop since + the getc-callback may have been freed within ui_getc.c (report by + "David"). + + improved configure macros for ncurses: CF_GNU_SOURCE, CF_SHARED_OPTS, + CF_CURSES_LIBS, CF_CURSES_FUNCS, CF_NCURSES_CONFIG + + improved configure script checks for groff vs man2html: + CF_PROG_GROFF and CF_WITH_MAN2HTML + + build-fix from lynx for AM_WITH_NLS configure macro + + update config.guess, config.sub + +2017/12/09 + + update ftp url in test-packages. + + modify test-packages to use recommended compiler/linker flags. + + improved configure macros AM_WITH_NLS, CF_CC_ENV_FLAGS, + CF_CURSES_LIBS, CF_NCURSES_CONFIG, CF_SHARED_OPTS, CF_WITH_LIBTOOL, + CF__INTL_BODY. + + update config.guess, config.sub + +2017/05/09 + + improved configure macros CF_ADD_CFLAGS, CF_CC_ENV_FLAGS, and + CF_SHARED_OPTS. + + updated hu.po and tr.po from + http://translationproject.org/latest/dialog/ + + update config.guess, config.sub + +2017/01/31 + + use DLG_TRACE macro consistently to make "--disable-trace" configure + option work. + + modify buildlist widget to support option "--reorder" for to allow + user to reorder the data based on the sequence of selections + (discussion with Paraic O'Ceallaigh). + + fill background color on unused parts of buildlist. + + fix a minor error in buildlist which let pageup switch columns. + + change several calls to dlg_trace_msg to prefix with "#" to make + the trace logs more consistent for parsing. + + add samples/run_test.sh + + further improve performance with very long command-lines by changes + to howmany_tags(). + + modify dlg_string_to_argv() to convert escaped double-quotes to + plain double-quotes when within a double-quoted string. + + modify makefile to apply CFLAGS to linking + + modify dlg_string_to_argv() to ignore escaped newlines except when + quoted, fixing a problem with samples/checklist9. + + interpret $DIALOGOPTS before expanding "--file", etc., to allow + the environment variable to turn on tracing in that process. + + improve performance when processing very long command lines, e.g., + using "--file" by changing dialog_opts[] to an array of pointers to + the expanded argv[] (discussion with Lars Tauber). + + modified autoconf macros + + CF_CC_ENV_FLAGS amend the last change to move only the + preprocessor, optimization and warning flags to CPPFLAGS and + CFLAGS, leaving the residue in CC. That happens to work for gcc's + various "model" options, but may require tuning for other compilers + + CF_LARGEFILE workaround for clang exit-code vs warnings + + CF_MATH_LIB quiet strict gcc warning + + CF_WITH_LIBTOOL fix a few places in configure/build scripts where + DESTDIR and rpath were combined + + CF_XOPEN_SOURCE add "uclinux" to list of Linux's + + update config.guess, config.sub + +2016/11/20 + + added fur.po (Friulian) from + http://translationproject.org/latest/dialog/ + +2016/08/28 + + improve parsing and trace for "bindkey", to convert space to/from + "\s", as well as handle octal escapes for single byte characters. + + change explicit checks for space character used for select or toggle + to make this rebindable to "TOGGLE" (prompted by discussion with + Paul van Tilburg). + + add default bindings for cursor left/right to formbox. The cursor + left/right cases were replaced with rebindable symbols in 2005/12/07 + without providing these keys as default values (report/patch by + Miroslav Lichvar). + + modified autoconf macros + + CF_PROG_LINT add cpplint to programs to use; drop ad hoc tdlint and + alint. + + CF_CC_ENV_FLAGS don't limit the check to -I, -U and -D options, + since the added options can include various compiler options before + and after preprocessor options. + + CF_GNU_SOURCE recent glibc (Debian 2.23-4 for example) has + misordered ifdef/checks for new symbol _DEFAULT_SOURCE, producing + warning messages when only _GNU_SOURCE is defined. Add a followup + check to define _DEFAULT_SOURCE. + + CF_XOPEN_SOURCE use _GNU_SOURCE for cygwin headers, tested with + cygwin 2.3, 2.5 (patch by Corinna Vinschen). + + mention --no-collapse option in manual page description of + --tab-correct option. + + update config.guess, config.sub + +2016/04/24 + + fix a special case in drawing shadow on a line-drawing cell where the + alternate-character set flag was lost (report by Martin Kravec). + + fix a regression from 2015/05/13 changes for escaping; it is + necessary to retain backslashes within quotes to make "\Z" escapes + work (report by Marcin Krol). + + fix test package for RPMs; changes in 2015 omitted symbolic links + for the library. + + fix typo in help message for "--buildlist" (report by Rihards Olups). + + modified autoconf macros + + CF_PROG_AR, CF_AR_FLAGS added to improve check for archive tool. + + CF_LD_RPATH_OPT, change FreeBSD to use -Wl,-rpath rather than + -rpath option. According to FreeBSD #178732, either works since + FreeBSD 4.x; however scons does not accept anything except the + -Wl,-rpath form. + + CF_WITH_NCURSES_ETC, change from ncurses to check for pthreads + dependency. + +2016/02/09 + + modify editbox widget to add a trailing newline if the text has none + to ensure the last line is not ignored (report by Florent Rougon). + + change mouse initialization to look for button-presses rather than + button-clicks, for better response. + + modify dump_curses_key() to show mouse-coding in readable form. + + correct mapping of mouse-clicks on the day-grid in calendar widget + when "--week-start" is used to set the start of the week (report by + Stefan Vogtner). + > integrated changes from Stefan Vogtner: + + use Gregorian algorithm for leap year + + use mktime if available; calendar was written just as it became + standard. + +2016/01/26 - release 1.3 + + correct --infobox documentation, which said it shows an OK button. + + fix a couple of place in test-scripts which referred to $SIG_TRAP + rather than $SIG_QUIT + + reorganize dialog.3, to use subsections for generating navigation + pane, using man2html + + add "--week-start" option for calendar widget (prompted by discussion + with Stefan Vogtner). + + add a limit-check in editbox.c to ensure that mouse-clicks outside + the filled-in text area do not access past the end of the array + (report by Stefan Vogtner). + + update configure macros from ncurses changes. + + update config.guess, config.sub + +2015/09/20 + + decrease table value for minimum number of arguments for the widgets + which use --no-items option (report by Raven Singularity). + + update configure macros: + + use $SHELL consistently, deprecate non-POSIX shell + + PKG_CONFIG may simply be unset - fix + + add option to allow changing ABI version, from ncurses6. + +2015/05/28 + + fixes for two autoconf macros, CF_ADD_INCDIR and CF_NCURSES_CONFIG + from work on ncurses. + + build-fix for NetBSD curses (patch by Matthias Scheler). + +2015/05/13 + + add configure option --with-install-prefix, like ncurses. + + add --with-screen and related configure options from ncurses-examples + to allow building with ncurses6 test-packages. + + update configure macros for improved coding style from lynx changes. + + updated ro.po from + http://translationproject.org/latest/dialog/ + + update config.guess, config.sub + > patches by Florent Rougon: + + fix two bugs in the "--file" option. + + When the number of arguments read from the included file is 0, the + code used to just skip over '--file' and its argument instead of + removing them from the argument list, causing "Error: Unknown + option --file" later on. + + In the alternative case (at least one argument read from the file), + the previous code used to do '--j;' in order to "force rescan" of + the inserted arguments. However, control then flowed to outer + blocks where a '++j;' counteracted this measure, causing "Error: + Unknown option --msgbox" (for instance) later on. + + modify escaping in argv.c to be more uniform, whether or not the + backslash is found within a parameter. + +2015/02/25 + + modify gauge widget to keep from erasing a second gauge widget, e.g., + via the "--and-widget" option. This is a cosmetic change to match + behavior of dialog 1.0 (report by Jason Orendorf). + + add configure option "--with-man2html" + + add configure options for versioned symbols, from ongoing work on + ncurses. + + update configure macros, e.g., for shared libraries + +2015/01/25 + + suppress highlighting of character which denotes an abbreviation or + shortcut for the OK/Cancel and other buttons for these widgets, which + use abbreviations for the list shown on the screen: buildlist, + checklist/radiobox, menubox, treeview (Debian #775295). + + add grid up/left and down/right bindings in editbox.c as synonyms for + field prev and next, respectively when handling the OK/Cancel buttons + (Debian #775294). + +2014/09/11 + + correct malloc-size for change to prgbox. + +2014/09/10 + + fixes to make "-c" option work when passing command to shell for the + prgbox widget, for example in samples/prgbox2 (report by Korantin + Auguste). + +2014/09/08 + + fix an out-of-bounds array index in buildlist widget (report by + Cade Foster). + +2014/09/01 + + add configure check for groff, needed for html/ps/pdf output. + + update configure-script macros: + + CF_ACVERSION_CHECK - work around another gratuitous incompatibility + introduced in 2.69 + + CF_ADD_CFLAGS - workaround for ash-shell, e.g., with Minix + + CF_ADD_LIBS - filter out duplicates + + CF_CURSES_FUNCS - improve workaround for weak-linkage, seems to fix + tests with NetBSD 6.1 + + CF_INTEL_COMPILER - clean up the -no-gcc option which was leftover + from testing. + + CF_LIB_SUFFIX - change suffix for AIX shared libraries to ".so". + + CF_MAKEFLAGS - workaround for GNU make 4.0 incompatibility with + previous releases. + + CF_XOPEN_SOURCE - add cases for Minix, UnixWare and improve the + workaround for Solaris. + + improve comparison in compare_cache() function, in case difference + between pointers does not fit in int's. + + updated de.po, es.po, hu.po, lv.po from + http://translationproject.org/latest/dialog/ + + update config.guess, config.sub + +2014/02/19 + + cleanup of manpages prompted by Gislason's comments. + + several changes to manpages to improve presentation (patches by + Bjarni I. Gislason, Debian #739180, Debian #739181) + + use "\/" when transitioning from italic to normal font + + correct an instance of "e.g,." + + use "\e" rather than "\\" to present a literal "\" + + improve formatting of table header + + remove some excess space-characters + + change a reference 0-9 to use "through" as the connector + + use "\&" to separate "." from a space to make the space shorter + + change a list's TP macro parameters to make the hanging text align + better with the adjacent paragraph + + add comma in a few places before "and" in a list + + separate units from numbers with a nonfillable space + + replace "-" with en-dash in a few places + + corrected argument indices after "--args" and "--file" to rescan the + argument list after removing/substituting those options. + + fix loops for "--file" option to handle cases with zero or no tokens at + all substituted (Redhat #1066168). + + add gd.po from + http://translationproject.org/latest/dialog/ + +2014/01/12 + + improve calculation for amount to scroll in programbox when an "Ok" + button might obscure part of the data (report by Florent Rougon). + + modify program to permit --separate-output to be used with buildlist + and treeview widgets (report by Florent Rougon). + + add list-height parameter to manpage description of --buildlist + (report by Florent Rougon). + + minor fixes to dialog.1 manpage; the reported problem was actually + fixed in 20120703 (Debian #726233, patch by Bjarni Ingi Gislason). + + add a "Hello World" example to dialog.3 manpage (prompted by + discussions with Dustin Oprea, Kevin Ingwersen). + + correct comparison in dlg_lookup_key() so that using "bindkey" with + a "*" wildcard parameter works as documented (report by Stewart + Benedict). + + updated configure macros, fixes for clang and mingw. + + update config.guess, config.sub + +2013/09/28 + + fix a regression in gauge widget from 2013/09/28 changes; + dlg_reallocate_gauge() failed when no --title option was given + (report by Tritonas Insomnia). + 2013/09/23 + fix samples/inputbox6-utf8, which had depended unnecessarily on bash. + improve memory caching for wide-character manipulation in gauge @@ -434,7 +753,7 @@ to it: to display (Debian #579390). + add makefile rules for generating html, etc., documentation from nroff. - > patches by Samuel Martín Moro + > patches by Samuel Martin Moro + reset errors in tailbox before reading new character. + modify dlg_draw_scrollbar(), omitting hiding percentages in boxes when no arrows or scrollbar are needed. Modified: head/contrib/dialog/VERSION ============================================================================== --- head/contrib/dialog/VERSION Sat Oct 20 20:49:37 2018 (r339487) +++ head/contrib/dialog/VERSION Sat Oct 20 20:49:46 2018 (r339488) @@ -1 +1 @@ -11:1:0 1.2 20130923 +15:0:0 1.3 20180621 Modified: head/contrib/dialog/aclocal.m4 ============================================================================== --- head/contrib/dialog/aclocal.m4 Sat Oct 20 20:49:37 2018 (r339487) +++ head/contrib/dialog/aclocal.m4 Sat Oct 20 20:49:46 2018 (r339488) @@ -1,7 +1,7 @@ dnl macros used for DIALOG configure script -dnl $Id: aclocal.m4,v 1.94 2013/09/22 14:26:24 tom Exp $ +dnl $Id: aclocal.m4,v 1.120 2018/06/21 00:30:26 tom Exp $ dnl --------------------------------------------------------------------------- -dnl Copyright 1999-2012,2013 -- Thomas E. Dickey +dnl Copyright 1999-2017,2018 -- Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the @@ -31,7 +31,7 @@ dnl see dnl http://invisible-island.net/autoconf/ dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl AM_GNU_GETTEXT version: 13 updated: 2012/11/09 05:47:26 +dnl AM_GNU_GETTEXT version: 14 updated: 2015/04/15 19:08:48 dnl -------------- dnl Usage: Just like AM_WITH_NLS, which see. AC_DEFUN([AM_GNU_GETTEXT], @@ -73,7 +73,7 @@ strdup strtoul tsearch __argz_count __argz_stringify _ # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in - "$presentlang"*) useit=yes;; + ("$presentlang"*) useit=yes;; esac done if test $useit = yes; then @@ -167,7 +167,7 @@ size_t iconv(); AC_SUBST(LIBICONV) ])dnl dnl --------------------------------------------------------------------------- -dnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42 +dnl AM_LANGINFO_CODESET version: 4 updated: 2015/04/18 08:56:57 dnl ------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -178,19 +178,19 @@ dnl dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ - AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], - am_cv_langinfo_codeset=yes, - am_cv_langinfo_codeset=no) - ]) - if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE(HAVE_LANGINFO_CODESET, 1, - [Define if you have and nl_langinfo(CODESET).]) - fi +AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi ])dnl dnl --------------------------------------------------------------------------- -dnl AM_LC_MESSAGES version: 4 updated: 2002/10/27 23:21:42 +dnl AM_LC_MESSAGES version: 5 updated: 2015/05/10 19:52:14 dnl -------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -211,17 +211,17 @@ dnl dnl serial 2 dnl AC_DEFUN([AM_LC_MESSAGES], - [if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your file defines LC_MESSAGES.]) - fi - fi])dnl +[if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi +fi])dnl dnl --------------------------------------------------------------------------- -dnl AM_PATH_PROG_WITH_TEST version: 8 updated: 2009/01/11 20:31:12 +dnl AM_PATH_PROG_WITH_TEST version: 9 updated: 2015/04/15 19:08:48 dnl ---------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -250,10 +250,10 @@ set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in - [[\\/]*|?:[\\/]]*) + ([[\\/]*|?:[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; - *) + (*) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. @@ -280,7 +280,7 @@ fi AC_SUBST($1)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl AM_WITH_NLS version: 25 updated: 2012/10/06 08:57:51 +dnl AM_WITH_NLS version: 29 updated: 2018/02/21 21:26:03 dnl ----------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal @@ -354,6 +354,8 @@ AC_DEFUN([AM_WITH_NLS], dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then + dnl We need to process the po/ directory. + POSUB=po AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) @@ -367,20 +369,49 @@ AC_DEFUN([AM_WITH_NLS], nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If GNU gettext is available we use this. Else we have + dnl to use. If GNU gettext is available we use this. Else we may have dnl to fall back to GNU NLS library. CATOBJEXT=NONE + dnl Save these (possibly-set) variables for reference. If the user + dnl overrode these to provide full pathnames, then warn if not actually + dnl GNU gettext, but do not override their values. Also, if they were + dnl overridden, suppress the part of the library test which prevents it + dnl from finding anything other than GNU gettext. Doing this also + dnl suppresses a bogus search for the intl library. + cf_save_msgfmt_path="$MSGFMT" + cf_save_xgettext_path="$XGETTEXT" + + dnl Search for GNU msgfmt in the PATH. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AC_SUBST(MSGFMT) + + dnl Search for GNU xgettext in the PATH. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + + cf_save_OPTS_1="$CPPFLAGS" + if test "x$cf_save_msgfmt_path" = "x$MSGFMT" && \ + test "x$cf_save_xgettext_path" = "x$XGETTEXT" ; then + CF_ADD_CFLAGS(-DIGNORE_MSGFMT_HACK) + fi + cf_save_LIBS_1="$LIBS" CF_ADD_LIBS($LIBICONV) - AC_CACHE_CHECK([for libintl.h and gettext()], cf_cv_func_gettext,[ - CF_FIND_LINKAGE(CF__INTL_HEAD, - CF__INTL_BODY, + + CF_FIND_LINKAGE(CF__INTL_HEAD, + CF__INTL_BODY($2), intl, cf_cv_func_gettext=yes, cf_cv_func_gettext=no) - ]) + + AC_MSG_CHECKING([for libintl.h and gettext()]) + AC_MSG_RESULT($cf_cv_func_gettext) + LIBS="$cf_save_LIBS_1" + CPPFLAGS="$cf_save_OPTS_1" if test "$cf_cv_func_gettext" = yes ; then AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have libintl.h]) @@ -408,160 +439,151 @@ AC_DEFUN([AM_WITH_NLS], AC_CHECK_FUNCS(dcgettext) LIBS="$gt_save_LIBS" - dnl Search for GNU msgfmt in the PATH. - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - - dnl Search for GNU xgettext in the PATH. - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) - CATOBJEXT=.gmo fi + elif test -z "$MSGFMT" || test -z "$XGETTEXT" ; then + AC_MSG_WARN(disabling NLS feature) + sed -e /ENABLE_NLS/d confdefs.h >confdefs.tmp + mv confdefs.tmp confdefs.h + ALL_LINGUAS= + CATOBJEXT=.ignored + MSGFMT=":" + GMSGFMT=":" + XGETTEXT=":" + POSUB= + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + USE_NLS=no + nls_cv_use_gnu_gettext=no fi if test "$CATOBJEXT" = "NONE"; then dnl GNU gettext is not found in the C library. dnl Fall back on GNU gettext library. - nls_cv_use_gnu_gettext=yes + nls_cv_use_gnu_gettext=maybe fi fi - if test "$nls_cv_use_gnu_gettext" = "yes"; then - if test ! -d $srcdir/intl ; then - AC_MSG_ERROR(no NLS library is packaged with this application) - fi - dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) - AC_SUBST(MSGFMT) - BUILD_INCLUDED_LIBINTL=yes - USE_INCLUDED_LIBINTL=yes + if test "$nls_cv_use_gnu_gettext" != "no"; then CATOBJEXT=.gmo - INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" - LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + if test -f $srcdir/intl/libintl.h ; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + elif test "$nls_cv_use_gnu_gettext" = "yes"; then + nls_cv_use_gnu_gettext=no + AC_MSG_WARN(no NLS library is packaged with this application) + fi fi - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then - dnl If it is no GNU msgfmt we define it as : so that the - dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then : ; else - AC_MSG_RESULT( - [found msgfmt program is not GNU msgfmt; ignore it]) - GMSGFMT=":" + AC_MSG_WARN([found msgfmt program is not GNU msgfmt]) fi fi - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then : ; else - AC_MSG_RESULT( - [found xgettext program is not GNU xgettext; ignore it]) - XGETTEXT=":" + AC_MSG_WARN([found xgettext program is not GNU xgettext]) fi fi - - dnl We need to process the po/ directory. - POSUB=po fi - AC_OUTPUT_COMMANDS( - [for ac_file in $CONFIG_FILES; do + if test "$XGETTEXT" != ":"; then + AC_OUTPUT_COMMANDS( + [for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + (*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac - # PO directories have a Makefile.in generated from Makefile.inn. - case "$ac_file" in */[Mm]akefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - ac_base=`basename $ac_file .in` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + # PO directories have a Makefile.in generated from Makefile.inn. + case "$ac_file" in + (*/[Mm]akefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + ac_base=`basename $ac_file .in` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + case "$ac_given_srcdir" in + (.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + (/*) top_srcdir="$ac_given_srcdir" ;; + (*) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base" + fi + ;; esac + done]) - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base" - sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base" - fi - ;; - esac - done]) + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi - dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL - dnl to 'yes' because some of the testsuite requires it. - if test "$PACKAGE" = gettext; then - BUILD_INCLUDED_LIBINTL=yes - fi - - dnl intl/plural.c is generated from intl/plural.y. It requires bison, - dnl because plural.y uses bison specific features. It requires at least - dnl bison-1.26 because earlier versions generate a plural.c that doesn't - dnl compile. - dnl bison is only needed for the maintainer (who touches plural.y). But in - dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put - dnl the rule in general Makefile. Now, some people carelessly touch the - dnl files or have a broken "make" program, hence the plural.c rule will - dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not - dnl present or too old. - if test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_CHECK_PROGS([INTLBISON], [bison]) - if test -z "$INTLBISON"; then - ac_verc_fail=yes - else - dnl Found it, now check the version. - AC_MSG_CHECKING([version of bison]) + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + if test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl - ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + ('') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + (1.2[6-9]*|1.[3-9][0-9]*|[2-9].*) changequote([,])dnl - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; - esac - AC_MSG_RESULT([$ac_prog_version]) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + (*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi fi - if test $ac_verc_fail = yes; then - INTLBISON=: - fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done fi - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) @@ -590,7 +612,7 @@ changequote([,])dnl AC_SUBST(GENCAT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl @@ -599,7 +621,7 @@ dnl $2 = code to use if AC_ACVERSION is at least as hi dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ -ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( @@ -616,7 +638,7 @@ define([CF_ACVERSION_COMPARE], [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 +dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -634,51 +656,51 @@ cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in -no) - case $cf_add_cflags in #(vi - -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi +(no) + case $cf_add_cflags in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in - -D*) + (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; esac case "$CPPFLAGS" in - *$cf_add_cflags) #(vi + (*$cf_add_cflags) ;; - *) #(vi - case $cf_add_cflags in #(vi - -D*) + (*) + case $cf_add_cflags in + (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + (*) + CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" +(yes) + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; @@ -687,24 +709,24 @@ done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) - CFLAGS="$CFLAGS $cf_new_cflags" + CF_APPEND_TEXT(CFLAGS,$cf_new_cflags) fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags) fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 +dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -735,7 +757,7 @@ if test -n "$1" ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir) AC_TRY_COMPILE([#include ], [printf("Hello")], [], @@ -755,6 +777,8 @@ if test -n "$1" ; then else break fi + else + break fi done done @@ -769,7 +793,7 @@ dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57 +dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57 dnl ------------- dnl Adds to the library-path dnl @@ -781,39 +805,70 @@ dnl AC_DEFUN([CF_ADD_LIBDIR], [ if test -n "$1" ; then - for cf_add_libdir in $1 - do - if test $cf_add_libdir = /usr/lib ; then - : - elif test -d $cf_add_libdir - then - cf_have_libdir=no - if test -n "$LDFLAGS$LIBS" ; then - # a loop is needed to ensure we can add subdirs of existing dirs - for cf_test_libdir in $LDFLAGS $LIBS ; do - if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then - cf_have_libdir=yes; break - fi - done - fi - if test "$cf_have_libdir" = no ; then - CF_VERBOSE(adding $cf_add_libdir to library-path) - ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" - fi - fi - done + for cf_add_libdir in $1 + do + if test $cf_add_libdir = /usr/lib ; then + : + elif test -d $cf_add_libdir + then + cf_have_libdir=no + if test -n "$LDFLAGS$LIBS" ; then + # a loop is needed to ensure we can add subdirs of existing dirs + for cf_test_libdir in $LDFLAGS $LIBS ; do + if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then + cf_have_libdir=yes; break + fi + done + fi + if test "$cf_have_libdir" = no ; then + CF_VERBOSE(adding $cf_add_libdir to library-path) + ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" + fi + fi + done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27 dnl ----------- -dnl Add one or more libraries, used to enforce consistency. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 20 20:51:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DD0FF564C; Sat, 20 Oct 2018 20:51:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4697588769; Sat, 20 Oct 2018 20:51:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4144E2335F; Sat, 20 Oct 2018 20:51:08 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KKp85Y014119; Sat, 20 Oct 2018 20:51:08 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKp5pp014106; Sat, 20 Oct 2018 20:51:05 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810202051.w9KKp5pp014106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sat, 20 Oct 2018 20:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339489 - in head: lib/libc/locale share/colldef share/ctypedef share/mk targets/pseudo/userland tools/tools/locale/tools usr.bin/localedef X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head: lib/libc/locale share/colldef share/ctypedef share/mk targets/pseudo/userland tools/tools/locale/tools usr.bin/localedef X-SVN-Commit-Revision: 339489 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:51:08 -0000 Author: yuripv Date: Sat Oct 20 20:51:05 2018 New Revision: 339489 URL: https://svnweb.freebsd.org/changeset/base/339489 Log: Add -b/-l options to localedef(1) to specify output endianness and use it appropriately when building share/ctypedef and share/colldef. This makes the resulting locale data in EL->EB (amd64->powerpc64) cross build and in the native EB build match. Revert the changes done to libc in r308170 as they are no longer needed. PR: 231965 Reviewed by: bapt, emaste, sbruno, 0mp Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17603 Deleted: head/lib/libc/locale/endian.h Modified: head/lib/libc/locale/collate.c head/lib/libc/locale/rune.c head/share/colldef/Makefile head/share/ctypedef/Makefile head/share/mk/bsd.endian.mk head/targets/pseudo/userland/Makefile.depend head/tools/tools/locale/tools/cldr2def.pl head/usr.bin/localedef/collate.c head/usr.bin/localedef/ctype.c head/usr.bin/localedef/localedef.1 head/usr.bin/localedef/localedef.c head/usr.bin/localedef/localedef.h Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Sat Oct 20 20:49:46 2018 (r339488) +++ head/lib/libc/locale/collate.c Sat Oct 20 20:51:05 2018 (r339489) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#include "endian.h" #include "collate.h" #include "setlocale.h" #include "ldpart.h" @@ -162,7 +161,7 @@ __collate_load_tables_l(const char *encoding, struct x if ((info->directive_count < 1) || (info->directive_count >= COLL_WEIGHTS_MAX) || - ((chains = BSWAP(info->chain_count)) < 0)) { + ((chains = info->chain_count) < 0)) { (void) munmap(map, sbuf.st_size); errno = EINVAL; return (_LDP_ERROR); @@ -170,9 +169,9 @@ __collate_load_tables_l(const char *encoding, struct x i = (sizeof (collate_char_t) * (UCHAR_MAX + 1)) + (sizeof (collate_chain_t) * chains) + - (sizeof (collate_large_t) * BSWAP(info->large_count)); + (sizeof (collate_large_t) * info->large_count); for (z = 0; z < info->directive_count; z++) { - i += sizeof (collate_subst_t) * BSWAP(info->subst_count[z]); + i += sizeof (collate_subst_t) * info->subst_count[z]; } if (i != (sbuf.st_size - (TMP - map))) { (void) munmap(map, sbuf.st_size); @@ -185,9 +184,9 @@ __collate_load_tables_l(const char *encoding, struct x TMP += sizeof (collate_char_t) * (UCHAR_MAX + 1); for (z = 0; z < info->directive_count; z++) { - if (BSWAP(info->subst_count[z]) > 0) { + if (info->subst_count[z] > 0) { table->subst_table[z] = (void *)TMP; - TMP += BSWAP(info->subst_count[z]) * sizeof (collate_subst_t); + TMP += info->subst_count[z] * sizeof (collate_subst_t); } else { table->subst_table[z] = NULL; } @@ -198,7 +197,7 @@ __collate_load_tables_l(const char *encoding, struct x TMP += chains * sizeof (collate_chain_t); } else table->chain_pri_table = NULL; - if (BSWAP(info->large_count) > 0) + if (info->large_count > 0) table->large_pri_table = (void *)TMP; else table->large_pri_table = NULL; @@ -211,7 +210,7 @@ static const int32_t * substsearch(struct xlocale_collate *table, const wchar_t key, int pass) { const collate_subst_t *p; - int n = BSWAP(table->info->subst_count[pass]); + int n = table->info->subst_count[pass]; if (n == 0) return (NULL); @@ -223,7 +222,7 @@ substsearch(struct xlocale_collate *table, const wchar return (NULL); p = table->subst_table[pass] + (key & ~COLLATE_SUBST_PRIORITY); - assert(BSWAP(p->key) == key); + assert(p->key == key); return (p->pri); } @@ -232,7 +231,7 @@ static collate_chain_t * chainsearch(struct xlocale_collate *table, const wchar_t *key, int *len) { int low = 0; - int high = BSWAP(table->info->chain_count) - 1; + int high = table->info->chain_count - 1; int next, compar, l; collate_chain_t *p; collate_chain_t *tab = table->chain_pri_table; @@ -243,7 +242,7 @@ chainsearch(struct xlocale_collate *table, const wchar while (low <= high) { next = (low + high) / 2; p = tab + next; - compar = *key - le16toh(*p->str); + compar = *key - *p->str; if (compar == 0) { l = wcsnlen(p->str, COLLATE_STR_LEN); compar = wcsncmp(key, p->str, l); @@ -264,7 +263,7 @@ static collate_large_t * largesearch(struct xlocale_collate *table, const wchar_t key) { int low = 0; - int high = BSWAP(table->info->large_count) - 1; + int high = table->info->large_count - 1; int next, compar; collate_large_t *p; collate_large_t *tab = table->large_pri_table; @@ -275,7 +274,7 @@ largesearch(struct xlocale_collate *table, const wchar while (low <= high) { next = (low + high) / 2; p = tab + next; - compar = key - BSWAP(p->val); + compar = key - p->val; if (compar == 0) return (p); if (compar > 0) @@ -340,15 +339,15 @@ _collate_lookup(struct xlocale_collate *table, const w * Character is a small (8-bit) character. * We just look these up directly for speed. */ - *pri = BSWAP(table->char_pri_table[*t].pri[which]); + *pri = table->char_pri_table[*t].pri[which]; - } else if ((BSWAP(table->info->large_count) > 0) && + } else if ((table->info->large_count > 0) && ((match = largesearch(table, *t)) != NULL)) { /* * Character was found in the extended table. */ - *pri = BSWAP(match->pri.pri[which]); + *pri = match->pri.pri[which]; } else { /* @@ -358,7 +357,7 @@ _collate_lookup(struct xlocale_collate *table, const w /* Mask off sign bit to prevent ordering confusion. */ *pri = (*t & COLLATE_MAX_PRIORITY); } else { - *pri = BSWAP(table->info->undef_pri[which]); + *pri = table->info->undef_pri[which]; } /* No substitutions for undefined characters! */ return; @@ -377,9 +376,9 @@ _collate_lookup(struct xlocale_collate *table, const w * code ensures this for us. */ if ((sptr = substsearch(table, *pri, which)) != NULL) { - if ((*pri = BSWAP(*sptr)) > 0) { + if ((*pri = *sptr) > 0) { sptr++; - *state = BSWAP(*sptr) ? sptr : NULL; + *state = *sptr ? sptr : NULL; } } @@ -521,7 +520,7 @@ static int xfrm(struct xlocale_collate *table, unsigned char *p, int pri, int pass) { /* we use unsigned to ensure zero fill on right shift */ - uint32_t val = BSWAP((uint32_t)table->info->pri_count[pass]); + uint32_t val = (uint32_t)table->info->pri_count[pass]; int nc = 0; while (val) { @@ -681,7 +680,7 @@ __collate_equiv_value(locale_t locale, const wchar_t * e = -1; if (*str <= UCHAR_MAX) e = table->char_pri_table[*str].pri[0]; - else if (BSWAP(table->info->large_count) > 0) { + else if (table->info->large_count > 0) { collate_large_t *match_large; match_large = largesearch(table, *str); if (match_large) @@ -691,7 +690,7 @@ __collate_equiv_value(locale_t locale, const wchar_t * return (1); return (e > 0 ? e : 0); } - if (BSWAP(table->info->chain_count) > 0) { + if (table->info->chain_count > 0) { wchar_t name[COLLATE_STR_LEN]; collate_chain_t *match_chain; int clen; Modified: head/lib/libc/locale/rune.c ============================================================================== --- head/lib/libc/locale/rune.c Sat Oct 20 20:49:46 2018 (r339488) +++ head/lib/libc/locale/rune.c Sat Oct 20 20:51:05 2018 (r339489) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#include "endian.h" #include "runefile.h" _RuneLocale * @@ -110,29 +109,29 @@ _Read_RuneMagi(const char *fname) } runetype_ext_ranges = (_FileRuneEntry *)variable; - variable = runetype_ext_ranges + BSWAP(frl->runetype_ext_nranges); + variable = runetype_ext_ranges + frl->runetype_ext_nranges; if (variable > lastp) { goto invalid; } maplower_ext_ranges = (_FileRuneEntry *)variable; - variable = maplower_ext_ranges + BSWAP(frl->maplower_ext_nranges); + variable = maplower_ext_ranges + frl->maplower_ext_nranges; if (variable > lastp) { goto invalid; } mapupper_ext_ranges = (_FileRuneEntry *)variable; - variable = mapupper_ext_ranges + BSWAP(frl->mapupper_ext_nranges); + variable = mapupper_ext_ranges + frl->mapupper_ext_nranges; if (variable > lastp) { goto invalid; } frr = runetype_ext_ranges; - for (x = 0; x < BSWAP(frl->runetype_ext_nranges); ++x) { + for (x = 0; x < frl->runetype_ext_nranges; ++x) { uint32_t *types; - if (BSWAP(frr[x].map) == 0) { - int len = BSWAP(frr[x].max) - BSWAP(frr[x].min) + 1; + if (frr[x].map == 0) { + int len = frr[x].max - frr[x].min + 1; types = variable; variable = types + len; runetype_ext_len += len; @@ -142,7 +141,7 @@ _Read_RuneMagi(const char *fname) } } - if ((char *)variable + BSWAP(frl->variable_len) > (char *)lastp) { + if ((char *)variable + frl->variable_len > (char *)lastp) { goto invalid; } @@ -150,10 +149,9 @@ _Read_RuneMagi(const char *fname) * Convert from disk format to host format. */ data = malloc(sizeof(_RuneLocale) + - (BSWAP(frl->runetype_ext_nranges) + BSWAP(frl->maplower_ext_nranges) + - BSWAP(frl->mapupper_ext_nranges)) * sizeof(_RuneEntry) + - runetype_ext_len * sizeof(*rr->__types) + - BSWAP(frl->variable_len)); + (frl->runetype_ext_nranges + frl->maplower_ext_nranges + + frl->mapupper_ext_nranges) * sizeof(_RuneEntry) + + runetype_ext_len * sizeof(*rr->__types) + frl->variable_len); if (data == NULL) { saverr = errno; munmap(fdata, sb.st_size); @@ -167,15 +165,15 @@ _Read_RuneMagi(const char *fname) memcpy(rl->__magic, _RUNE_MAGIC_1, sizeof(rl->__magic)); memcpy(rl->__encoding, frl->encoding, sizeof(rl->__encoding)); - rl->__variable_len = BSWAP(frl->variable_len); - rl->__runetype_ext.__nranges = BSWAP(frl->runetype_ext_nranges); - rl->__maplower_ext.__nranges = BSWAP(frl->maplower_ext_nranges); - rl->__mapupper_ext.__nranges = BSWAP(frl->mapupper_ext_nranges); + rl->__variable_len = frl->variable_len; + rl->__runetype_ext.__nranges = frl->runetype_ext_nranges; + rl->__maplower_ext.__nranges = frl->maplower_ext_nranges; + rl->__mapupper_ext.__nranges = frl->mapupper_ext_nranges; for (x = 0; x < _CACHED_RUNES; ++x) { - rl->__runetype[x] = BSWAP(frl->runetype[x]); - rl->__maplower[x] = BSWAP(frl->maplower[x]); - rl->__mapupper[x] = BSWAP(frl->mapupper[x]); + rl->__runetype[x] = frl->runetype[x]; + rl->__maplower[x] = frl->maplower[x]; + rl->__mapupper[x] = frl->mapupper[x]; } rl->__runetype_ext.__ranges = (_RuneEntry *)rl->__variable; @@ -190,15 +188,15 @@ _Read_RuneMagi(const char *fname) rl->__variable = rl->__mapupper_ext.__ranges + rl->__mapupper_ext.__nranges; - variable = mapupper_ext_ranges + BSWAP(frl->mapupper_ext_nranges); + variable = mapupper_ext_ranges + frl->mapupper_ext_nranges; frr = runetype_ext_ranges; rr = rl->__runetype_ext.__ranges; for (x = 0; x < rl->__runetype_ext.__nranges; ++x) { uint32_t *types; - rr[x].__min = BSWAP(frr[x].min); - rr[x].__max = BSWAP(frr[x].max); - rr[x].__map = BSWAP(frr[x].map); + rr[x].__min = frr[x].min; + rr[x].__max = frr[x].max; + rr[x].__map = frr[x].map; if (rr[x].__map == 0) { int len = rr[x].__max - rr[x].__min + 1; types = variable; @@ -214,17 +212,17 @@ _Read_RuneMagi(const char *fname) frr = maplower_ext_ranges; rr = rl->__maplower_ext.__ranges; for (x = 0; x < rl->__maplower_ext.__nranges; ++x) { - rr[x].__min = BSWAP(frr[x].min); - rr[x].__max = BSWAP(frr[x].max); - rr[x].__map = BSWAP(frr[x].map); + rr[x].__min = frr[x].min; + rr[x].__max = frr[x].max; + rr[x].__map = frr[x].map; } frr = mapupper_ext_ranges; rr = rl->__mapupper_ext.__ranges; for (x = 0; x < rl->__mapupper_ext.__nranges; ++x) { - rr[x].__min = BSWAP(frr[x].min); - rr[x].__max = BSWAP(frr[x].max); - rr[x].__map = BSWAP(frr[x].map); + rr[x].__min = frr[x].min; + rr[x].__max = frr[x].max; + rr[x].__map = frr[x].map; } memcpy(rl->__variable, variable, rl->__variable_len); Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Sat Oct 20 20:49:46 2018 (r339488) +++ head/share/colldef/Makefile Sat Oct 20 20:51:05 2018 (r339489) @@ -7,8 +7,10 @@ FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps +.include + .src.LC_COLLATE: - localedef -D -U -i ${.IMPSRC} \ + localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.IMPSRC} \ -f ${MAPLOC}/map.${.TARGET:T:R:E:C/@.*//} ${.OBJDIR}/${.IMPSRC:T:R} LOCALES+= af_ZA.UTF-8 @@ -223,7 +225,7 @@ FILESDIR_${f}.LC_COLLATE= ${LOCALEDIR}/${f} FILES+= $t.LC_COLLATE FILESDIR_$t.LC_COLLATE= ${LOCALEDIR}/$t $t.LC_COLLATE: ${.CURDIR}/$f.src - localedef -D -U -i ${.ALLSRC} \ + localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.ALLSRC} \ -f ${MAPLOC}/map.${.TARGET:T:R:E:C/@.*//} \ ${.OBJDIR}/${.TARGET:T:R} .endfor Modified: head/share/ctypedef/Makefile ============================================================================== --- head/share/ctypedef/Makefile Sat Oct 20 20:49:46 2018 (r339488) +++ head/share/ctypedef/Makefile Sat Oct 20 20:51:05 2018 (r339489) @@ -7,8 +7,10 @@ FILESNAME= LC_CTYPE .SUFFIXES: .src .LC_CTYPE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps +.include + .src.LC_CTYPE: - localedef -D -U -c -w ${MAPLOC}/widths.txt \ + localedef ${LOCALEDEF_ENDIAN} -D -U -c -w ${MAPLOC}/widths.txt \ -f ${MAPLOC}/map.${.IMPSRC:T:R:E} \ -i ${.IMPSRC} ${.OBJDIR}/${.IMPSRC:T:R} || true @@ -238,7 +240,7 @@ SYMPAIRS+= be_BY.CP1131.src ru_RU.KOI8-R.src .for s t in ${SYMPAIRS} ${t:S/src$/LC_CTYPE/}: $s - localedef -D -U -c -w ${MAPLOC}/widths.txt \ + localedef ${LOCALEDEF_ENDIAN} -D -U -c -w ${MAPLOC}/widths.txt \ -f ${MAPLOC}/map.${.TARGET:T:R:C/^.*\.//} \ -i ${.ALLSRC} ${.OBJDIR}/${.TARGET:T:R} || true .endfor Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Sat Oct 20 20:49:46 2018 (r339488) +++ head/share/mk/bsd.endian.mk Sat Oct 20 20:51:05 2018 (r339489) @@ -8,6 +8,7 @@ ${MACHINE_ARCH:Mmips*el*} != "" TARGET_ENDIANNESS= 1234 CAP_MKDB_ENDIAN= -l +LOCALEDEF_ENDIAN= -l .elif ${MACHINE_ARCH} == "powerpc" || \ ${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "powerpcspe" || \ @@ -16,4 +17,5 @@ CAP_MKDB_ENDIAN= -l ${MACHINE_ARCH:Mmips*} != "" TARGET_ENDIANNESS= 4321 CAP_MKDB_ENDIAN= -b +LOCALEDEF_ENDIAN= -b .endif Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Sat Oct 20 20:49:46 2018 (r339488) +++ head/targets/pseudo/userland/Makefile.depend Sat Oct 20 20:51:05 2018 (r339489) @@ -246,6 +246,7 @@ DIRDEPS+= \ usr.bin/lex/lib \ usr.bin/limits \ usr.bin/locale \ + usr.bin/localedef \ usr.bin/locate/bigram \ usr.bin/locate/code \ usr.bin/locate/locate \ Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sat Oct 20 20:49:46 2018 (r339488) +++ head/tools/tools/locale/tools/cldr2def.pl Sat Oct 20 20:51:05 2018 (r339489) @@ -857,7 +857,8 @@ sub make_makefile { my $SRCOUT4 = ""; my $MAPLOC; if ($TYPE eq "colldef") { - $SRCOUT = "localedef -D -U -i \${.IMPSRC} \\\n" . + $SRCOUT = "localedef \${LOCALEDEF_ENDIAN} -D -U " . + "-i \${.IMPSRC} \\\n" . "\t-f \${MAPLOC}/map.\${.TARGET:T:R:E:C/@.*//} " . "\${.OBJDIR}/\${.IMPSRC:T:R}"; $MAPLOC = "MAPLOC=\t\t\${.CURDIR}/../../tools/tools/" . @@ -868,14 +869,16 @@ sub make_makefile { "FILES+=\t\$t.LC_COLLATE\n" . "FILESDIR_\$t.LC_COLLATE=\t\${LOCALEDIR}/\$t\n" . "\$t.LC_COLLATE: \${.CURDIR}/\$f.src\n" . - "\tlocaledef -D -U -i \${.ALLSRC} \\\n" . + "\tlocaledef \${LOCALEDEF_ENDIAN} -D -U " . + "-i \${.ALLSRC} \\\n" . "\t\t-f \${MAPLOC}/map.\${.TARGET:T:R:E:C/@.*//} \\\n" . "\t\t\${.OBJDIR}/\${.TARGET:T:R}\n" . ".endfor\n\n"; $SRCOUT4 = "## LOCALES_MAPPED\n"; } elsif ($TYPE eq "ctypedef") { - $SRCOUT = "localedef -D -U -c -w \${MAPLOC}/widths.txt \\\n" . + $SRCOUT = "localedef \${LOCALEDEF_ENDIAN} -D -U -c " . + "-w \${MAPLOC}/widths.txt \\\n" . "\t-f \${MAPLOC}/map.\${.IMPSRC:T:R:E} " . "\\\n\t-i \${.IMPSRC} \${.OBJDIR}/\${.IMPSRC:T:R} " . " || true"; @@ -886,7 +889,8 @@ sub make_makefile { ".for s t in \${SYMPAIRS}\n" . "\${t:S/src\$/LC_CTYPE/}: " . "\$s\n" . - "\tlocaledef -D -U -c -w \${MAPLOC}/widths.txt \\\n" . + "\tlocaledef \${LOCALEDEF_ENDIAN} -D -U -c " . + "-w \${MAPLOC}/widths.txt \\\n" . "\t-f \${MAPLOC}/map.\${.TARGET:T:R:C/^.*\\.//} " . "\\\n\t-i \${.ALLSRC} \${.OBJDIR}/\${.TARGET:T:R} " . " || true\n" . @@ -907,6 +911,8 @@ LOCALEDIR= \${SHAREDIR}/locale FILESNAME= $FILESNAMES{$TYPE} .SUFFIXES: .src .${SRCOUT2} ${MAPLOC} +.include + .src.${SRCOUT2}: $SRCOUT Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Sat Oct 20 20:49:46 2018 (r339488) +++ head/usr.bin/localedef/collate.c Sat Oct 20 20:51:05 2018 (r339489) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. * Copyright 2015 John Marino * * This source code is derived from the illumos localedef command, and @@ -253,6 +253,9 @@ static int32_t pri_undefined[COLL_WEIGHTS_MAX]; static int32_t pri_ignore; static collate_info_t collinfo; +static int32_t subst_count[COLL_WEIGHTS_MAX]; +static int32_t chain_count; +static int32_t large_count; static collpri_t *prilist = NULL; static int numpri = 0; @@ -1080,7 +1083,7 @@ wsncpy(wchar_t *s1, const wchar_t *s2, size_t n) wchar_t *os1 = s1; n++; - while (--n > 0 && (*s1++ = *s2++) != 0) + while (--n > 0 && (*s1++ = htote(*s2++)) != 0) continue; if (n > 0) while (--n > 0) @@ -1165,13 +1168,13 @@ dump_collate(void) if (resolve_pri(pri_undefined[i]) == -1) { set_pri(pri_undefined[i], -1, RESOLVED); /* they collate at the end of everything else */ - collinfo.undef_pri[i] = COLLATE_MAX_PRIORITY; + collinfo.undef_pri[i] = htote(COLLATE_MAX_PRIORITY); } - collinfo.pri_count[i] = nweight[i]; + collinfo.pri_count[i] = htote(nweight[i]); } - collinfo.pri_count[NUM_WT] = max_wide(); - collinfo.undef_pri[NUM_WT] = COLLATE_MAX_PRIORITY; + collinfo.pri_count[NUM_WT] = htote(max_wide()); + collinfo.undef_pri[NUM_WT] = htote(COLLATE_MAX_PRIORITY); collinfo.directive[NUM_WT] = DIRECTIVE_UNDEFINED; /* @@ -1180,19 +1183,20 @@ dump_collate(void) for (i = 0; i <= UCHAR_MAX; i++) { if ((cc = get_collchar(i, 0)) != NULL) { for (j = 0; j < NUM_WT; j++) { - chars[i].pri[j] = get_weight(cc->ref[j], j); + chars[i].pri[j] = + htote(get_weight(cc->ref[j], j)); } } else { for (j = 0; j < NUM_WT; j++) { chars[i].pri[j] = - get_weight(pri_undefined[j], j); + htote(get_weight(pri_undefined[j], j)); } /* * Per POSIX, for undefined characters, we * also have to add a last item, which is the * character code. */ - chars[i].pri[NUM_WT] = i; + chars[i].pri[NUM_WT] = htote(i); } } @@ -1203,7 +1207,7 @@ dump_collate(void) collate_subst_t *st = NULL; subst_t *temp; RB_COUNT(temp, substs, &substs[i], n); - collinfo.subst_count[i] = n; + subst_count[i] = n; if ((st = calloc(n, sizeof(collate_subst_t))) == NULL) { fprintf(stderr, "out of memory"); return; @@ -1217,12 +1221,14 @@ dump_collate(void) if (st[n].key != (n | COLLATE_SUBST_PRIORITY)) { INTERR; } + st[n].key = htote(st[n].key); for (j = 0; sb->ref[j]; j++) { - st[n].pri[j] = get_weight(sb->ref[j], i); + st[n].pri[j] = htote(get_weight(sb->ref[j], + i)); } n++; } - if (n != collinfo.subst_count[i]) + if (n != subst_count[i]) INTERR; subst[i] = st; } @@ -1231,9 +1237,8 @@ dump_collate(void) /* * Chains, i.e. collating elements */ - RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, - collinfo.chain_count); - chain = calloc(collinfo.chain_count, sizeof(collate_chain_t)); + RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, chain_count); + chain = calloc(chain_count, sizeof(collate_chain_t)); if (chain == NULL) { fprintf(stderr, "out of memory"); return; @@ -1242,11 +1247,11 @@ dump_collate(void) RB_FOREACH(ce, elem_by_expand, &elem_by_expand) { (void) wsncpy(chain[n].str, ce->expand, COLLATE_STR_LEN); for (i = 0; i < NUM_WT; i++) { - chain[n].pri[i] = get_weight(ce->ref[i], i); + chain[n].pri[i] = htote(get_weight(ce->ref[i], i)); } n++; } - if (n != collinfo.chain_count) + if (n != chain_count) INTERR; /* @@ -1273,12 +1278,12 @@ dump_collate(void) /* if undefined, then all priorities are */ INTERR; } else { - large[i].pri.pri[j] = pri; + large[i].pri.pri[j] = htote(pri); } } if (!undef) { - large[i].val = cc->wc; - collinfo.large_count = i++; + large[i].val = htote(cc->wc); + large_count = i++; } } @@ -1288,6 +1293,11 @@ dump_collate(void) /* Time to write the entire data set out */ + for (i = 0; i < NUM_WT; i++) + collinfo.subst_count[i] = htote(subst_count[i]); + collinfo.chain_count = htote(chain_count); + collinfo.large_count = htote(large_count); + if ((wr_category(vers, COLLATE_STR_LEN, f) < 0) || (wr_category(&collinfo, sizeof (collinfo), f) < 0) || (wr_category(&chars, sizeof (chars), f) < 0)) { @@ -1295,16 +1305,16 @@ dump_collate(void) } for (i = 0; i < NUM_WT; i++) { - sz = sizeof (collate_subst_t) * collinfo.subst_count[i]; + sz = sizeof (collate_subst_t) * subst_count[i]; if (wr_category(subst[i], sz, f) < 0) { return; } } - sz = sizeof (collate_chain_t) * collinfo.chain_count; + sz = sizeof (collate_chain_t) * chain_count; if (wr_category(chain, sz, f) < 0) { return; } - sz = sizeof (collate_large_t) * collinfo.large_count; + sz = sizeof (collate_large_t) * large_count; if (wr_category(large, sz, f) < 0) { return; } Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Sat Oct 20 20:49:46 2018 (r339488) +++ head/usr.bin/localedef/ctype.c Sat Oct 20 20:51:05 2018 (r339489) @@ -1,5 +1,5 @@ /*- - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. * Copyright 2012 Garrett D'Amore All rights reserved. * Copyright 2015 John Marino * @@ -296,10 +296,16 @@ dump_ctype(void) _FileRuneEntry *lo = NULL; _FileRuneEntry *up = NULL; wchar_t wc; + uint32_t runetype_ext_nranges; + uint32_t maplower_ext_nranges; + uint32_t mapupper_ext_nranges; (void) memset(&rl, 0, sizeof (rl)); + runetype_ext_nranges = 0; last_ct = NULL; + maplower_ext_nranges = 0; last_lo = NULL; + mapupper_ext_nranges = 0; last_up = NULL; if ((f = open_category()) == NULL) @@ -312,8 +318,8 @@ dump_ctype(void) * Initialize the identity map. */ for (wc = 0; (unsigned)wc < _CACHED_RUNES; wc++) { - rl.maplower[wc] = wc; - rl.mapupper[wc] = wc; + rl.maplower[wc] = htote(wc); + rl.mapupper[wc] = htote(wc); } RB_FOREACH(ctn, ctypes, &ctypes) { @@ -399,39 +405,39 @@ dump_ctype(void) * upper/lower case, then we identity map it. */ if ((unsigned)wc < _CACHED_RUNES) { - rl.runetype[wc] = ctn->ctype; + rl.runetype[wc] = htote(ctn->ctype); if (ctn->tolower) - rl.maplower[wc] = ctn->tolower; + rl.maplower[wc] = htote(ctn->tolower); if (ctn->toupper) - rl.mapupper[wc] = ctn->toupper; + rl.mapupper[wc] = htote(ctn->toupper); continue; } if ((last_ct != NULL) && (last_ct->ctype == ctn->ctype) && (last_ct->wc + 1 == wc)) { - ct[rl.runetype_ext_nranges-1].max = wc; + ct[runetype_ext_nranges - 1].max = htote(wc); } else { - rl.runetype_ext_nranges++; - ct = realloc(ct, - sizeof (*ct) * rl.runetype_ext_nranges); - ct[rl.runetype_ext_nranges - 1].min = wc; - ct[rl.runetype_ext_nranges - 1].max = wc; - ct[rl.runetype_ext_nranges - 1].map = ctn->ctype; + runetype_ext_nranges++; + ct = realloc(ct, sizeof (*ct) * runetype_ext_nranges); + ct[runetype_ext_nranges - 1].min = htote(wc); + ct[runetype_ext_nranges - 1].max = htote(wc); + ct[runetype_ext_nranges - 1].map = + htote(ctn->ctype); } last_ct = ctn; if (ctn->tolower == 0) { last_lo = NULL; } else if ((last_lo != NULL) && (last_lo->tolower + 1 == ctn->tolower)) { - lo[rl.maplower_ext_nranges-1].max = wc; + lo[maplower_ext_nranges - 1].max = htote(wc); last_lo = ctn; } else { - rl.maplower_ext_nranges++; - lo = realloc(lo, - sizeof (*lo) * rl.maplower_ext_nranges); - lo[rl.maplower_ext_nranges - 1].min = wc; - lo[rl.maplower_ext_nranges - 1].max = wc; - lo[rl.maplower_ext_nranges - 1].map = ctn->tolower; + maplower_ext_nranges++; + lo = realloc(lo, sizeof (*lo) * maplower_ext_nranges); + lo[maplower_ext_nranges - 1].min = htote(wc); + lo[maplower_ext_nranges - 1].max = htote(wc); + lo[maplower_ext_nranges - 1].map = + htote(ctn->tolower); last_lo = ctn; } @@ -439,23 +445,26 @@ dump_ctype(void) last_up = NULL; } else if ((last_up != NULL) && (last_up->toupper + 1 == ctn->toupper)) { - up[rl.mapupper_ext_nranges-1].max = wc; + up[mapupper_ext_nranges-1].max = htote(wc); last_up = ctn; } else { - rl.mapupper_ext_nranges++; - up = realloc(up, - sizeof (*up) * rl.mapupper_ext_nranges); - up[rl.mapupper_ext_nranges - 1].min = wc; - up[rl.mapupper_ext_nranges - 1].max = wc; - up[rl.mapupper_ext_nranges - 1].map = ctn->toupper; + mapupper_ext_nranges++; + up = realloc(up, sizeof (*up) * mapupper_ext_nranges); + up[mapupper_ext_nranges - 1].min = htote(wc); + up[mapupper_ext_nranges - 1].max = htote(wc); + up[mapupper_ext_nranges - 1].map = + htote(ctn->toupper); last_up = ctn; } } + rl.runetype_ext_nranges = htote(runetype_ext_nranges); + rl.maplower_ext_nranges = htote(maplower_ext_nranges); + rl.mapupper_ext_nranges = htote(mapupper_ext_nranges); if ((wr_category(&rl, sizeof (rl), f) < 0) || - (wr_category(ct, sizeof (*ct) * rl.runetype_ext_nranges, f) < 0) || - (wr_category(lo, sizeof (*lo) * rl.maplower_ext_nranges, f) < 0) || - (wr_category(up, sizeof (*up) * rl.mapupper_ext_nranges, f) < 0)) { + (wr_category(ct, sizeof (*ct) * runetype_ext_nranges, f) < 0) || + (wr_category(lo, sizeof (*lo) * maplower_ext_nranges, f) < 0) || + (wr_category(up, sizeof (*up) * mapupper_ext_nranges, f) < 0)) { return; } Modified: head/usr.bin/localedef/localedef.1 ============================================================================== --- head/usr.bin/localedef/localedef.1 Sat Oct 20 20:49:46 2018 (r339488) +++ head/usr.bin/localedef/localedef.1 Sat Oct 20 20:51:05 2018 (r339489) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2015 +.Dd October 18, 2018 .Dt LOCALEDEF 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Nd define locale environment .Sh SYNOPSIS .Nm -.Op Fl cDUv +.Op Fl bcDlUv .Op Fl f Ar charmap .Op Fl i Ar sourcefile .Op Fl u Ar codeset @@ -84,6 +84,8 @@ Defines the format and values of affirmative and negat .Pp The following options are supported: .Bl -tag -width indent +.It Fl b +Use big-endian byte order for output. .It Fl c Creates permanent output even if warning messages have been issued. .It Fl D @@ -112,6 +114,8 @@ option is not present, the default character mapping w The path name of a file containing the source definitions. If this option is not present, source definitions will be read from standard input. +.It Fl l +Use little-endian byte order for output. .It Fl u Ar codeset Specifies the name of a codeset used as the target mapping of character symbols and collating element symbols whose encoding values are defined in terms of the Modified: head/usr.bin/localedef/localedef.c ============================================================================== --- head/usr.bin/localedef/localedef.c Sat Oct 20 20:49:46 2018 (r339488) +++ head/usr.bin/localedef/localedef.c Sat Oct 20 20:51:05 2018 (r339489) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. * Copyright 2015 John Marino * * This source code is derived from the illumos localedef command, and @@ -34,11 +34,13 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + #include #include #include -#include -#include #include #include #include @@ -54,6 +56,7 @@ __FBSDID("$FreeBSD$"); #endif static int bsd = 0; +static int byteorder = 0; int verbose = 0; int undefok = 0; int warnok = 0; @@ -221,6 +224,18 @@ wr_category(void *buf, size_t sz, FILE *f) return (0); } +uint32_t +htote(uint32_t arg) +{ + + if (byteorder == 4321) + return (htobe32(arg)); + else if (byteorder == 1234) + return (htole32(arg)); + else + return (arg); +} + int yyparse(void); static void @@ -229,7 +244,9 @@ usage(void) (void) fprintf(stderr, "Usage: localedef [options] localename\n"); (void) fprintf(stderr, "[options] are:\n"); (void) fprintf(stderr, " -D : BSD-style output\n"); + (void) fprintf(stderr, " -b : big-endian output\n"); (void) fprintf(stderr, " -c : ignore warnings\n"); + (void) fprintf(stderr, " -l : little-endian output\n"); (void) fprintf(stderr, " -v : verbose output\n"); (void) fprintf(stderr, " -U : ignore undefined symbols\n"); (void) fprintf(stderr, " -f charmap : use given charmap file\n"); @@ -260,10 +277,16 @@ main(int argc, char **argv) (void) setlocale(LC_ALL, ""); - while ((c = getopt(argc, argv, "w:i:cf:u:vUD")) != -1) { + while ((c = getopt(argc, argv, "blw:i:cf:u:vUD")) != -1) { switch (c) { case 'D': bsd = 1; + break; + case 'b': + case 'l': + if (byteorder != 0) + usage(); + byteorder = c == 'b' ? 4321 : 1234; break; case 'v': verbose++; Modified: head/usr.bin/localedef/localedef.h ============================================================================== --- head/usr.bin/localedef/localedef.h Sat Oct 20 20:49:46 2018 (r339488) +++ head/usr.bin/localedef/localedef.h Sat Oct 20 20:51:05 2018 (r339489) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Nexenta Systems, Inc. * Copyright 2015 John Marino * * This source code is derived from the illumos localedef command, and @@ -74,6 +74,8 @@ void scan_to_eol(void); void add_wcs(wchar_t); void add_tok(int); wchar_t *get_wcs(void); + +uint32_t htote(uint32_t); /* charmap.c - CHARMAP handling */ void init_charmap(void); From owner-svn-src-head@freebsd.org Sat Oct 20 20:53:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1BDFF58C0; Sat, 20 Oct 2018 20:53: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462E988A09; Sat, 20 Oct 2018 20:53: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 3B88F234EB; Sat, 20 Oct 2018 20:53: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 w9KKra1B019109; Sat, 20 Oct 2018 20:53:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KKrZgl019107; Sat, 20 Oct 2018 20:53:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810202053.w9KKrZgl019107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 20 Oct 2018 20:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339490 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 339490 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.29 Precedence: list List-Id: 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, 20 Oct 2018 20:53:36 -0000 Author: markj Date: Sat Oct 20 20:53:35 2018 New Revision: 339490 URL: https://svnweb.freebsd.org/changeset/base/339490 Log: Add an assertion to pmap_enter(). When modifying an existing managed mapping, we should find a PV entry for the old mapping. Verify this. Before r335784 this would have been implicitly tested by the fact that we always freed the PV entry for the old mapping. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17626 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Oct 20 20:51:05 2018 (r339489) +++ head/sys/amd64/amd64/pmap.c Sat Oct 20 20:53:35 2018 (r339490) @@ -5141,6 +5141,8 @@ retry: vm_page_aflag_set(om, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pv = pmap_pvh_remove(&om->md, pmap, va); + KASSERT(pv != NULL, + ("pmap_enter: no PV entry for %#lx", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Oct 20 20:51:05 2018 (r339489) +++ head/sys/i386/i386/pmap.c Sat Oct 20 20:53:35 2018 (r339490) @@ -3820,6 +3820,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if ((origpte & PG_A) != 0) vm_page_aflag_set(om, PGA_REFERENCED); pv = pmap_pvh_remove(&om->md, pmap, va); + KASSERT(pv != NULL, + ("pmap_enter: no PV entry for %#x", va)); if ((newpte & PG_MANAGED) == 0) free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && From owner-svn-src-head@freebsd.org Sat Oct 20 21:04:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C097FF5C8B; Sat, 20 Oct 2018 21:04:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE38388F5B; Sat, 20 Oct 2018 21:04:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id y22-v6so424130ioj.13; Sat, 20 Oct 2018 14:04:48 -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:reply-to :from:date:message-id:subject:to:cc; bh=elpSz7FNOfZDP5jwkLdvNDSjhCnpnNrSPs9V4iXRI0M=; b=ganIWs5/5WkyoE6qM+18dUrjYXkSORhulp8IuzlfV8HAk7R6cFSjX2rU4zTEwoj2ja 2KtAN7WbU15K0oUrYc+sJ2gJnc7/0xp3a0ZynoQRBXvO/rTsX9kQtFFGrHqbR6l1rh29 pXbGlQZmpIpwN6KSMBOrEfktZy4GLAR68bDIME1GZer1DgGekofnf48+NnwLqzXGKuXS 0CL0aVxVzW/jSHbyls+xHdMUVSeAV82/F1zBDcnGKEL0/CecmGNTVjebovtyw8gqZIca ZcyhnBaTMt2gUMNDpQY61uK8qvGCIhhsnDVWw8wSAnb+dBTOQ0VaFzGqymZlCq/DwLBL Ty1A== X-Gm-Message-State: AGRZ1gJOOgVgxJnLd9XBtGbe4CPbSkzhM0AgCYZ4WiwOXOMASt7juwS3 HPt31ZfNJL9ib9p/aIjpnshUVpTv X-Google-Smtp-Source: AJdET5fHd2lJfCaybl0DE1ihK6TDHd6LUw+SNG5kCRYTnAYB4IoiuDIqyBj4VrznFQ9xcbyBa5vdmQ== X-Received: by 2002:a6b:cb01:: with SMTP id b1-v6mr6063326iog.23.1540069481594; Sat, 20 Oct 2018 14:04:41 -0700 (PDT) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com. [209.85.166.169]) by smtp.gmail.com with ESMTPSA id j141-v6sm2962116ita.3.2018.10.20.14.04.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 14:04:41 -0700 (PDT) Received: by mail-it1-f169.google.com with SMTP id 134-v6so8030249itz.2; Sat, 20 Oct 2018 14:04:41 -0700 (PDT) X-Received: by 2002:a24:a00a:: with SMTP id o10-v6mr5992592ite.32.1540069481022; Sat, 20 Oct 2018 14:04:41 -0700 (PDT) MIME-Version: 1.0 References: <201810201831.w9KIVbtN043921@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 20 Oct 2018 14:04:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339468 - in head/sys: kern sys To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 20 Oct 2018 21:04:49 -0000 Yep! On Sat, Oct 20, 2018 at 1:49 PM Ed Schouten wrote: > > Op za 20 okt. 2018 om 21:59 schreef Conrad Meyer : > > > Can kdb_active, tp == NULL and panicstr != NULL even occur in this > > > case? tty_info() can only get called in non-degenerate cases, right? > > > > I think you are correct, but I did not want to investigate to confirm. > > This was just the direct, conservative conversion of ttyprintf -> > > putchar. The checks can *probably* be removed. > > If they can, then certain other parts of this change can be reverted > as well (e.g., the addition of cnputsn). > > -- > Ed Schouten From owner-svn-src-head@freebsd.org Sat Oct 20 21:06:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77DEFF5D30; Sat, 20 Oct 2018 21:06:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D05B890D8; Sat, 20 Oct 2018 21:06:16 +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 4265023686; Sat, 20 Oct 2018 21:06:16 +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 w9KL6GbN024115; Sat, 20 Oct 2018 21:06:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KL6GIo024114; Sat, 20 Oct 2018 21:06:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202106.w9KL6GIo024114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339491 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339491 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:06:16 -0000 Author: cem Date: Sat Oct 20 21:06:15 2018 New Revision: 339491 URL: https://svnweb.freebsd.org/changeset/base/339491 Log: random(4): Correct a bare zero to the appropriate enum The convention for updating hc_destination[] is to index with a random_entropy_source. Zero happens to match RANDOM_CACHED, which is correct for this source (early random data). Spell the zero value as the enum name instead of the magic constant. No functional change. Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16983 Modified: head/sys/dev/random/random_harvestq.c Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Sat Oct 20 20:53:35 2018 (r339490) +++ head/sys/dev/random/random_harvestq.c Sat Oct 20 21:06:15 2018 (r339491) @@ -414,7 +414,8 @@ random_harvestq_prime(void *unused __unused) event.he_somecounter = (uint32_t)get_cyclecount(); event.he_size = count; event.he_source = RANDOM_CACHED; - event.he_destination = harvest_context.hc_destination[0]++; + event.he_destination = + harvest_context.hc_destination[RANDOM_CACHED]++; memcpy(event.he_entropy, data + i, sizeof(event.he_entropy)); random_harvestq_fast_process_event(&event); explicit_bzero(&event, sizeof(event)); From owner-svn-src-head@freebsd.org Sat Oct 20 21:09:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B89FF5E5B; Sat, 20 Oct 2018 21:09:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C9C489292; Sat, 20 Oct 2018 21:09:13 +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 214F923694; Sat, 20 Oct 2018 21:09:13 +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 w9KL9DmD024272; Sat, 20 Oct 2018 21:09:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KL9CRp024271; Sat, 20 Oct 2018 21:09:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202109.w9KL9CRp024271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339492 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 339492 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:09:13 -0000 Author: cem Date: Sat Oct 20 21:09:12 2018 New Revision: 339492 URL: https://svnweb.freebsd.org/changeset/base/339492 Log: Fortuna: Fix a race to prevent reseed spamming If multiple threads enter fortuna_pre_read contemporaneously, such as via read(2) or getrandom(2), they could race to check how long it has been since the last update due to a TOCTOU problem with 'now'. Here is an example problematic execution: Thread A: Thread B: now_A = getsbinuptime(); now_B = getsbinuptime(); // now_B > now_A RANDOM_RESEED_LOCK(); if (now - fs_lasttime > SBT_1S/10) { fs_lasttime = now; ... // reseed } RANDOM_RESEED_UNLOCK(); RANDOM_RESEED_LOCK(); if (now_A - fs_lasttime > SBT_1S/10) // now_A - fs_lasttime underflows fs_lasttime = now_A; ... // reseed again, despite less than 100ms elapsing } RANDOM_RESEED_UNLOCK(); To resolve the race, simply check the current time after we win the lock race. If getsbinuptime is perceived to be expensive, another option might be to just accept the race and validate that fs_lasttime isn't "in the future." (It should be within the last ~2^31 seconds out of ~2^32 seconds representable duration.) Reviewed by: delphij, markm Approved by: secteam (delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16984 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Sat Oct 20 21:06:15 2018 (r339491) +++ head/sys/dev/random/fortuna.c Sat Oct 20 21:09:12 2018 (r339492) @@ -368,11 +368,11 @@ random_fortuna_pre_read(void) u_int i; KASSERT(fortuna_state.fs_minpoolsize > 0, ("random: Fortuna threshold must be > 0")); + RANDOM_RESEED_LOCK(); #ifdef _KERNEL /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ now = getsbinuptime(); #endif - RANDOM_RESEED_LOCK(); if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize #ifdef _KERNEL From owner-svn-src-head@freebsd.org Sat Oct 20 21:13:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80DDAFF6183; Sat, 20 Oct 2018 21:13: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F37389811; Sat, 20 Oct 2018 21:13: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 26FA023855; Sat, 20 Oct 2018 21:13: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 w9KLDwup029201; Sat, 20 Oct 2018 21:13:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KLDwiF029200; Sat, 20 Oct 2018 21:13:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201810202113.w9KLDwiF029200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 20 Oct 2018 21:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339493 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 339493 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:13:58 -0000 Author: imp Date: Sat Oct 20 21:13:57 2018 New Revision: 339493 URL: https://svnweb.freebsd.org/changeset/base/339493 Log: Fix typo The vendor name wds should have been wdc. Add wdc and keep the wds for script compat. MFC after: 3 days Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Sat Oct 20 21:09:12 2018 (r339492) +++ head/sbin/nvmecontrol/logpage.c Sat Oct 20 21:13:57 2018 (r339493) @@ -865,6 +865,8 @@ static struct logpage_function { print_log_firmware, sizeof(struct nvme_firmware_page)}, {HGST_INFO_LOG, "hgst", "Detailed Health/SMART", print_hgst_info_log, DEFAULT_SIZE}, + {HGST_INFO_LOG, "wdc", "Detailed Health/SMART", + print_hgst_info_log, DEFAULT_SIZE}, {HGST_INFO_LOG, "wds", "Detailed Health/SMART", print_hgst_info_log, DEFAULT_SIZE}, {INTEL_LOG_TEMP_STATS, "intel", "Temperature Stats", From owner-svn-src-head@freebsd.org Sat Oct 20 21:33:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC17AFF691B; Sat, 20 Oct 2018 21:33:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3A08A1F0; Sat, 20 Oct 2018 21:33:01 +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 156E923BC6; Sat, 20 Oct 2018 21:33:01 +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 w9KLX067039708; Sat, 20 Oct 2018 21:33:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KLX0fR039707; Sat, 20 Oct 2018 21:33:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202133.w9KLX0fR039707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339494 - head/sbin/mdmfs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/mdmfs X-SVN-Commit-Revision: 339494 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:33:03 -0000 Author: cem Date: Sat Oct 20 21:33:00 2018 New Revision: 339494 URL: https://svnweb.freebsd.org/changeset/base/339494 Log: mdmfs(8): Check for other types of helper-program failure Exiting with a signal should not be treated the same as successful exit with zero status. Return signal exit information to the callers via negative integers, to enable distinction from normal exit statuses. (All consumers that check for errors don't care what the exact non-zero exit value is -- in such a case they print a diagnostic message and either continue or bail.) Additionally, check for unexpected sources of waitpid() wakeup and bail if we encounter them. Reported by: lev@ Reviewed by: kib, lev, markj (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17035 Modified: head/sbin/mdmfs/mdmfs.c Modified: head/sbin/mdmfs/mdmfs.c ============================================================================== --- head/sbin/mdmfs/mdmfs.c Sat Oct 20 21:13:57 2018 (r339493) +++ head/sbin/mdmfs/mdmfs.c Sat Oct 20 21:33:00 2018 (r339494) @@ -90,6 +90,8 @@ static void do_mtptsetup(const char *, struct mtpt_in static void do_newfs(const char *); static void extract_ugid(const char *, struct mtpt_info *); static int run(int *, const char *, ...) __printflike(2, 3); +static const char *run_exitstr(int); +static int run_exitnumber(int); static void usage(void); int @@ -431,7 +433,8 @@ do_mdconfig_attach(const char *args, const enum md_typ rv = run(NULL, "%s -a %s%s -u %s%d", path_mdconfig, ta, args, mdname, unit); if (rv) - errx(1, "mdconfig (attach) exited with error code %d", rv); + errx(1, "mdconfig (attach) exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); } /* @@ -464,7 +467,8 @@ do_mdconfig_attach_au(const char *args, const enum md_ } rv = run(&fd, "%s -a %s%s", path_mdconfig, ta, args); if (rv) - errx(1, "mdconfig (attach) exited with error code %d", rv); + errx(1, "mdconfig (attach) exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); /* Receive the unit number. */ if (norun) { /* Since we didn't run, we can't read. Fake it. */ @@ -503,8 +507,8 @@ do_mdconfig_detach(void) rv = run(NULL, "%s -d -u %s%d", path_mdconfig, mdname, unit); if (rv && debug) /* This is allowed to fail. */ - warnx("mdconfig (detach) exited with error code %d (ignored)", - rv); + warnx("mdconfig (detach) exited %s %d (ignored)", + run_exitstr(rv), run_exitnumber(rv)); } /* @@ -518,7 +522,8 @@ do_mount_md(const char *args, const char *mtpoint) rv = run(NULL, "%s%s /dev/%s%d%s %s", _PATH_MOUNT, args, mdname, unit, mdsuffix, mtpoint); if (rv) - errx(1, "mount exited with error code %d", rv); + errx(1, "mount exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); } /* @@ -531,7 +536,8 @@ do_mount_tmpfs(const char *args, const char *mtpoint) rv = run(NULL, "%s -t tmpfs %s tmp %s", _PATH_MOUNT, args, mtpoint); if (rv) - errx(1, "tmpfs mount exited with error code %d", rv); + errx(1, "tmpfs mount exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); } /* @@ -603,7 +609,8 @@ do_newfs(const char *args) rv = run(NULL, "%s%s /dev/%s%d", _PATH_NEWFS, args, mdname, unit); if (rv) - errx(1, "newfs exited with error code %d", rv); + errx(1, "newfs exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); } /* @@ -674,8 +681,12 @@ extract_ugid(const char *str, struct mtpt_info *mip) * Run a process with command name and arguments pointed to by the * formatted string 'cmdline'. Since system(3) is not used, the first * space-delimited token of 'cmdline' must be the full pathname of the - * program to run. The return value is the return code of the process - * spawned. If 'ofd' is non-NULL, it is set to the standard output of + * program to run. + * + * The return value is the return code of the process spawned, or a negative + * signal number if the process exited due to an uncaught signal. + * + * If 'ofd' is non-NULL, it is set to the standard output of * the program spawned (i.e., you can read from ofd and get the output * of the program). */ @@ -771,7 +782,35 @@ run(int *ofd, const char *cmdline, ...) free(argv); while (waitpid(pid, &status, 0) != pid) ; - return (WEXITSTATUS(status)); + if (WIFEXITED(status)) + return (WEXITSTATUS(status)); + if (WIFSIGNALED(status)) + return (-WTERMSIG(status)); + err(1, "unexpected waitpid status: 0x%x", status); +} + +/* + * If run() returns non-zero, provide a string explaining why. + */ +static const char * +run_exitstr(int rv) +{ + if (rv > 0) + return ("with error code"); + if (rv < 0) + return ("with signal"); + return (NULL); +} + +/* + * If run returns non-zero, provide a relevant number. + */ +static int +run_exitnumber(int rv) +{ + if (rv < 0) + return (-rv); + return (rv); } static void From owner-svn-src-head@freebsd.org Sat Oct 20 21:33:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF96CFF6A1C; Sat, 20 Oct 2018 21:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9584F8A4C6; Sat, 20 Oct 2018 21:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9067A23BCE; Sat, 20 Oct 2018 21:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KLXZsd039774; Sat, 20 Oct 2018 21:33:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KLXZZC039773; Sat, 20 Oct 2018 21:33:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201810202133.w9KLXZZC039773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Oct 2018 21:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339495 - in head/gnu: lib/libdialog usr.bin/dialog X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/gnu: lib/libdialog usr.bin/dialog X-SVN-Commit-Revision: 339495 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:33:36 -0000 Author: bapt Date: Sat Oct 20 21:33:34 2018 New Revision: 339495 URL: https://svnweb.freebsd.org/changeset/base/339495 Log: Bring back the WARNS level to what it used to be to please gcc arches at least Modified: head/gnu/lib/libdialog/Makefile head/gnu/usr.bin/dialog/Makefile Modified: head/gnu/lib/libdialog/Makefile ============================================================================== --- head/gnu/lib/libdialog/Makefile Sat Oct 20 21:33:00 2018 (r339494) +++ head/gnu/lib/libdialog/Makefile Sat Oct 20 21:33:34 2018 (r339495) @@ -17,6 +17,6 @@ LIBADD= ncursesw m CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused .PATH: ${DIALOG} -WARNS?= 4 +WARNS?= 1 .include Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Sat Oct 20 21:33:00 2018 (r339494) +++ head/gnu/usr.bin/dialog/Makefile Sat Oct 20 21:33:34 2018 (r339495) @@ -7,4 +7,6 @@ LIBADD= dialog ncursesw m CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} +WARNS?= 6 + .include From owner-svn-src-head@freebsd.org Sat Oct 20 21:45:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04542FF7409; Sat, 20 Oct 2018 21:45:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AADF48B85B; Sat, 20 Oct 2018 21:45:17 +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 A5E2823DF6; Sat, 20 Oct 2018 21:45:17 +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 w9KLjHKc045449; Sat, 20 Oct 2018 21:45:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KLjHgH045448; Sat, 20 Oct 2018 21:45:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202145.w9KLjHgH045448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339496 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 339496 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:45:18 -0000 Author: cem Date: Sat Oct 20 21:45:17 2018 New Revision: 339496 URL: https://svnweb.freebsd.org/changeset/base/339496 Log: getentropy(3): Trap non-API errnos from getrandom(2) and abort Additionally, reconcile our abort behavior with arc4random(3). Unlike SIGABRT, SIGKILL cannot be caught by the user program. These failures are fatal conditions and should not return to the caller, as they did in the instance that resulted in D17049. While here, fix some minor typos in a comment. Reviewed by: delphij Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17050 Modified: head/lib/libc/gen/getentropy.c Modified: head/lib/libc/gen/getentropy.c ============================================================================== --- head/lib/libc/gen/getentropy.c Sat Oct 20 21:33:34 2018 (r339495) +++ head/lib/libc/gen/getentropy.c Sat Oct 20 21:45:17 2018 (r339496) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -44,6 +45,12 @@ __FBSDID("$FreeBSD$"); extern int __sysctl(int *, u_int, void *, size_t *, void *, size_t); +static inline void +_getentropy_fail(void) +{ + raise(SIGKILL); +} + static size_t arnd_sysctl(u_char *buf, size_t size) { @@ -87,14 +94,14 @@ getentropy_fallback(void *buf, size_t buflen) if (errno == EFAULT) return (-1); /* - * This cannot happen. _arc4_sysctl() spins until the random + * This cannot happen. arnd_sysctl() spins until the random * device is seeded and then repeatedly reads until the full * request is satisfied. The only way for this to return a zero * byte or short read is if sysctl(2) on the kern.arandom MIB - * fails. In this case, exceping the user-provided-a-bogus- + * fails. In this case, excepting the user-provided-a-bogus- * buffer EFAULT, give up (like for arc4random(3)'s arc4_stir). */ - abort(); + _getentropy_fail(); } return (0); } @@ -129,8 +136,10 @@ getentropy(void *buf, size_t buflen) continue; case EINTR: continue; - default: + case EFAULT: return (-1); + default: + _getentropy_fail(); } } } else { @@ -139,7 +148,7 @@ getentropy(void *buf, size_t buflen) /* This cannot happen. */ if (rd == 0) - abort(); + _getentropy_fail(); buf = (char *)buf + rd; buflen -= rd; From owner-svn-src-head@freebsd.org Sat Oct 20 21:49:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C45CFF756C; Sat, 20 Oct 2018 21:49:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32FE78BCA6; Sat, 20 Oct 2018 21:49:45 +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 282E723E00; Sat, 20 Oct 2018 21:49:45 +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 w9KLnjJJ045665; Sat, 20 Oct 2018 21:49:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KLnjFA045664; Sat, 20 Oct 2018 21:49:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202149.w9KLnjFA045664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 21:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339497 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339497 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.29 Precedence: list List-Id: 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, 20 Oct 2018 21:49:45 -0000 Author: cem Date: Sat Oct 20 21:49:44 2018 New Revision: 339497 URL: https://svnweb.freebsd.org/changeset/base/339497 Log: ZSTDIO: Correctly initialize zstd context with provided 'level' Prior to this revision, we allocated sufficient context space for 'level' but never actually set the compress level parameter, so we would always get the default '3'. Reviewed by: markj, vangyzen MFC after: 12 hours Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17144 Modified: head/sys/kern/subr_compressor.c Modified: head/sys/kern/subr_compressor.c ============================================================================== --- head/sys/kern/subr_compressor.c Sat Oct 20 21:45:17 2018 (r339496) +++ head/sys/kern/subr_compressor.c Sat Oct 20 21:49:44 2018 (r339497) @@ -275,8 +275,9 @@ zstdio_init(size_t maxiosize, int level) ZSTD_CCtx *dump_compressor; struct zstdio_stream *s; void *wkspc, *owkspc, *buffer; - size_t wkspc_size, buf_size; + size_t wkspc_size, buf_size, rc; + s = NULL; wkspc_size = ZSTD_estimateCStreamSize(level); owkspc = wkspc = malloc(wkspc_size + 8, M_COMPRESS, M_WAITOK | M_NODUMP); @@ -286,12 +287,23 @@ zstdio_init(size_t maxiosize, int level) dump_compressor = ZSTD_initStaticCCtx(wkspc, wkspc_size); if (dump_compressor == NULL) { - free(owkspc, M_COMPRESS); printf("%s: workspace too small.\n", __func__); - return (NULL); + goto out; } - (void)ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + rc = ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_checksumFlag, 1); + if (ZSTD_isError(rc)) { + printf("%s: error setting checksumFlag: %s\n", __func__, + ZSTD_getErrorName(rc)); + goto out; + } + rc = ZSTD_CCtx_setParameter(dump_compressor, ZSTD_p_compressionLevel, + level); + if (ZSTD_isError(rc)) { + printf("%s: error setting compressLevel: %s\n", __func__, + ZSTD_getErrorName(rc)); + goto out; + } buf_size = ZSTD_CStreamOutSize() * 2; buffer = malloc(buf_size, M_COMPRESS, M_WAITOK | M_NODUMP); @@ -306,6 +318,9 @@ zstdio_init(size_t maxiosize, int level) zstdio_reset(s); +out: + if (s == NULL) + free(owkspc, M_COMPRESS); return (s); } From owner-svn-src-head@freebsd.org Sat Oct 20 22:12:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74FF4FF83CE; Sat, 20 Oct 2018 22:12:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 295098CFBB; Sat, 20 Oct 2018 22:12:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24224242F2; Sat, 20 Oct 2018 22:12:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KMCrvi061921; Sat, 20 Oct 2018 22:12:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMCrl9061919; Sat, 20 Oct 2018 22:12:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202212.w9KMCrl9061919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 22:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339498 - head/sys/crypto/chacha20 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/chacha20 X-SVN-Commit-Revision: 339498 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:12:54 -0000 Author: cem Date: Sat Oct 20 22:12:53 2018 New Revision: 339498 URL: https://svnweb.freebsd.org/changeset/base/339498 Log: crypto/chacha: Split header into separate _chacha.h Sponsored by: Dell EMC Isilon Added: head/sys/crypto/chacha20/_chacha.h (contents, props changed) Modified: head/sys/crypto/chacha20/chacha.h Added: head/sys/crypto/chacha20/_chacha.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/chacha20/_chacha.h Sat Oct 20 22:12:53 2018 (r339498) @@ -0,0 +1,12 @@ +/* $FreeBSD$ */ + +#ifndef _CHACHA_H +#define _CHACHA_H + +#include + +struct chacha_ctx { + u_int input[16]; +}; + +#endif Modified: head/sys/crypto/chacha20/chacha.h ============================================================================== --- head/sys/crypto/chacha20/chacha.h Sat Oct 20 21:49:44 2018 (r339497) +++ head/sys/crypto/chacha20/chacha.h Sat Oct 20 22:12:53 2018 (r339498) @@ -12,10 +12,7 @@ Public domain. #define CHACHA_H #include - -struct chacha_ctx { - u_int input[16]; -}; +#include #define CHACHA_MINKEYLEN 16 #define CHACHA_NONCELEN 8 From owner-svn-src-head@freebsd.org Sat Oct 20 22:14:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F51FF846D; Sat, 20 Oct 2018 22:14:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A16F68D136; Sat, 20 Oct 2018 22:14:30 +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 96BA2242F4; Sat, 20 Oct 2018 22:14:30 +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 w9KMEUhF062103; Sat, 20 Oct 2018 22:14:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMEUrG062102; Sat, 20 Oct 2018 22:14:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202214.w9KMEUrG062102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 22:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339499 - in head: lib/libc/gen sys/crypto/chacha20 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libc/gen sys/crypto/chacha20 X-SVN-Commit-Revision: 339499 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:14:31 -0000 Author: cem Date: Sat Oct 20 22:14:29 2018 New Revision: 339499 URL: https://svnweb.freebsd.org/changeset/base/339499 Log: Embedded chacha: Distinguish via dedicated macro Set embedding expectations via CHACHA_EMBED macro rather than _KERNEL definition. No functional change. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/gen/arc4random.c head/sys/crypto/chacha20/chacha.h Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Sat Oct 20 22:12:53 2018 (r339498) +++ head/lib/libc/gen/arc4random.c Sat Oct 20 22:14:29 2018 (r339499) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "un-namespace.h" +#define CHACHA_EMBED #define KEYSTREAM_ONLY #include "chacha.c" Modified: head/sys/crypto/chacha20/chacha.h ============================================================================== --- head/sys/crypto/chacha20/chacha.h Sat Oct 20 22:12:53 2018 (r339498) +++ head/sys/crypto/chacha20/chacha.h Sat Oct 20 22:14:29 2018 (r339499) @@ -20,10 +20,10 @@ Public domain. #define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN) #define CHACHA_BLOCKLEN 64 -#ifdef _KERNEL -#define LOCAL -#else +#ifdef CHACHA_EMBED #define LOCAL static +#else +#define LOCAL #endif LOCAL void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); From owner-svn-src-head@freebsd.org Sat Oct 20 22:17:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B90E1FF854B; Sat, 20 Oct 2018 22:17:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 661AC8D2A6; Sat, 20 Oct 2018 22:17:17 +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 51EE3242F6; Sat, 20 Oct 2018 22:17:17 +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 w9KMHHUc062274; Sat, 20 Oct 2018 22:17:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMHH8v062273; Sat, 20 Oct 2018 22:17:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202217.w9KMHH8v062273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 22:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339500 - head/sys/crypto/chacha20 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/chacha20 X-SVN-Commit-Revision: 339500 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:17:17 -0000 Author: cem Date: Sat Oct 20 22:17:16 2018 New Revision: 339500 URL: https://svnweb.freebsd.org/changeset/base/339500 Log: Embedded chacha: Remove some harmless dead stores in keystream mode (From r338059.) Sponsored by: Dell EMC Isilon Modified: head/sys/crypto/chacha20/chacha.c Modified: head/sys/crypto/chacha20/chacha.c ============================================================================== --- head/sys/crypto/chacha20/chacha.c Sat Oct 20 22:14:29 2018 (r339499) +++ head/sys/crypto/chacha20/chacha.c Sat Oct 20 22:17:16 2018 (r339500) @@ -120,8 +120,10 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u for (;;) { if (bytes < 64) { +#ifndef KEYSTREAM_ONLY for (i = 0;i < bytes;++i) tmp[i] = m[i]; m = tmp; +#endif ctarget = c; c = tmp; } From owner-svn-src-head@freebsd.org Sat Oct 20 22:24:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B01DFF89A5; Sat, 20 Oct 2018 22:24:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 025FB8D81B; Sat, 20 Oct 2018 22:24:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED6272448E; Sat, 20 Oct 2018 22:24:58 +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 w9KMOwFf067165; Sat, 20 Oct 2018 22:24:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMOwpv067164; Sat, 20 Oct 2018 22:24:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201810202224.w9KMOwpv067164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 20 Oct 2018 22:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339501 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 339501 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:24:59 -0000 Author: cem Date: Sat Oct 20 22:24:58 2018 New Revision: 339501 URL: https://svnweb.freebsd.org/changeset/base/339501 Log: netdump: Zone mbufs should be allocated before dump Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17306 Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Oct 20 22:17:16 2018 (r339500) +++ head/sys/kern/kern_mbuf.c Sat Oct 20 22:24:58 2018 (r339501) @@ -33,8 +33,8 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" #include +#include #include -#include #include #include #include @@ -409,6 +409,8 @@ nd_buf_import(void *arg, void **store, int count, int struct mbuf *m; int i; + KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); + q = arg; for (i = 0; i < count; i++) { @@ -443,6 +445,8 @@ nd_pack_import(void *arg __unused, void **store, int c struct mbuf *m; void *clust; int i; + + KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__)); for (i = 0; i < count; i++) { m = m_get(MT_DATA, M_NOWAIT); From owner-svn-src-head@freebsd.org Sat Oct 20 22:25:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 754C6FF8A3E; Sat, 20 Oct 2018 22:25:58 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B7E48D987; Sat, 20 Oct 2018 22:25:58 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 266FB24493; Sat, 20 Oct 2018 22:25:58 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KMPwPp067254; Sat, 20 Oct 2018 22:25:58 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMPw6q067253; Sat, 20 Oct 2018 22:25:58 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201810202225.w9KMPw6q067253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 20 Oct 2018 22:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339502 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 339502 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:25:58 -0000 Author: oshogbo Date: Sat Oct 20 22:25:57 2018 New Revision: 339502 URL: https://svnweb.freebsd.org/changeset/base/339502 Log: Add link to the setproctitle_fast function. MFC after: 1 week Modified: head/lib/libc/gen/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat Oct 20 22:24:58 2018 (r339501) +++ head/lib/libc/gen/Makefile.inc Sat Oct 20 22:25:57 2018 (r339502) @@ -489,6 +489,7 @@ MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 siglongjmp.3 \ setjmp.3 sigsetjmp.3 MLINKS+=setmode.3 getmode.3 +MLINKS+=setproctitle.3 setproctitle_fast.3 MLINKS+=sigsetops.3 sigaddset.3 \ sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 \ From owner-svn-src-head@freebsd.org Sat Oct 20 22:32:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82829FF8EC7; Sat, 20 Oct 2018 22:32:11 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 364F78DF0D; Sat, 20 Oct 2018 22:32:11 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E9224631; Sat, 20 Oct 2018 22:32:11 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KMWB4K071968; Sat, 20 Oct 2018 22:32:11 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMWAQJ071963; Sat, 20 Oct 2018 22:32:10 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810202232.w9KMWAQJ071963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sat, 20 Oct 2018 22:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339503 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 339503 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:32:11 -0000 Author: philip Date: Sat Oct 20 22:32:10 2018 New Revision: 339503 URL: https://svnweb.freebsd.org/changeset/base/339503 Log: Import tzdata 2018f Changes: https://github.com/eggert/tz/blob/2018f/NEWS MFC after: 3 days Modified: head/contrib/tzdata/CONTRIBUTING head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/README head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backward head/contrib/tzdata/backzone head/contrib/tzdata/etcetera head/contrib/tzdata/europe head/contrib/tzdata/factory head/contrib/tzdata/leap-seconds.list head/contrib/tzdata/leapseconds head/contrib/tzdata/leapseconds.awk head/contrib/tzdata/northamerica head/contrib/tzdata/pacificnew head/contrib/tzdata/southamerica head/contrib/tzdata/systemv head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/yearistype.sh head/contrib/tzdata/zishrink.awk head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab head/contrib/tzdata/zoneinfo2tdf.pl Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/CONTRIBUTING ============================================================================== --- head/contrib/tzdata/CONTRIBUTING Sat Oct 20 22:25:57 2018 (r339502) +++ head/contrib/tzdata/CONTRIBUTING Sat Oct 20 22:32:10 2018 (r339503) @@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell comma 'diff -u old/europe new/europe >myfix.patch', and attach myfix.patch to the email. -For more-elaborate changes, please read the theory.html file and browse -the mailing list archives for -examples of patches that tend to work well. Additions to -data should contain commentary citing reliable sources as -justification. Citations should use https: URLs if available. +For more-elaborate or possibly-controversial changes, +such as renaming, adding or removing zones, please read + or the file +theory.html. It is also good to browse the mailing list archives + for examples of patches that tend +to work well. Additions to data should contain commentary citing +reliable sources as justification. Citations should use https: URLs +if available. Please submit changes against either the latest release in or the master branch of the development Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Sat Oct 20 22:25:57 2018 (r339502) +++ head/contrib/tzdata/Makefile Sat Oct 20 22:32:10 2018 (r339503) @@ -1,3 +1,5 @@ +# Make and install tzdb code and data. + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -19,9 +21,9 @@ BUGEMAIL= tz@iana.org # DATAFORM= rearguard DATAFORM= main -# Change the line below for your time zone (after finding the zone you want in -# the time zone files, or adding it to a time zone file). -# Alternatively, if you discover you've got the wrong time zone, you can just +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just # zic -l rightzone # to correct things. # Use the command @@ -31,14 +33,14 @@ DATAFORM= main LOCALTIME= GMT # If you want something other than Eastern United States time as a template -# for handling POSIX-style time zone environment variables, -# change the line below (after finding the zone you want in the -# time zone files, or adding it to a time zone file). +# for handling POSIX-style timezone environment variables, +# change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). # When a POSIX-style environment variable is handled, the rules in the # template file are used to determine "spring forward" and "fall back" days and # times; the environment variable itself specifies UT offsets of standard and # daylight saving time. -# Alternatively, if you discover you've got the wrong time zone, you can just +# Alternatively, if you discover you've got the wrong timezone, you can just # zic -p rightzone # to correct things. # Use the command @@ -75,7 +77,7 @@ DESTDIR = # TOPDIR should be empty or an absolute name unless you're just testing. TOPDIR = -# The default local time zone is taken from the file TZDEFAULT. +# The default local timezone is taken from the file TZDEFAULT. TZDEFAULT = $(TOPDIR)/etc/localtime # The subdirectory containing installed program and data files, and @@ -84,7 +86,7 @@ TZDEFAULT = $(TOPDIR)/etc/localtime USRDIR = usr USRSHAREDIR = $(USRDIR)/share -# "Compiled" time zone information is placed in the "TZDIR" directory +# "Compiled" timezone information is placed in the "TZDIR" directory # (and subdirectories). # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. TZDIR_BASENAME= zoneinfo @@ -106,9 +108,13 @@ MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man LIBDIR = $(TOPDIR)/$(USRDIR)/lib -# Types to try, as an alternative to time_t. int64_t should be first. -TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) +TIME_T_ALTERNATIVES_HEAD = int64_t +TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t +# What kind of TZif data files to generate. +# (TZif is the binary time zone data format that zic generates.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -129,7 +135,7 @@ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_ REDO= posix_right -# To install data in text form that has all the information of the binary data, +# To install data in text form that has all the information of the TZif data, # (optionally incorporating leap second information), use # TZDATA_TEXT= tzdata.zi leapseconds # To install text data without leap second information (e.g., because @@ -171,7 +177,6 @@ LDLIBS= # Add the following to the end of the "CFLAGS=" line as needed to override # defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". -# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) # -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime # formats that generate only the last two digits of year numbers # -DEPOCH_LOCAL if the 'time' function returns local time not UT @@ -295,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", # "posix2time", and "time2posix" to be added to the time conversion library. # "tzsetwall" is like "tzset" except that it arranges for local wall clock -# time (rather than the time specified in the TZ environment variable) +# time (rather than the timezone specified in the TZ environment variable) # to be used. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. @@ -318,7 +323,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # "posix2time_z" and "time2posix_z" are added as well. # The functions ending in "_z" (or "_rz") are like their unsuffixed # (or suffixed-by-"_r") counterparts, except with an extra first -# argument of opaque type timezone_t that specifies the time zone. +# argument of opaque type timezone_t that specifies the timezone. # "tzalloc" allocates a timezone_t value, and "tzfree" frees it. # # If you want to allocate state structures in localtime, add @@ -357,11 +362,14 @@ ZIC= $(zic) $(ZFLAGS) ZFLAGS= -# How to use zic to install tz binary files. +# How to use zic to install TZif files. ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) # The name of a Posix-compliant 'awk' on your system. +# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core; +# on Ubuntu you can work around this with +# AWK= gawk AWK= awk # The full path name of a Posix-compliant shell, preferably one that supports @@ -410,10 +418,16 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' +# These characters are Latin-1, and so are likely to be displayable +# even in editors with limited character sets. +UNUSUAL_OK_LATIN_1 = «°±»½¾× +# This IPA symbol is represented in Unicode as the composition of +# U+0075 and U+032F, and U+032F is not considered alphabetic by some +# grep implementations that do not grok composition. +UNUSUAL_OK_IPA = u̯ # Non-ASCII non-letters that OK_CHAR allows, as these characters are -# useful in commentary. XEmacs 21.5.34 displays them correctly, -# presumably because they are Latin-1. -UNUSUAL_OK_CHARSET= °±½¾× +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA) # OK_CHAR matches any character allowed in the distributed files. # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and @@ -492,11 +506,14 @@ AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.a ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ private.h tzfile.h zdump.c zic.c -ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) # Consult these files when deciding whether to rebuild the 'version' file. # This list is not the same as the output of 'git ls-files', since @@ -560,14 +577,21 @@ version: $(VERSION_DEPS) printf '%s\n' "$$V" >$@.out mv $@.out $@ -# These files can be tailored by setting BACKWARD, PACKRATDATA, etc. +# These files can be tailored by setting BACKWARD and PACKRATDATA. vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ $(TDATA) $(PACKRATDATA) >$@.out mv $@.out $@ -tzdata.zi: $(DATAFORM).zi version +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk version=`sed 1q version` && \ - LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ + LC_ALL=C $(AWK) \ + -v dataform='$(DATAFORM)' \ + -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ + -v redo='$(REDO)' \ + -v version="$$version" \ + -f zishrink.awk \ $(DATAFORM).zi >$@.out mv $@.out $@ @@ -605,14 +629,16 @@ INSTALLARGS = \ YEARISTYPE='$(YEARISTYPE)' \ ZIC='$(ZIC)' -# 'make install_data' installs one set of tz binary files. -install_data: zic leapseconds yearistype tzdata.zi +INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi + +# 'make install_data' installs one set of TZif files. +install_data: $(INSTALL_DATA_DEPS) $(ZIC_INSTALL) tzdata.zi -posix_only: +posix_only: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data -right_only: +right_only: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ install_data @@ -639,7 +665,7 @@ posix_right: posix_only # This obsolescent rule is present for backwards compatibility with # tz releases 2014g through 2015g. It should go away eventually. -posix_packrat: +posix_packrat: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only zones: $(REDO) @@ -650,29 +676,33 @@ ZDS = dummy.zd # Rule used only by submakes invoked by the $(TZS_NEW) rule. # It is separate so that GNU 'make -j' can run instances in parallel. $(ZDS): zdump - ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@ + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ + >$@ -$(TZS_NEW): tzdata.zi zdump zic - rm -fr tzs.dir - mkdir tzs.dir - $(zic) -d tzs.dir tzdata.zi +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ tzdata.zi | LC_ALL=C sort >$@.out wd=`pwd` && \ - set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \ + x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ | LC_ALL=C sort -t . -k 2,2` && \ + set x $$x && \ shift && \ ZDS=$$* && \ - $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \ - sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out - rm -fr tzs.dir + $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir mv $@.out $@ -# If $(TZS) does not already exist (e.g., old-format tarballs), create it. -# If it exists but 'make check_tzs' fails, a maintainer should inspect the +# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the # failed output and fix the inconsistency, perhaps by running 'make force_tzs'. $(TZS): - $(MAKE) force_tzs + touch $@ force_tzs: $(TZS_NEW) cp $(TZS_NEW) $(TZS) @@ -711,18 +741,21 @@ check_character_set: $(ENCHILADA) $(MISC) $(SOURCES) $(WEB_PAGES) \ CONTRIBUTING LICENSE README \ version tzdata.zi && \ - ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ Makefile && \ ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ leapseconds yearistype.sh zone.tab && \ ! grep -Env $(OK_LINE) $(ENCHILADA); \ } + touch $@ check_white_space: $(ENCHILADA) patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ - ! grep -En "$$pat" $(ENCHILADA) + ! grep -En "$$pat" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) ! grep -n '[[:space:]]$$' \ $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + touch $@ PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ FILE_NAME_COMPONENT_TOO_LONG = \ @@ -731,6 +764,7 @@ FILE_NAME_COMPONENT_TOO_LONG = \ check_name_lengths: $(TDATA_TO_CHECK) backzone ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ $(TDATA_TO_CHECK) backzone + touch $@ CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } @@ -743,52 +777,61 @@ check_sorted: backward backzone iso3166.tab zone.tab z LC_ALL=C sort -c $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ LC_ALL=C sort -cu + touch $@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) $(AWK) -f checklinks.awk tzdata.zi + touch $@ check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) for tab in $(ZONETABLES); do \ $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ || exit; \ done + touch $@ check_tzs: $(TZS) $(TZS_NEW) - diff -u $(TZS) $(TZS_NEW) + if test -s $(TZS); then \ + diff -u $(TZS) $(TZS_NEW); \ + else \ + cp $(TZS_NEW) $(TZS); \ + fi + touch $@ # This checks only the HTML 4.01 strict page. # To check the the other pages, use . check_web: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html + touch $@ # Check that zishrink.awk does not alter the data, and that ziguard.awk # preserves main-format data. -check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \ - $(DATAFORM).zi tzdata.zi - for type in posix right; do \ - mkdir -p time_t.dir/$$type time_t.dir/$$type-t \ - time_t.dir/$$type-shrunk && \ - case $$type in \ - right) leap='-L leapseconds';; \ - *) leap=;; \ - esac && \ - $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \ +check_zishrink: check_zishrink_posix check_zishrink_right +check_zishrink_posix check_zishrink_right: \ + zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi + rm -fr $@.dir $@-t.dir $@-shrunk.dir + mkdir $@.dir $@-t.dir $@-shrunk.dir + case $@ in \ + *_right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ + $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ case $(DATAFORM) in \ main) \ - $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \ + $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ $(AWK) '/^Rule/' $(TDATA) | \ - $(ZIC) $$leap -d time_t.dir/$$type-t - \ - $(PACKRATDATA) && \ - diff -r time_t.dir/$$type time_t.dir/$$type-t;; \ - esac && \ - $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \ - diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \ - done - rm -fr time_t.dir + $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ + diff -r $@.dir $@-t.dir;; \ + esac + diff -r $@.dir $@-shrunk.dir + rm -fr $@.dir $@-t.dir $@-shrunk.dir + touch $@ clean_misc: - rm -f core *.o *.out \ + rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ + check_* core typecheck_* \ date tzselect version.h zdump zic yearistype libtz.a clean: clean_misc rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW) @@ -818,17 +861,17 @@ $(MANTXTS): workman.sh LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out mv $@.out $@ -# Set the time stamps to those of the git repository, if available, +# Set the timestamps to those of the git repository, if available, # and if the files have not changed since then. # This uses GNU 'touch' syntax 'touch -d@N FILE', # where N is the number of seconds since 1970. # If git or GNU 'touch' is absent, don't bother to sync with git timestamps. # Also, set the timestamp of each prebuilt file like 'leapseconds' # to be the maximum of the files it depends on. -set-timestamps.out: $(ENCHILADA) +set-timestamps.out: $(EIGHT_YARDS) rm -f $@ if (type git) >/dev/null 2>&1 && \ - files=`git ls-files $(ENCHILADA)` && \ + files=`git ls-files $(EIGHT_YARDS)` && \ touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ @@ -846,83 +889,100 @@ set-timestamps.out: $(ENCHILADA) exit; \ done touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi - touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version touch $@ +set-tzs-timestamp.out: $(TZS) + touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) + touch $@ # The zics below ensure that each data file can stand on its own. # We also do an all-files run to catch links to links. -check_public: - $(MAKE) maintainer-clean - $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL - mkdir -p public.dir - for i in $(TDATA_TO_CHECK) tzdata.zi; do \ - $(zic) -v -d public.dir $$i 2>&1 || exit; \ +check_public: $(VERSION_DEPS) + rm -fr public.dir + mkdir public.dir + ln $(VERSION_DEPS) public.dir + cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \ + public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \ done - $(zic) -v -d public.dir $(TDATA_TO_CHECK) + public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK) rm -fr public.dir + touch $@ # Check that the code works under various alternative # implementations of time_t. -check_time_t_alternatives: - if diff -q Makefile Makefile 2>/dev/null; then \ - quiet_option='-q'; \ - else \ - quiet_option=''; \ - fi && \ +check_time_t_alternatives: $(TIME_T_ALTERNATIVES) +$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD) +$(TIME_T_ALTERNATIVES): $(VERSION_DEPS) + rm -fr $@.dir + mkdir $@.dir + ln $(VERSION_DEPS) $@.dir + case $@ in \ + int32_t) range=-2147483648,2147483648;; \ + u*) range=0,4294967296;; \ + *) range=-4294967296,4294967296;; \ + esac && \ wd=`pwd` && \ zones=`$(AWK) '/^[^#]/ { print $$3 }' time_t.dir/int64_t.out && \ - time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \ - >time_t.dir/$$type.out && \ - diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \ - || exit; \ - done - rm -fr time_t.dir + D=$$wd/$@.dir \ + TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ + install $$range_target) && \ + test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ + (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \ + $(MAKE) TOPDIR="$$wd/$@.dir" \ + TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ + D=$$wd/$@.dir \ + to$$range.tzs) && \ + diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ + $@.dir/to$$range.tzs && \ + if diff -q Makefile Makefile 2>/dev/null; then \ + quiet_option='-q'; \ + else \ + quiet_option=''; \ + fi && \ + diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \ + $@.dir/etc && \ + diff $$quiet_option -r \ + $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \ + $@.dir/usr/share; \ + } + touch $@ TRADITIONAL_ASC = \ tzcode$(VERSION).tar.gz.asc \ tzdata$(VERSION).tar.gz.asc -ALL_ASC = $(TRADITIONAL_ASC) \ - tzdata$(VERSION)-rearguard.tar.gz.asc \ +REARGUARD_ASC = \ + tzdata$(VERSION)-rearguard.tar.gz.asc +ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ tzdb-$(VERSION).tar.lz.asc -tarballs traditional_tarballs signatures traditional_signatures: version +tarballs rearguard_tarballs traditional_tarballs \ +signatures rearguard_signatures traditional_signatures: \ + version set-timestamps.out rearguard.zi VERSION=`cat version` && \ $(MAKE) VERSION="$$VERSION" $@_version # These *_version rules are intended for use if VERSION is set by some # other means. Ordinarily these rules are used only by the above # non-_version rules, which set VERSION on the 'make' command line. -tarballs_version: traditional_tarballs_version \ - tzdata$(VERSION)-rearguard.tar.gz \ +tarballs_version: traditional_tarballs_version rearguard_tarballs_version \ tzdb-$(VERSION).tar.lz +rearguard_tarballs_version: \ + tzdata$(VERSION)-rearguard.tar.gz traditional_tarballs_version: \ tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz signatures_version: $(ALL_ASC) +rearguard_signatures_version: $(REARGUARD_ASC) traditional_signatures_version: $(TRADITIONAL_ASC) tzcode$(VERSION).tar.gz: set-timestamps.out @@ -958,7 +1018,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ -tzdb-$(VERSION).tar.lz: set-timestamps.out +tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out rm -fr tzdb-$(VERSION) mkdir tzdb-$(VERSION) ln $(ENCHILADA) tzdb-$(VERSION) @@ -972,16 +1032,26 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz $(ALL_ASC): - gpg --armor --detach-sign $? + gpg2 --armor --detach-sign $? -typecheck: - $(MAKE) clean - for i in "long long" unsigned; \ - do \ - $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \ - ./zdump -v Europe/Rome ; \ - $(MAKE) clean ; \ - done +TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T +typecheck: typecheck_long_long typecheck_unsigned +typecheck_long_long typecheck_unsigned: $(VERSION_DEPS) + rm -fr $@.dir + mkdir $@.dir + ln $(VERSION_DEPS) $@.dir + cd $@.dir && \ + case $@ in \ + *_long_long) i="long long";; \ + *_unsigned ) i="unsigned" ;; \ + esac && \ + typecheck_cflags='' && \ + $(MAKE) \ + CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ + TOPDIR="`pwd`" \ + install + $@.dir/zdump -i -c 1970,1971 Europe/Rome + touch $@ zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi @@ -997,14 +1067,14 @@ zic.o: private.h tzfile.h version.h .KEEP_STATE: .PHONY: ALL INSTALL all -.PHONY: check check_character_set check_links check_name_lengths -.PHONY: check_public check_sorted check_tables -.PHONY: check_time_t_alternatives check_tzs check_web check_white_space +.PHONY: check check_time_t_alternatives .PHONY: check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names -.PHONY: posix_only posix_packrat posix_right -.PHONY: public right_only right_posix signatures signatures_version +.PHONY: posix_only posix_packrat posix_right public +.PHONY: rearguard_signatures rearguard_signatures_version +.PHONY: rearguard_tarballs rearguard_tarballs_version +.PHONY: right_only right_posix signatures signatures_version .PHONY: tarballs tarballs_version .PHONY: traditional_signatures traditional_signatures_version .PHONY: traditional_tarballs traditional_tarballs_version Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sat Oct 20 22:25:57 2018 (r339502) +++ head/contrib/tzdata/NEWS Sat Oct 20 22:32:10 2018 (r339503) @@ -1,5 +1,136 @@ News for the tz database +Release 2018f - 2018-10-18 00:14:18 -0700 + + Briefly: + Volgograd moves from +03 to +04 on 2018-10-28. + Fiji ends DST 2019-01-13, not 2019-01-20. + Most of Chile changes DST dates, effective 2019-04-06. + + Changes to future timestamps + + Volgograd moves from +03 to +04 on 2018-10-28 at 02:00. + (Thanks to Alexander Fetisov and Stepan Golosunov.) + + Fiji ends DST 2019-01-13 instead of the 2019-01-20 previously + predicted. (Thanks to Raymond Kumar.) Adjust future predictions + accordingly. + + Most of Chile will end DST on the first Saturday in April at 24:00 mainland + time, and resume DST on the first Saturday in September at 24:00 mainland + time. The changes are effective from 2019-04-06, and do not affect the + Magallanes region modeled by America/Punta_Arenas. (Thanks to Juan Correa + and Tim Parenti.) Adjust future predictions accordingly. + + Changes to past timestamps + + The 2018-05-05 North Korea 30-minute time zone change took place + at 23:30 the previous day, not at 00:00 that day. + + China's 1988 spring-forward transition was on April 17, not + April 10. Its DST transitions in 1986/91 were at 02:00, not 00:00. + (Thanks to P Chan.) + + Fix several issues for Macau before 1992. Macau's pre-1904 LMT + was off by 10 s. Macau switched to +08 in 1904 not 1912, and + temporarily switched to +09/+10 during World War II. Macau + observed DST in 1942/79, not 1961/80, and there were several + errors for transition times and dates. (Thanks to P Chan.) + + The 1948-1951 fallback transitions in Japan were at 25:00 on + September's second Saturday, not at 24:00. (Thanks to Phake Nick.) + zic turns this into 01:00 on the day after September's second + Saturday, which is the best that POSIX or C platforms can do. + + Incorporate 1940-1949 Asia/Shanghai DST transitions from a 2014 + paper by Li Yu, replacing more-questionable data from Shanks. + + Changes to time zone abbreviations + + Use "PST" and "PDT" for Philippine time. (Thanks to Paul Goyette.) + + Changes to code + + zic now always generates TZif files where time type 0 is used for + timestamps before the first transition. This simplifies the + reading of TZif files and should not affect behavior of existing + TZif readers because the same set of time types is used; only + their internal indexes may have changed. This affects only the + legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and + EET, which previously used nonzero types for these timestamps. + + Because of the type 0 change, zic no longer outputs a dummy + transition at time -2**59 (before the Big Bang), as clients should + no longer need this to handle historical timestamps correctly. + This reverts a change introduced in 2013d and shrinks most TZif + files by a few bytes. + + zic now supports negative time-of-day in Rule and Leap lines, e.g., + "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition + occurs at 18:00 on the Saturday before the last Sunday in April. + This behavior was documented in 2018a but the code did not + entirely match the documentation. + + localtime.c no longer requires at least one time type in TZif + files that lack transitions or have a POSIX-style TZ string. This + future-proofs the code against possible future extensions to the + format that would allow TZif files with POSIX-style TZ strings and + without transitions or time types. + + A read-access subscript error in localtime.c has been fixed. + It could occur only in TZif files with timecnt == 0, something that + does not happen in practice now but could happen in future versions. + + localtime.c no longer ignores TZif POSIX-style TZ strings that + specify only standard time. Instead, these TZ strings now + override the default time type for timestamps after the last + transition (or for all time stamps if there are no transitions), + just as DST strings specifying DST have always done. + + leapseconds.awk now outputs "#updated" and "#expires" comments, + and supports leap seconds at the ends of months other than June + and December. (Inspired by suggestions from Chris Woodbury.) + + Changes to documentation + + New restrictions: A Rule name must start with a character that + is neither an ASCII digit nor "-" nor "+", and an unquoted name + should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~". + The latter restriction makes room for future extensions (a + possibility noted by Tom Lane). + + tzfile.5 now documents what time types apply before the first and + after the last transition, if any. + + Documentation now uses the spelling "timezone" for a TZ setting + that determines timestamp history, and "time zone" for a + geographic region currently sharing the same standard time. + + The name "TZif" is now used for the tz binary data format. + + tz-link.htm now mentions the A0 TimeZone Migration utilities. + (Thanks to Aldrin Martoq for the link.) + + Changes to build procedure + + New 'make' target 'rearguard_tarballs' to build the rearguard + tarball only. This is a convenience on platforms that lack lzip + if you want to build the rearguard tarball. (Problem reported by + Deborah Goldsmith.) + + tzdata.zi is now more stable from release to release. (Problem + noted by Tom Lane.) It is also a bit shorter. + + tzdata.zi now can contain comment lines documenting configuration + information, such as which data format was selected, which input + files were used, and how leap seconds are treated. (Problems + noted by Lester Caine and Brian Inglis.) If the Makefile defaults + are used these comment lines are absent, for backward + compatibility. A redistributor intending to alter its copy of the + files should also append "-LABEL" to the 'version' file's first + line, where "LABEL" identifies the redistributor's change. + + Release 2018e - 2018-05-01 23:42:51 -0700 Briefly: @@ -9,7 +140,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700 'make tarballs' now also builds a rearguard tarball. New 's' and 'd' suffixes in SAVE columns of Rule and Zone lines. - Changes to past and future time stamps + Changes to past and future timestamps North Korea switches back from +0830 to +09 on 2018-05-05. (Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon, @@ -17,9 +148,9 @@ Release 2018e - 2018-05-01 23:42:51 -0700 Bring back the negative-DST changes of 2018a, except be more compatible with data parsers that do not support negative DST. - Also, this now affects historical time stamps in Namibia and the + Also, this now affects historical timestamps in Namibia and the former Czechoslovakia, not just Ireland. The main format now uses - negative DST to model time stamps in Europe/Dublin (from 1971 on), + negative DST to model timestamps in Europe/Dublin (from 1971 on), Europe/Prague (1946/7), and Africa/Windhoek (1994/2017). This does not affect UT offsets, only time zone abbreviations and the tm_isdst flag. Also, this does not affect rearguard or vanguard @@ -44,7 +175,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700 in tzdata, it could be used to specify the legal time in Namibia 1994-2017, as opposed to the popular time (see below). - Changes to past time stamps + Changes to past timestamps From 1994 through 2017 Namibia observed DST in winter, not summer. That is, it used negative DST, as Ireland still does. This change @@ -54,12 +185,12 @@ Release 2018e - 2018-05-01 23:42:51 -0700 both simply called "standard time" in Namibian law, in common practice winter time was considered to be DST (as noted by Stephen Colebourne). The full effect of this change is only in vanguard - format; in rearguard and main format, the tm_isdst flag is still + and main format; in rearguard format, the tm_isdst flag is still zero in winter and nonzero in summer. In 1946/7 Czechoslovakia also observed negative DST in winter. - The full effect of this change is only in vanguard format; in - rearguard and main formats, it is modeled as plain GMT without + The full effect of this change is only in vanguard and main + formats; in rearguard format, it is modeled as plain GMT without daylight saving. Also, the dates of some 1944/5 DST transitions in Czechoslovakia have been changed. @@ -72,17 +203,17 @@ Release 2018d - 2018-03-22 07:05:46 -0700 Add support for vanguard and rearguard data consumers. Add subsecond precision to source data format, though not to data. - Changes to future time stamps + Changes to future timestamps In 2018, Palestine starts DST on March 24, not March 31. Adjust future predictions accordingly. (Thanks to Sharef Mustafa.) - Changes to past and future time stamps + Changes to past and future timestamps Casey Station in Antarctica changed from +11 to +08 on 2018-03-11 at 04:00. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Historical transitions for Uruguay, represented by America/Montevideo, have been updated per official legal documents, @@ -224,7 +355,7 @@ Release 2018c - 2018-01-22 23:00:44 -0800 change is reapplied. (Problems reported by Deborah Goldsmith and Stephen Colebourne.) - Changes to past time stamps + Changes to past timestamps Japanese DST transitions (1948-1951) were Sundays at 00:00, not Saturdays or Sundays at 02:00. (Thanks to Takayuki Nikai.) @@ -256,18 +387,18 @@ Release 2018a - 2018-01-12 22:29:21 -0800 Use Debian-style installation locations, instead of 4.3BSD-style. New zic option -t. - Changes to past and future time stamps + Changes to past and future timestamps São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at 01:00. (Thanks to Steffen Thorsen and Michael Deckers.) - Changes to future time stamps + Changes to future timestamps Starting in 2018 southern Brazil will begin DST on November's first Sunday instead of October's third Sunday. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps A discrepancy of 4 s in timestamps before 1931 in South Sudan has been corrected. The 'backzone' and 'zone.tab' files did not agree @@ -355,7 +486,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700 A new file tzdata.zi now holds a small text copy of all data. The zic input format has been regularized slightly. - Changes to future time stamps + Changes to future timestamps Northern Cyprus has decided to resume EU rules starting 2017-10-29, thus reinstituting winter time. @@ -381,7 +512,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700 2018-03-11 at 03:00. This affects UT offsets starting 2018-11-04 at 02:00. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03. (Thanks to Arthur David Olson.) @@ -511,11 +642,11 @@ Release 2017b - 2017-03-17 07:30:38 -0700 Briefly: Haiti has resumed DST. - Changes to past and future time stamps + Changes to past and future timestamps Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01. @@ -527,7 +658,7 @@ Release 2017b - 2017-03-17 07:30:38 -0700 The reference localtime implementation now falls back on the current US daylight-saving transition rules rather than the 1987-2006 rules. This fallback occurs only when (1) the TZ - environment variable's value has a name like "AST4ADT" that asks + environment variable has a value like "AST4ADT" that asks for daylight saving time but does not specify the rules, (2) there is no file by that name, and (3) the TZDEFRULES file cannot be loaded. (Thanks to Tom Lane.) @@ -538,7 +669,7 @@ Release 2017a - 2017-02-28 00:05:36 -0800 Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia discontinues DST. - Changes to future time stamps + Changes to future timestamps Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.) @@ -549,12 +680,12 @@ Release 2017a - 2017-02-28 00:05:36 -0800 assume it's permanent. (Thanks to Juan Correa and Deborah Goldsmith.) This also affects Antarctica/Palmer. - Changes to past time stamps + Changes to past timestamps - Fix many entries for historical time stamps for Europe/Madrid + Fix many entries for historical timestamps for Europe/Madrid before 1979, to agree with tables compiled by Pere Planesas of the National Astronomical Observatory of Spain. As a side effect, - this changes some time stamps for Africa/Ceuta before 1929, which + this changes some timestamps for Africa/Ceuta before 1929, which are probably guesswork anyway. (Thanks to Steve Allen and Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for correcting the 1901 transition.) @@ -645,13 +776,13 @@ Release 2016j - 2016-11-22 23:17:13 -0800 Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04. - Changes to future time stamps + Changes to future timestamps Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00. This hives off a new zone Europe/Saratov from Europe/Volgograd. (Thanks to Yuri Konotopov and Stepan Golosunov.) - Changes to past time stamps + Changes to past timestamps The new zone Asia/Atyrau for AtyraÅ« Region, Kazakhstan, is like Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring @@ -687,7 +818,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga reintroduces DST on 2016-11-06. - Changes to future time stamps + Changes to future timestamps Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on 2017-01-15 at 03:00. Assume future observances in Tonga will be @@ -695,7 +826,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 January, like Fiji. (Thanks to Pulu Ê»Anau.) Switch to numeric time zone abbreviations for this zone. - Changes to past and future time stamps + Changes to past and future timestamps Northern Cyprus is now +03 year round, causing a split in Cyprus time zones starting 2016-10-30 at 04:00. This creates a zone @@ -704,9 +835,9 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Antarctica/Casey switched from +08 to +11 on 2016-10-22. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps - Several corrections were made for pre-1975 time stamps in Italy. + Several corrections were made for pre-1975 timestamps in Italy. These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and Europe/Vatican. @@ -744,7 +875,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Release 2016h - 2016-10-19 23:17:57 -0700 - Changes to future time stamps + Changes to future timestamps Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not 2016-10-21 at 00:00. (Thanks to Sharef Mustafa.) Predict that @@ -752,7 +883,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700 at 01:00, which is consistent with predicted spring transitions on the last Saturday of March. (Thanks to Tim Parenti.) - Changes to past time stamps + Changes to past timestamps In Turkey, transitions in 1986-1990 were at 01:00 standard time not at 02:00, and the spring 1994 transition was on March 20, not *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 20 22:35:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E04FFF9085; Sat, 20 Oct 2018 22:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D77958E115; Sat, 20 Oct 2018 22:35:06 +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 CCAC224665; Sat, 20 Oct 2018 22:35:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KMZ6SE072155; Sat, 20 Oct 2018 22:35:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMZ6uI072154; Sat, 20 Oct 2018 22:35:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810202235.w9KMZ6uI072154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 22:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339504 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 339504 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:35:07 -0000 Author: emaste Date: Sat Oct 20 22:35:06 2018 New Revision: 339504 URL: https://svnweb.freebsd.org/changeset/base/339504 Log: libi386: remove CLANG_NO_IAS workaround Clang's Integrated Assembler was previously disabled for i386 with the note that it "doesn't grok .codeNN directives yet." This is no longer the case (and hasn't been for some time), and the assembled output .text is identical between gas and IAS. MFC after: 2 months Sponsored by: The FreeBSD Foundation Modified: head/stand/i386/libi386/Makefile Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Sat Oct 20 22:32:10 2018 (r339503) +++ head/stand/i386/libi386/Makefile Sat Oct 20 22:35:06 2018 (r339504) @@ -51,7 +51,3 @@ CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ CFLAGS+= ${FORMAT_EXTENSIONS} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} -CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS} From owner-svn-src-head@freebsd.org Sat Oct 20 22:39:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D89DFF923C; Sat, 20 Oct 2018 22:39:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EA518E31A; Sat, 20 Oct 2018 22:39:36 +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 1890C24689; Sat, 20 Oct 2018 22:39:36 +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 w9KMdZQf072374; Sat, 20 Oct 2018 22:39:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KMdZpQ072372; Sat, 20 Oct 2018 22:39:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810202239.w9KMdZpQ072372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 20 Oct 2018 22:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339505 - in head: lib/libc/gmon sys/libkern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libc/gmon sys/libkern X-SVN-Commit-Revision: 339505 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.29 Precedence: list List-Id: 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, 20 Oct 2018 22:39:36 -0000 Author: emaste Date: Sat Oct 20 22:39:35 2018 New Revision: 339505 URL: https://svnweb.freebsd.org/changeset/base/339505 Log: mcount: tidy up ANSIfication libc/gmon's mcount was ANSIfied in r124180, with libkern following over a decade later, in r325988, but some minor discrepancies remained. Update libc/gmon's mexitcount to an ANSI C function definition, and use (void) for libkern-only functions that take no arguments. Reported by: bde Modified: head/lib/libc/gmon/mcount.c head/sys/libkern/mcount.c Modified: head/lib/libc/gmon/mcount.c ============================================================================== --- head/lib/libc/gmon/mcount.c Sat Oct 20 22:35:06 2018 (r339504) +++ head/lib/libc/gmon/mcount.c Sat Oct 20 22:39:35 2018 (r339505) @@ -279,8 +279,7 @@ MCOUNT #ifdef GUPROF void -mexitcount(selfpc) - uintfptr_t selfpc; +mexitcount(uintfptr_t selfpc) { struct gmonparam *p; uintfptr_t selfpcdiff; Modified: head/sys/libkern/mcount.c ============================================================================== --- head/sys/libkern/mcount.c Sat Oct 20 22:35:06 2018 (r339504) +++ head/sys/libkern/mcount.c Sat Oct 20 22:39:35 2018 (r339505) @@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$"); * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. */ -_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) /* _mcount; may be static, inline, etc */ +/* _mcount; may be static, inline, etc */ +_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) { #ifdef GUPROF int delta; @@ -291,7 +292,7 @@ mexitcount(uintfptr_t selfpc) #endif void -empty_loop() +empty_loop(void) { int i; @@ -300,13 +301,13 @@ empty_loop() } void -nullfunc() +nullfunc(void) { __asm __volatile(""); } void -nullfunc_loop() +nullfunc_loop(void) { int i; From owner-svn-src-head@freebsd.org Sat Oct 20 23:08:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64244FF9EBB; Sat, 20 Oct 2018 23:08:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7448F418; Sat, 20 Oct 2018 23: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 EE6C824B73; Sat, 20 Oct 2018 23:08:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KN84a7087759; Sat, 20 Oct 2018 23:08:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KN84Qg087758; Sat, 20 Oct 2018 23:08:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810202308.w9KN84Qg087758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Oct 2018 23:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339506 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 339506 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.29 Precedence: list List-Id: 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, 20 Oct 2018 23:08:05 -0000 Author: kib Date: Sat Oct 20 23:08:04 2018 New Revision: 339506 URL: https://svnweb.freebsd.org/changeset/base/339506 Log: Reduce code duplication in merging vm_entry neighbors. Submitted by: Doug Moore Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17610 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Oct 20 22:39:35 2018 (r339505) +++ head/sys/vm/vm_map.c Sat Oct 20 23:08:04 2018 (r339506) @@ -1643,6 +1643,49 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o } } +static bool +vm_map_mergeable_neighbors(vm_map_entry_t prev, vm_map_entry_t entry) +{ + vm_size_t prevsize; + + prevsize = prev->end - prev->start; + return (prev->end == entry->start && + prev->object.vm_object == entry->object.vm_object && + (prev->object.vm_object == NULL || + prev->offset + prevsize == entry->offset) && + prev->eflags == entry->eflags && + prev->protection == entry->protection && + prev->max_protection == entry->max_protection && + prev->inheritance == entry->inheritance && + prev->wired_count == entry->wired_count && + prev->cred == entry->cred); +} + +static void +vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_entry_t entry) +{ + + /* + * If the backing object is a vnode object, + * vm_object_deallocate() calls vrele(). + * However, vrele() does not lock the vnode + * because the vnode has additional + * references. Thus, the map lock can be kept + * without causing a lock-order reversal with + * the vnode lock. + * + * Since we count the number of virtual page + * mappings in object->un_pager.vnp.writemappings, + * the writemappings value should not be adjusted + * when the entry is disposed of. + */ + if (entry->object.vm_object != NULL) + vm_object_deallocate(entry->object.vm_object); + if (entry->cred != NULL) + crfree(entry->cred); + vm_map_entry_dispose(map, entry); +} + /* * vm_map_simplify_entry: * @@ -1659,7 +1702,6 @@ void vm_map_simplify_entry(vm_map_t map, vm_map_entry_t entry) { vm_map_entry_t next, prev; - vm_size_t prevsize, esize; if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) @@ -1667,70 +1709,23 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent prev = entry->prev; if (prev != &map->header) { - prevsize = prev->end - prev->start; - if ( (prev->end == entry->start) && - (prev->object.vm_object == entry->object.vm_object) && - (!prev->object.vm_object || - (prev->offset + prevsize == entry->offset)) && - (prev->eflags == entry->eflags) && - (prev->protection == entry->protection) && - (prev->max_protection == entry->max_protection) && - (prev->inheritance == entry->inheritance) && - (prev->wired_count == entry->wired_count) && - (prev->cred == entry->cred)) { + if (vm_map_mergeable_neighbors(prev, entry)) { vm_map_entry_unlink(map, prev); entry->start = prev->start; entry->offset = prev->offset; if (entry->prev != &map->header) vm_map_entry_resize_free(map, entry->prev); - - /* - * If the backing object is a vnode object, - * vm_object_deallocate() calls vrele(). - * However, vrele() does not lock the vnode - * because the vnode has additional - * references. Thus, the map lock can be kept - * without causing a lock-order reversal with - * the vnode lock. - * - * Since we count the number of virtual page - * mappings in object->un_pager.vnp.writemappings, - * the writemappings value should not be adjusted - * when the entry is disposed of. - */ - if (prev->object.vm_object) - vm_object_deallocate(prev->object.vm_object); - if (prev->cred != NULL) - crfree(prev->cred); - vm_map_entry_dispose(map, prev); + vm_map_merged_neighbor_dispose(map, prev); } } next = entry->next; if (next != &map->header) { - esize = entry->end - entry->start; - if ((entry->end == next->start) && - (next->object.vm_object == entry->object.vm_object) && - (!entry->object.vm_object || - (entry->offset + esize == next->offset)) && - (next->eflags == entry->eflags) && - (next->protection == entry->protection) && - (next->max_protection == entry->max_protection) && - (next->inheritance == entry->inheritance) && - (next->wired_count == entry->wired_count) && - (next->cred == entry->cred)) { + if (vm_map_mergeable_neighbors(entry, next)) { vm_map_entry_unlink(map, next); entry->end = next->end; vm_map_entry_resize_free(map, entry); - - /* - * See comment above. - */ - if (next->object.vm_object) - vm_object_deallocate(next->object.vm_object); - if (next->cred != NULL) - crfree(next->cred); - vm_map_entry_dispose(map, next); + vm_map_merged_neighbor_dispose(map, next); } } } From owner-svn-src-head@freebsd.org Sat Oct 20 23:17:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D2CFFA273; Sat, 20 Oct 2018 23:17:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8E2F8FA22; Sat, 20 Oct 2018 23:17:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E29B324D12; Sat, 20 Oct 2018 23:17:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KNHPCP093237; Sat, 20 Oct 2018 23:17:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KNHObG093230; Sat, 20 Oct 2018 23:17:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201810202317.w9KNHObG093230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Oct 2018 23:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339507 - in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Commit-Revision: 339507 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.29 Precedence: list List-Id: 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, 20 Oct 2018 23:17:26 -0000 Author: kib Date: Sat Oct 20 23:17:24 2018 New Revision: 339507 URL: https://svnweb.freebsd.org/changeset/base/339507 Log: amd64: flush L1 data cache on syscall return with an error. The knob allows to select the flushing mode or turn it off/on. The idea, as well as the list of the ignored syscall errors, were taken from https://www.openwall.com/lists/kernel-hardening/2018/10/11/10 . I was not able to measure statistically significant difference between flush enabled vs disabled using syscall_timing getuid. Reviewed by: bwidawsk Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17536 Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/support.S head/sys/amd64/amd64/trap.c head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/include/md_var.h head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/amd64/initcpu.c Sat Oct 20 23:17:24 2018 (r339507) @@ -253,6 +253,7 @@ initializecpu(void) } hw_ibrs_recalculate(); hw_ssb_recalculate(false); + amd64_syscall_ret_flush_l1d_recalc(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/amd64/machdep.c Sat Oct 20 23:17:24 2018 (r339507) @@ -1722,6 +1722,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) != NULL) vty_set_preferred(VTY_VT); + TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); + TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); + TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush", + &syscall_ret_l1d_flush_mode); + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ @@ -1864,9 +1869,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) x86_init_fdt(); #endif thread0.td_critnest = 0; - - TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); - TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); TSEXIT(); Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/amd64/support.S Sat Oct 20 23:17:24 2018 (r339507) @@ -1556,3 +1556,10 @@ ENTRY(flush_l1d_sw) ret #undef L1D_FLUSH_SIZE END(flush_l1d_sw) + +ENTRY(flush_l1d_sw_abi) + pushq %rbx + call flush_l1d_sw + popq %rbx + ret +END(flush_l1d_sw_abi) Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/amd64/trap.c Sat Oct 20 23:17:24 2018 (r339507) @@ -1056,6 +1056,84 @@ cpu_fetch_syscall_args(struct thread *td) #include "../../kern/subr_syscall.c" +static void (*syscall_ret_l1d_flush)(void); +int syscall_ret_l1d_flush_mode; + +static void +flush_l1d_hw(void) +{ + + wrmsr(MSR_IA32_FLUSH_CMD, IA32_FLUSH_CMD_L1D); +} + +static void __inline +amd64_syscall_ret_flush_l1d_inline(int error) +{ + void (*p)(void); + + if (error != 0 && error != EEXIST && error != EAGAIN && + error != EXDEV && error != ENOENT && error != ENOTCONN && + error != EINPROGRESS) { + p = syscall_ret_l1d_flush; + if (p != NULL) + p(); + } +} + +void +amd64_syscall_ret_flush_l1d(int error) +{ + + amd64_syscall_ret_flush_l1d_inline(error); +} + +void +amd64_syscall_ret_flush_l1d_recalc(void) +{ + bool l1d_hw; + + l1d_hw = (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0; +again: + switch (syscall_ret_l1d_flush_mode) { + case 0: + syscall_ret_l1d_flush = NULL; + break; + case 1: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : + flush_l1d_sw_abi; + break; + case 2: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : NULL; + break; + case 3: + syscall_ret_l1d_flush = flush_l1d_sw_abi; + break; + default: + syscall_ret_l1d_flush_mode = 1; + goto again; + } +} + +static int +machdep_syscall_ret_flush_l1d(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = syscall_ret_l1d_flush_mode; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + syscall_ret_l1d_flush_mode = val; + amd64_syscall_ret_flush_l1d_recalc(); + return (0); +} +SYSCTL_PROC(_machdep, OID_AUTO, syscall_ret_flush_l1d, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + machdep_syscall_ret_flush_l1d, "I", + "Flush L1D on syscall return with error (0 - off, 1 - on, " + "2 - use hw only, 3 - use sw only"); + + /* * System call handler for native binaries. The trap frame is already * set up by the assembler trampoline and a pointer to it is saved in @@ -1110,4 +1188,6 @@ amd64_syscall(struct thread *td, int traced) */ if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + + amd64_syscall_ret_flush_l1d_inline(error); } Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/ia32/ia32_syscall.c Sat Oct 20 23:17:24 2018 (r339507) @@ -231,6 +231,7 @@ ia32_syscall(struct trapframe *frame) } syscallret(td, error); + amd64_syscall_ret_flush_l1d(error); } static void Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/amd64/include/md_var.h Sat Oct 20 23:17:24 2018 (r339507) @@ -41,6 +41,7 @@ extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable; extern int nmi_flush_l1d_sw; +extern int syscall_ret_l1d_flush_mode; /* * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its @@ -55,8 +56,11 @@ void amd64_conf_fast_syscall(void); void amd64_db_resume_dbreg(void); void amd64_lower_shared_page(struct sysentvec *); void amd64_syscall(struct thread *td, int traced); +void amd64_syscall_ret_flush_l1d(int error); +void amd64_syscall_ret_flush_l1d_recalc(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); +void flush_l1d_sw_abi(void); void ld_ds(void) __asm(__STRING(ld_ds)); void ld_es(void) __asm(__STRING(ld_es)); void ld_fs(void) __asm(__STRING(ld_fs)); Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Sat Oct 20 23:08:04 2018 (r339506) +++ head/sys/dev/cpuctl/cpuctl.c Sat Oct 20 23:17:24 2018 (r339507) @@ -521,6 +521,9 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td hw_ibrs_recalculate(); restore_cpu(oldcpu, is_bound, td); hw_ssb_recalculate(true); +#ifdef __amd64__ + amd64_syscall_ret_flush_l1d_recalc(); +#endif printcpuinfo(); return (0); }