From owner-svn-src-user@freebsd.org Mon Apr 9 21:37:41 2018 Return-Path: Delivered-To: svn-src-user@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 36069F80D8A for ; Mon, 9 Apr 2018 21:37:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 D66CB69BA6; Mon, 9 Apr 2018 21:37:40 +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 D15142447E; Mon, 9 Apr 2018 21:37:40 +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 w39LbeKY082191; Mon, 9 Apr 2018 21:37:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Lbd3V082178; Mon, 9 Apr 2018 21:37:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804092137.w39Lbd3V082178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Apr 2018 21:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332338 - in user/markj/netdump/sys: dev/alc dev/bge dev/bxe dev/cxgb dev/mlx4/mlx4_en dev/re dev/virtio/network kern net netinet/netdump sys X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump/sys: dev/alc dev/bge dev/bxe dev/cxgb dev/mlx4/mlx4_en dev/re dev/virtio/network kern net netinet/netdump sys X-SVN-Commit-Revision: 332338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 21:37:41 -0000 Author: markj Date: Mon Apr 9 21:37:39 2018 New Revision: 332338 URL: https://svnweb.freebsd.org/changeset/base/332338 Log: Query the driver for its rx buffer size rather than forcing MCLBYTES. Reinitialize the netdump mbuf pool from the generic SIOCSIFMTU handler. Modified: user/markj/netdump/sys/dev/alc/if_alc.c user/markj/netdump/sys/dev/bge/if_bge.c user/markj/netdump/sys/dev/bxe/bxe.c user/markj/netdump/sys/dev/cxgb/cxgb_main.c user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c user/markj/netdump/sys/dev/re/if_re.c user/markj/netdump/sys/dev/virtio/network/if_vtnet.c user/markj/netdump/sys/kern/kern_mbuf.c user/markj/netdump/sys/net/if.c user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/netinet/netdump/netdump.h user/markj/netdump/sys/netinet/netdump/netdump_client.c user/markj/netdump/sys/sys/mbuf.h Modified: user/markj/netdump/sys/dev/alc/if_alc.c ============================================================================== --- user/markj/netdump/sys/dev/alc/if_alc.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/alc/if_alc.c Mon Apr 9 21:37:39 2018 (r332338) @@ -4658,25 +4658,20 @@ sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS) #ifdef NETDUMP static void -alc_netdump_init(struct ifnet *ifp __unused, int *nrxr) +alc_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { + struct alc_softc *sc; + sc = if_getsoftc(ifp); + KASSERT(sc->alc_buf_size <= MCLBYTES, ("incorrect cluster size")); + *nrxr = ALC_RX_RING_CNT; + *clsize = MCLBYTES; } static void -alc_netdump_event(struct ifnet *ifp, enum netdump_ev event) +alc_netdump_event(struct ifnet *ifp __unused, enum netdump_ev event __unused) { - struct alc_softc *sc; - - sc = if_getsoftc(ifp); - switch (event) { - case NETDUMP_START: - sc->alc_buf_size = imin(sc->alc_buf_size, MCLBYTES); - break; - default: - break; - } } static int Modified: user/markj/netdump/sys/dev/bge/if_bge.c ============================================================================== --- user/markj/netdump/sys/dev/bge/if_bge.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/bge/if_bge.c Mon Apr 9 21:37:39 2018 (r332338) @@ -6811,27 +6811,25 @@ bge_get_counter(if_t ifp, ift_counter cnt) #ifdef NETDUMP static void -bge_netdump_init(if_t ifp, int *nrxr) +bge_netdump_init(if_t ifp, int *nrxr, int *clsize) { struct bge_softc *sc; sc = if_getsoftc(ifp); + BGE_LOCK(sc); *nrxr = sc->bge_return_ring_cnt; + if ((sc->bge_flags & BGE_FLAG_JUMBO_STD) != 0 && + (if_getmtu(sc->bge_ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN + + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) + *clsize = MJUM9BYTES; + else + *clsize = MCLBYTES; + BGE_UNLOCK(sc); } static void -bge_netdump_event(if_t ifp, enum netdump_ev event) +bge_netdump_event(if_t ifp __unused, enum netdump_ev event __unused) { - struct bge_softc *sc; - - sc = if_getsoftc(ifp); - switch (event) { - case NETDUMP_START: - sc->bge_flags &= ~BGE_FLAG_JUMBO_STD; - break; - default: - break; - } } static int Modified: user/markj/netdump/sys/dev/bxe/bxe.c ============================================================================== --- user/markj/netdump/sys/dev/bxe/bxe.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/bxe/bxe.c Mon Apr 9 21:37:39 2018 (r332338) @@ -19172,12 +19172,15 @@ bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, #ifdef NETDUMP static void -bxe_netdump_init(struct ifnet *ifp, int *nrxr) +bxe_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { struct bxe_softc *sc; sc = if_getsoftc(ifp); + BXE_CORE_LOCK(sc); *nrxr = sc->num_queues; + *clsize = sc->fp[0].mbuf_alloc_size; + BXE_CORE_UNLOCK(sc); } static void Modified: user/markj/netdump/sys/dev/cxgb/cxgb_main.c ============================================================================== --- user/markj/netdump/sys/dev/cxgb/cxgb_main.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/cxgb/cxgb_main.c Mon Apr 9 21:37:39 2018 (r332338) @@ -3587,10 +3587,17 @@ cxgbc_mod_event(module_t mod, int cmd, void *arg) #ifdef NETDUMP static void -cxgb_netdump_init(struct ifnet *ifp, int *nrxr) +cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { + struct port_info *pi; + adapter_t *adap; + pi = if_getsoftc(ifp); + adap = pi->adapter; + ADAPTER_LOCK(adap); *nrxr = SGE_QSETS; + *clsize = adap->sge.qs[0].fl[1].buf_size; + ADAPTER_UNLOCK(adap); } static void @@ -3607,7 +3614,7 @@ cxgb_netdump_event(struct ifnet *ifp, enum netdump_ev /* Need to reinit after netdump_mbuf_dump(). */ qs->fl[0].zone = zone_pack; - qs->fl[1].zone = zone_pack; + qs->fl[1].zone = zone_clust; qs->lro.enabled = 0; } } Modified: user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Apr 9 21:37:39 2018 (r332338) @@ -2886,12 +2886,15 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p #ifdef NETDUMP static void -mlx4_en_netdump_init(struct ifnet *dev, int *nrxr) +mlx4_en_netdump_init(struct ifnet *dev, int *nrxr, int *clsize) { struct mlx4_en_priv *priv; priv = if_getsoftc(dev); + mutex_lock(&priv->mdev->state_lock); *nrxr = priv->rx_ring_num; + *clsize = priv->rx_mb_size; + mutex_unlock(&priv->mdev->state_lock); } static void Modified: user/markj/netdump/sys/dev/re/if_re.c ============================================================================== --- user/markj/netdump/sys/dev/re/if_re.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/re/if_re.c Mon Apr 9 21:37:39 2018 (r332338) @@ -4095,27 +4095,21 @@ sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) #ifdef NETDUMP static void -re_netdump_init(struct ifnet *ifp, int *nrxr) +re_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { struct rl_softc *sc; sc = if_getsoftc(ifp); + RL_LOCK(sc); *nrxr = sc->rl_ldata.rl_rx_desc_cnt; + *clsize = (ifp->if_mtu > RL_MTU && + (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) ? MJUM9BYTES : MCLBYTES; + RL_UNLOCK(sc); } static void -re_netdump_event(struct ifnet *ifp, enum netdump_ev event) +re_netdump_event(struct ifnet *ifp __unused, enum netdump_ev event __unused) { - struct rl_softc *sc; - - sc = if_getsoftc(ifp); - switch (event) { - case NETDUMP_START: - sc->rl_flags &= ~RL_FLAG_JUMBOV2; - break; - default: - break; - } } static int Modified: user/markj/netdump/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Mon Apr 9 21:37:39 2018 (r332338) @@ -3984,12 +3984,16 @@ vtnet_tunable_int(struct vtnet_softc *sc, const char * #ifdef NETDUMP static void -vtnet_netdump_init(struct ifnet *ifp, int *nrxr) +vtnet_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { struct vtnet_softc *sc; sc = if_getsoftc(ifp); + + VTNET_CORE_LOCK(sc); *nrxr = sc->vtnet_max_vq_pairs; + *clsize = sc->vtnet_rx_clsize; + VTNET_CORE_UNLOCK(sc); /* * We need to allocate from this zone in the transmit path, so ensure @@ -4002,18 +4006,8 @@ vtnet_netdump_init(struct ifnet *ifp, int *nrxr) } static void -vtnet_netdump_event(struct ifnet *ifp, enum netdump_ev event) +vtnet_netdump_event(struct ifnet *ifp __unused, enum netdump_ev event __unused) { - struct vtnet_softc *sc; - - sc = if_getsoftc(ifp); - switch (event) { - case NETDUMP_START: - sc->vtnet_rx_clsize = MCLBYTES; - break; - default: - break; - } } static int Modified: user/markj/netdump/sys/kern/kern_mbuf.c ============================================================================== --- user/markj/netdump/sys/kern/kern_mbuf.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/kern/kern_mbuf.c Mon Apr 9 21:37:39 2018 (r332338) @@ -381,9 +381,12 @@ mbuf_init(void *dummy) SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); #ifdef NETDUMP -static struct mbufq nd_mbufq; -static struct mbufq nd_clustq; +static struct mbufq nd_mbufq = + { STAILQ_HEAD_INITIALIZER(nd_mbufq.mq_head), 0, INT_MAX }; +static struct mbufq nd_clustq = + { STAILQ_HEAD_INITIALIZER(nd_clustq.mq_head), 0, INT_MAX }; +static int nd_clsize; static uma_zone_t nd_zone_mbuf; static uma_zone_t nd_zone_clust; static uma_zone_t nd_zone_pack; @@ -402,6 +405,7 @@ nd_buf_import(void *arg, void **store, int count, int m = mbufq_dequeue(q); if (m == NULL) break; + trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags); store[i] = m; } return (i); @@ -439,7 +443,6 @@ nd_pack_import(void *arg __unused, void **store, int c m_free(m); break; } - mb_ctor_clust(clust, MCLBYTES, m, 0); store[i] = m; } @@ -461,8 +464,54 @@ nd_pack_release(void *arg __unused, void **store, int } } +void +netdump_mbuf_drain(void) +{ + struct mbuf *m; + void *item; + + if (nd_zone_mbuf != NULL) { + uma_zdestroy(nd_zone_mbuf); + nd_zone_mbuf = NULL; + } + if (nd_zone_clust != NULL) { + uma_zdestroy(nd_zone_clust); + nd_zone_clust = NULL; + } + if (nd_zone_pack != NULL) { + uma_zdestroy(nd_zone_pack); + nd_zone_pack = NULL; + } + + while ((m = mbufq_dequeue(&nd_mbufq)) != NULL) + m_free(m); + while ((item = mbufq_dequeue(&nd_clustq)) != NULL) + uma_zfree(m_getzone(nd_clsize), item); +} + /* - * Initialize zones used to cache netdump packet buffers. At panic-time, we + * Callback invoked immediately prior to starting a netdump. + */ +void +netdump_mbuf_dump(void) +{ + + /* + * All cluster zones return buffers of the size requested by the + * drivers. It's up to the driver to reinitialize the zones if the + * MTU of a netdump-enabled interface changes. + */ + printf("netdump: overwriting mbuf zone pointers\n"); + zone_mbuf = nd_zone_mbuf; + zone_clust = nd_zone_clust; + zone_pack = nd_zone_pack; + zone_jumbop = nd_zone_clust; + zone_jumbo9 = nd_zone_clust; + zone_jumbo16 = nd_zone_clust; +} + +/* + * (Re-)Initialize zones used to cache netdump packet buffers. At panic-time, we * swap out the regular mbuf/cluster zones with these, ensuring that drivers and * the protocol code can allocate buffers from a preallocated pool, rather than * relying on memory allocation to succeed after a panic. @@ -471,14 +520,15 @@ nd_pack_release(void *arg __unused, void **store, int * purpose of caching clusters, we treat them as mbufs. */ void -netdump_mbuf_init(int nmbuf, int nclust) +netdump_mbuf_reinit(int nmbuf, int nclust, int clsize) { struct mbuf *m; void *item; - mbufq_init(&nd_mbufq, INT_MAX); - mbufq_init(&nd_clustq, INT_MAX); + netdump_mbuf_drain(); + nd_clsize = clsize; + nd_zone_mbuf = uma_zcache_create("netdump_" MBUF_MEM_NAME, MSIZE, mb_ctor_mbuf, mb_dtor_mbuf, #ifdef INVARIANTS @@ -490,7 +540,7 @@ netdump_mbuf_init(int nmbuf, int nclust) &nd_mbufq, UMA_ZONE_NOBUCKET); nd_zone_clust = uma_zcache_create("netdump_" MBUF_CLUSTER_MEM_NAME, - MCLBYTES, mb_ctor_clust, + clsize, mb_ctor_clust, #ifdef INVARIANTS trash_dtor, trash_init, trash_fini, #else @@ -509,59 +559,9 @@ netdump_mbuf_init(int nmbuf, int nclust) uma_zfree(nd_zone_mbuf, m); } while (nclust-- > 0) { - item = uma_zalloc(zone_clust, M_WAITOK); + item = uma_zalloc(m_getzone(nd_clsize), M_WAITOK); uma_zfree(nd_zone_clust, item); } -} - -/* - * Free preallocated mbufs and clusters and destroy netdump cache zones. - */ -void -netdump_mbuf_drain(void) -{ - struct mbuf *m; - void *item; - - while ((m = mbufq_dequeue(&nd_mbufq)) != NULL) - m_free(m); - while ((item = mbufq_dequeue(&nd_clustq)) != NULL) - uma_zfree(zone_clust, item); - - if (nd_zone_mbuf != NULL) { - uma_zdestroy(nd_zone_mbuf); - nd_zone_mbuf = NULL; - } - if (nd_zone_clust != NULL) { - uma_zdestroy(nd_zone_clust); - nd_zone_clust = NULL; - } - if (nd_zone_pack != NULL) { - uma_zdestroy(nd_zone_pack); - nd_zone_pack = NULL; - } -} - -/* - * Callback invoked immediately prior to starting a netdump. - */ -void -netdump_mbuf_dump(void) -{ - - /* - * All cluster zones return 2KB buffers. It's up to the per-driver - * netdump hooks to ensure that no attempts are made to use larger - * clusters. netdump ACKs fit easily within an mbuf, let alone a 2KB - * cluster, so there's no need to preallocate larger buffers. - */ - printf("netdump: overwriting mbuf zone pointers\n"); - zone_mbuf = nd_zone_mbuf; - zone_clust = nd_zone_clust; - zone_pack = nd_zone_pack; - zone_jumbop = nd_zone_clust; - zone_jumbo9 = nd_zone_clust; - zone_jumbo16 = nd_zone_clust; } #endif /* NETDUMP */ Modified: user/markj/netdump/sys/net/if.c ============================================================================== --- user/markj/netdump/sys/net/if.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/net/if.c Mon Apr 9 21:37:39 2018 (r332338) @@ -88,6 +88,7 @@ #include #ifdef INET #include +#include #endif /* INET */ #ifdef INET6 #include @@ -2707,6 +2708,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, if (error == 0) { getmicrotime(&ifp->if_lastchange); rt_ifmsg(ifp); +#ifdef INET + NETDUMP_REINIT(ifp); +#endif } /* * If the link MTU changed, do network layer specific procedure. Modified: user/markj/netdump/sys/net/iflib.c ============================================================================== --- user/markj/netdump/sys/net/iflib.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/net/iflib.c Mon Apr 9 21:37:39 2018 (r332338) @@ -5974,12 +5974,15 @@ iflib_fixup_rx(struct mbuf *m) #ifdef NETDUMP static void -iflib_netdump_init(struct ifnet *ifp, int *nrxr) +iflib_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) { if_ctx_t ctx; ctx = if_getsoftc(ifp); + CTX_LOCK(ctx); *nrxr = NRXQSETS(ctx); + *clsize = ctx->ifc_rxqs[0].ifr_fl->ifl_buf_size; + CTX_UNLOCK(ctx); } static void @@ -5987,15 +5990,22 @@ iflib_netdump_event(struct ifnet *ifp, enum netdump_ev { if_ctx_t ctx; if_softc_ctx_t scctx; - int i; + iflib_fl_t fl; + iflib_rxq_t rxq; + int i, j; ctx = if_getsoftc(ifp); scctx = &ctx->ifc_softc_ctx; switch (event) { case NETDUMP_START: - for (i = 0; i < scctx->isc_nrxqsets; i++) - ctx->ifc_rxqs[i].ifr_fl->ifl_buf_size = MCLBYTES; + for (i = 0; i < scctx->isc_nrxqsets; i++) { + rxq = &ctx->ifc_rxqs[i]; + for (j = 0; j < rxq->ifr_nfl; j++) { + fl = rxq->ifr_fl; + fl->ifl_zone = m_getzone(fl->ifl_buf_size); + } + } iflib_no_tx_batch = 1; break; default: Modified: user/markj/netdump/sys/netinet/netdump/netdump.h ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump.h Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/netinet/netdump/netdump.h Mon Apr 9 21:37:39 2018 (r332338) @@ -86,7 +86,9 @@ enum netdump_ev { struct ifnet; struct mbuf; -typedef void netdump_init_t(struct ifnet *, int *nrxr); +void netdump_reinit(struct ifnet *); + +typedef void netdump_init_t(struct ifnet *, int *nrxr, int *clsize); typedef void netdump_event_t(struct ifnet *, enum netdump_ev); typedef int netdump_transmit_t(struct ifnet *, struct mbuf *); typedef int netdump_poll_t(struct ifnet *, int); @@ -111,12 +113,15 @@ struct netdump_methods { .nd_poll = driver##_netdump_poll, \ } +#define NETDUMP_REINIT(ifp) netdump_reinit(ifp) + #define NETDUMP_SET(ifp, driver) \ (ifp)->if_netdump_methods = &driver##_netdump_methods #else /* !NETDUMP */ #define NETDUMP_DEFINE(driver) +#define NETDUMP_REINIT(ifp) #define NETDUMP_SET(ifp, driver) #endif /* NETDUMP */ Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump_client.c Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/netinet/netdump/netdump_client.c Mon Apr 9 21:37:39 2018 (r332338) @@ -1048,7 +1048,6 @@ static int netdump_configure(struct netdump_conf *conf) { struct ifnet *ifp; - int nmbuf, nclust, nrxr; IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { @@ -1067,7 +1066,27 @@ netdump_configure(struct netdump_conf *conf) return (1); } - ifp->if_netdump_methods->nd_init(ifp, &nrxr); + nd_ifp = ifp; + netdump_reinit(ifp); + memcpy(&nd_conf, conf, sizeof(nd_conf)); + nd_enabled = 1; + return (0); +} + +/* + * Reinitialize the mbuf pool used by drivers while dumping. This is called + * from the generic ioctl handler for SIOCSIFMTU after the driver has + * reconfigured itself. + */ +void +netdump_reinit(struct ifnet *ifp) +{ + int clsize, nmbuf, nclust, nrxr; + + if (ifp != nd_ifp) + return; + + ifp->if_netdump_methods->nd_init(ifp, &nrxr, &clsize); KASSERT(nrxr > 0, ("invalid receive ring count %d", nrxr)); /* @@ -1076,12 +1095,7 @@ netdump_configure(struct netdump_conf *conf) */ nmbuf = NETDUMP_MAX_IN_FLIGHT * (4 + nrxr); nclust = NETDUMP_MAX_IN_FLIGHT * nrxr; - netdump_mbuf_init(nmbuf, nclust); - - nd_ifp = ifp; - memcpy(&nd_conf, conf, sizeof(nd_conf)); - nd_enabled = 1; - return (0); + netdump_mbuf_reinit(nmbuf, nclust, clsize); } /* Modified: user/markj/netdump/sys/sys/mbuf.h ============================================================================== --- user/markj/netdump/sys/sys/mbuf.h Mon Apr 9 21:16:28 2018 (r332337) +++ user/markj/netdump/sys/sys/mbuf.h Mon Apr 9 21:37:39 2018 (r332338) @@ -1375,9 +1375,9 @@ mbuf_tstmp2timespec(struct mbuf *m, struct timespec *t #ifdef NETDUMP /* Invoked from the netdump client code. */ -void netdump_mbuf_init(int, int); void netdump_mbuf_drain(void); void netdump_mbuf_dump(void); +void netdump_mbuf_reinit(int nmbuf, int nclust, int clsize); #endif #endif /* _KERNEL */ From owner-svn-src-user@freebsd.org Mon Apr 9 21:38:49 2018 Return-Path: Delivered-To: svn-src-user@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 92D8AF80E7D for ; Mon, 9 Apr 2018 21:38:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4200E6A2BD; Mon, 9 Apr 2018 21:38:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CAEF24480; Mon, 9 Apr 2018 21:38:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39LcmEP082314; Mon, 9 Apr 2018 21:38:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Lcj5O082289; Mon, 9 Apr 2018 21:38:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804092138.w39Lcj5O082289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Apr 2018 21:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332339 - in user/markj/netdump: . contrib/opencsd etc/mtree include lib lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/gen lib/libc/i386/sys lib/libc/mips/sys lib/li... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . contrib/opencsd etc/mtree include lib lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/gen lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/p... X-SVN-Commit-Revision: 332339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 21:38:49 -0000 Author: markj Date: Mon Apr 9 21:38:45 2018 New Revision: 332339 URL: https://svnweb.freebsd.org/changeset/base/332339 Log: MFH at r332338. Added: user/markj/netdump/contrib/opencsd/ - copied from r332338, head/contrib/opencsd/ user/markj/netdump/lib/libc/stdio/gets_s.c - copied unchanged from r332338, head/lib/libc/stdio/gets_s.c user/markj/netdump/lib/libc/tests/stdio/gets_s_test.c - copied unchanged from r332338, head/lib/libc/tests/stdio/gets_s_test.c user/markj/netdump/lib/libopencsd/ - copied from r332338, head/lib/libopencsd/ user/markj/netdump/share/man/man4/spigen.4 - copied unchanged from r332338, head/share/man/man4/spigen.4 user/markj/netdump/share/man/man9/ofw_bus_is_compatible.9 - copied unchanged from r332338, head/share/man/man9/ofw_bus_is_compatible.9 user/markj/netdump/share/man/man9/ofw_bus_status_okay.9 - copied unchanged from r332338, head/share/man/man9/ofw_bus_status_okay.9 user/markj/netdump/stand/i386/isoboot/ - copied from r332338, head/stand/i386/isoboot/ user/markj/netdump/stand/libsa/cd9660read.c - copied unchanged from r332338, head/stand/libsa/cd9660read.c user/markj/netdump/sys/arm/mv/armada38x/armada38x_pl310.h - copied unchanged from r332338, head/sys/arm/mv/armada38x/armada38x_pl310.h user/markj/netdump/sys/arm/mv/armv5_machdep.c - copied unchanged from r332338, head/sys/arm/mv/armv5_machdep.c user/markj/netdump/sys/arm/mv/files.arm7 - copied unchanged from r332338, head/sys/arm/mv/files.arm7 user/markj/netdump/sys/arm/mv/mv_armv7_machdep.c - copied unchanged from r332338, head/sys/arm/mv/mv_armv7_machdep.c user/markj/netdump/sys/arm64/coresight/ - copied from r332338, head/sys/arm64/coresight/ user/markj/netdump/sys/dev/vmware/vmci/LICENSE - copied unchanged from r332338, head/sys/dev/vmware/vmci/LICENSE user/markj/netdump/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso - copied unchanged from r332338, head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso user/markj/netdump/sys/dts/arm/overlays/sun8i-a83t-emac.dtso - copied unchanged from r332338, head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso user/markj/netdump/sys/dts/arm/overlays/sun8i-a83t-sid.dtso - copied unchanged from r332338, head/sys/dts/arm/overlays/sun8i-a83t-sid.dtso user/markj/netdump/tests/sys/netpfil/pf/ioctl/ - copied from r332338, head/tests/sys/netpfil/pf/ioctl/ user/markj/netdump/tools/diag/prtblknos/main.c - copied unchanged from r332338, head/tools/diag/prtblknos/main.c user/markj/netdump/usr.bin/etdump/ - copied from r332338, head/usr.bin/etdump/ Deleted: user/markj/netdump/lib/libc/aarch64/sys/shmat.S user/markj/netdump/lib/libc/aarch64/sys/sigreturn.S user/markj/netdump/lib/libc/amd64/sys/setlogin.S user/markj/netdump/lib/libc/amd64/sys/sigreturn.S user/markj/netdump/lib/libc/arm/sys/shmat.S user/markj/netdump/lib/libc/arm/sys/sigreturn.S user/markj/netdump/lib/libc/i386/sys/setlogin.S user/markj/netdump/lib/libc/i386/sys/sigreturn.S user/markj/netdump/lib/libc/mips/sys/shmat.S user/markj/netdump/lib/libc/powerpc/sys/setlogin.S user/markj/netdump/lib/libc/powerpc64/sys/setlogin.S user/markj/netdump/lib/libc/riscv/sys/shmat.S user/markj/netdump/lib/libc/riscv/sys/sigreturn.S user/markj/netdump/lib/libc/sparc64/sys/setlogin.S user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_gpio.h user/markj/netdump/sys/arm/mv/mv_machdep.c user/markj/netdump/sys/geom/geom_aes.c Modified: user/markj/netdump/Makefile.inc1 user/markj/netdump/UPDATING user/markj/netdump/etc/mtree/BSD.include.dist user/markj/netdump/etc/mtree/BSD.tests.dist user/markj/netdump/include/pthread.h user/markj/netdump/include/stdio.h user/markj/netdump/lib/Makefile user/markj/netdump/lib/libc/aarch64/sys/Makefile.inc user/markj/netdump/lib/libc/amd64/sys/Makefile.inc user/markj/netdump/lib/libc/arm/sys/Makefile.inc user/markj/netdump/lib/libc/gen/getlogin.c user/markj/netdump/lib/libc/gen/syslog.3 user/markj/netdump/lib/libc/gen/syslog.c user/markj/netdump/lib/libc/i386/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc user/markj/netdump/lib/libc/riscv/sys/Makefile.inc user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc user/markj/netdump/lib/libc/stdio/Makefile.inc user/markj/netdump/lib/libc/stdio/Symbol.map user/markj/netdump/lib/libc/stdio/fgets.3 user/markj/netdump/lib/libc/tests/stdio/Makefile user/markj/netdump/lib/libufs/inode.c user/markj/netdump/lib/libufs/type.c user/markj/netdump/lib/libvmmapi/vmmapi.c user/markj/netdump/lib/libvmmapi/vmmapi.h user/markj/netdump/sbin/fsdb/Makefile user/markj/netdump/sbin/fsdb/fsdbutil.c user/markj/netdump/sbin/reboot/reboot.c user/markj/netdump/share/examples/etc/make.conf user/markj/netdump/share/man/man4/cfumass.4 user/markj/netdump/share/man/man4/geom.4 user/markj/netdump/share/man/man4/vmci.4 user/markj/netdump/share/man/man8/rc.subr.8 user/markj/netdump/share/man/man9/BUS_ADD_CHILD.9 user/markj/netdump/share/man/man9/Makefile user/markj/netdump/share/man/man9/timeout.9 user/markj/netdump/share/mk/bsd.cpu.mk user/markj/netdump/share/mk/bsd.libnames.mk user/markj/netdump/share/mk/src.libnames.mk user/markj/netdump/share/mk/src.opts.mk user/markj/netdump/stand/common/disk.c user/markj/netdump/stand/common/part.c user/markj/netdump/stand/common/part.h user/markj/netdump/stand/forth/efi.4th user/markj/netdump/stand/forth/loader.4th user/markj/netdump/stand/forth/loader.rc user/markj/netdump/stand/i386/Makefile user/markj/netdump/stand/i386/Makefile.inc user/markj/netdump/stand/i386/gptboot/gptboot.c user/markj/netdump/stand/i386/loader/loader.rc user/markj/netdump/stand/libsa/cd9660.c user/markj/netdump/stand/lua/loader.lua user/markj/netdump/sys/amd64/amd64/db_trace.c user/markj/netdump/sys/amd64/amd64/exception.S user/markj/netdump/sys/amd64/amd64/genassym.c user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/amd64/minidump_machdep.c user/markj/netdump/sys/amd64/amd64/mp_machdep.c user/markj/netdump/sys/amd64/amd64/mpboot.S user/markj/netdump/sys/amd64/amd64/pmap.c user/markj/netdump/sys/amd64/amd64/ptrace_machdep.c user/markj/netdump/sys/amd64/amd64/vm_machdep.c user/markj/netdump/sys/amd64/ia32/ia32_misc.c user/markj/netdump/sys/amd64/ia32/ia32_reg.c user/markj/netdump/sys/amd64/ia32/ia32_signal.c user/markj/netdump/sys/amd64/ia32/ia32_sigtramp.S user/markj/netdump/sys/amd64/ia32/ia32_syscall.c user/markj/netdump/sys/amd64/include/smp.h user/markj/netdump/sys/amd64/include/vmm.h user/markj/netdump/sys/amd64/include/vmm_dev.h user/markj/netdump/sys/amd64/linux/linux_dummy.c user/markj/netdump/sys/amd64/linux/linux_sysvec.c user/markj/netdump/sys/amd64/linux32/linux32_dummy.c user/markj/netdump/sys/amd64/linux32/linux32_sysent.c user/markj/netdump/sys/amd64/linux32/linux32_sysvec.c user/markj/netdump/sys/amd64/linux32/syscalls.master user/markj/netdump/sys/amd64/vmm/amd/svm.c user/markj/netdump/sys/amd64/vmm/intel/vmx.c user/markj/netdump/sys/amd64/vmm/vmm.c user/markj/netdump/sys/amd64/vmm/vmm_dev.c user/markj/netdump/sys/amd64/vmm/x86.c user/markj/netdump/sys/arm/allwinner/aw_gpio.c user/markj/netdump/sys/arm/allwinner/aw_if_dwc.c user/markj/netdump/sys/arm/allwinner/aw_sid.c user/markj/netdump/sys/arm/allwinner/axp81x.c user/markj/netdump/sys/arm/allwinner/clkng/aw_clk.h user/markj/netdump/sys/arm/allwinner/clkng/aw_clk_nm.c user/markj/netdump/sys/arm/allwinner/clkng/aw_clk_nm.h user/markj/netdump/sys/arm/allwinner/clkng/ccu_sun8i_r.c user/markj/netdump/sys/arm/allwinner/if_awg.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_ccm.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_mmc.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_pinctrl.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c user/markj/netdump/sys/arm/arm/machdep.c user/markj/netdump/sys/arm/arm/vm_machdep.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_bsc.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_gpio.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_intr.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_spi.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_spivar.h user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2836.c user/markj/netdump/sys/arm/conf/ARMADA38X user/markj/netdump/sys/arm/conf/ARMADAXP user/markj/netdump/sys/arm/conf/RPI-B user/markj/netdump/sys/arm/conf/RPI2 user/markj/netdump/sys/arm/freescale/vybrid/vf_ccm.c user/markj/netdump/sys/arm/include/intr.h user/markj/netdump/sys/arm/mv/armada/wdt.c user/markj/netdump/sys/arm/mv/armada38x/armada38x.c user/markj/netdump/sys/arm/mv/armada38x/armada38x_mp.c user/markj/netdump/sys/arm/mv/armada38x/armada38x_pl310.c user/markj/netdump/sys/arm/mv/armada38x/std.armada38x user/markj/netdump/sys/arm/mv/armadaxp/armadaxp.c user/markj/netdump/sys/arm/mv/armadaxp/armadaxp_mp.c user/markj/netdump/sys/arm/mv/armadaxp/std.mv78x60 user/markj/netdump/sys/arm/mv/files.mv user/markj/netdump/sys/arm/mv/gpio.c user/markj/netdump/sys/arm/mv/mpic.c user/markj/netdump/sys/arm/mv/mv_common.c user/markj/netdump/sys/arm/mv/mv_localbus.c user/markj/netdump/sys/arm/mv/mv_pci.c user/markj/netdump/sys/arm/mv/mv_pci_ctrl.c user/markj/netdump/sys/arm/mv/mvreg.h user/markj/netdump/sys/arm/mv/mvvar.h user/markj/netdump/sys/arm/mv/mvwin.h user/markj/netdump/sys/arm/mv/std-pj4b.mv user/markj/netdump/sys/arm/mv/timer.c user/markj/netdump/sys/arm/nvidia/as3722_gpio.c user/markj/netdump/sys/arm/nvidia/as3722_regulators.c user/markj/netdump/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c user/markj/netdump/sys/arm/nvidia/tegra_pinmux.c user/markj/netdump/sys/arm/nvidia/tegra_usbphy.c user/markj/netdump/sys/arm/ti/cpsw/if_cpsw.c user/markj/netdump/sys/arm/ti/ti_hwmods.c user/markj/netdump/sys/arm/ti/usb/omap_host.c user/markj/netdump/sys/arm64/arm64/machdep.c user/markj/netdump/sys/arm64/arm64/trap.c user/markj/netdump/sys/cam/scsi/scsi_cd.c user/markj/netdump/sys/cam/scsi/scsi_da.c user/markj/netdump/sys/cam/scsi/scsi_enc.c user/markj/netdump/sys/cam/scsi/scsi_pass.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c user/markj/netdump/sys/compat/freebsd32/freebsd32_ioctl.c user/markj/netdump/sys/compat/freebsd32/freebsd32_misc.c user/markj/netdump/sys/compat/freebsd32/freebsd32_sysent.c user/markj/netdump/sys/compat/ia32/ia32_genassym.c user/markj/netdump/sys/compat/ia32/ia32_sysvec.c user/markj/netdump/sys/compat/linux/linux_emul.c user/markj/netdump/sys/compat/linux/linux_emul.h user/markj/netdump/sys/compat/linux/linux_ioctl.c user/markj/netdump/sys/compat/linux/linux_util.c user/markj/netdump/sys/compat/linuxkpi/common/include/asm/smp.h user/markj/netdump/sys/compat/linuxkpi/common/src/linux_schedule.c user/markj/netdump/sys/conf/NOTES user/markj/netdump/sys/conf/files user/markj/netdump/sys/conf/files.arm64 user/markj/netdump/sys/conf/options user/markj/netdump/sys/conf/options.amd64 user/markj/netdump/sys/conf/options.arm64 user/markj/netdump/sys/conf/options.mips user/markj/netdump/sys/conf/options.powerpc user/markj/netdump/sys/dev/aac/aac.c user/markj/netdump/sys/dev/aacraid/aacraid.c user/markj/netdump/sys/dev/acpica/acpi_hpet.c user/markj/netdump/sys/dev/ahci/ahci_mv_fdt.c user/markj/netdump/sys/dev/altera/avgen/altera_avgen_fdt.c user/markj/netdump/sys/dev/atkbdc/atkbd.c user/markj/netdump/sys/dev/atkbdc/atkbdc_ebus.c user/markj/netdump/sys/dev/cxgbe/t4_main.c user/markj/netdump/sys/dev/cy/cy.c user/markj/netdump/sys/dev/drm2/drmP.h user/markj/netdump/sys/dev/drm2/drm_ioc32.c user/markj/netdump/sys/dev/drm2/i915/i915_ioc32.c user/markj/netdump/sys/dev/drm2/radeon/radeon_ioc32.c user/markj/netdump/sys/dev/etherswitch/e6000sw/e6000sw.c user/markj/netdump/sys/dev/extres/regulator/regulator.c user/markj/netdump/sys/dev/fdt/fdt_common.c user/markj/netdump/sys/dev/fdt/fdt_common.h user/markj/netdump/sys/dev/fdt/fdt_pinctrl.c user/markj/netdump/sys/dev/fdt/fdt_slicer.c user/markj/netdump/sys/dev/filemon/filemon.c user/markj/netdump/sys/dev/filemon/filemon_wrapper.c user/markj/netdump/sys/dev/gpio/gpiokeys.c user/markj/netdump/sys/dev/gpio/gpioled_fdt.c user/markj/netdump/sys/dev/iicbus/adt746x.c user/markj/netdump/sys/dev/ipmi/ipmi_kcs.c user/markj/netdump/sys/dev/kbdmux/kbdmux.c user/markj/netdump/sys/dev/le/lebuffer_sbus.c user/markj/netdump/sys/dev/md/md.c user/markj/netdump/sys/dev/mfi/mfi.c user/markj/netdump/sys/dev/mlx5/mlx5_en/mlx5_en_main.c user/markj/netdump/sys/dev/mpr/mpr_user.c user/markj/netdump/sys/dev/mps/mps_user.c user/markj/netdump/sys/dev/mrsas/mrsas_linux.c user/markj/netdump/sys/dev/neta/if_mvneta_fdt.c user/markj/netdump/sys/dev/netmap/if_em_netmap.h user/markj/netdump/sys/dev/netmap/if_igb_netmap.h user/markj/netdump/sys/dev/netmap/if_ixl_netmap.h user/markj/netdump/sys/dev/netmap/if_lem_netmap.h user/markj/netdump/sys/dev/netmap/if_ptnet.c user/markj/netdump/sys/dev/netmap/if_re_netmap.h user/markj/netdump/sys/dev/netmap/if_vtnet_netmap.h user/markj/netdump/sys/dev/netmap/ixgbe_netmap.h user/markj/netdump/sys/dev/netmap/netmap.c user/markj/netdump/sys/dev/netmap/netmap_freebsd.c user/markj/netdump/sys/dev/netmap/netmap_generic.c user/markj/netdump/sys/dev/netmap/netmap_kern.h user/markj/netdump/sys/dev/netmap/netmap_mem2.c user/markj/netdump/sys/dev/netmap/netmap_mem2.h user/markj/netdump/sys/dev/netmap/netmap_monitor.c user/markj/netdump/sys/dev/netmap/netmap_offloadings.c user/markj/netdump/sys/dev/netmap/netmap_pipe.c user/markj/netdump/sys/dev/netmap/netmap_pt.c user/markj/netdump/sys/dev/netmap/netmap_vale.c user/markj/netdump/sys/dev/null/null.c user/markj/netdump/sys/dev/ofw/ofw_bus_subr.c user/markj/netdump/sys/dev/ofw/ofw_bus_subr.h user/markj/netdump/sys/dev/ofw/openfirm.c user/markj/netdump/sys/dev/ofw/openfirm.h user/markj/netdump/sys/dev/pci/pci_user.c user/markj/netdump/sys/dev/rp/rp.c user/markj/netdump/sys/dev/sio/sio.c user/markj/netdump/sys/dev/spibus/ofw_spibus.c user/markj/netdump/sys/dev/spibus/spibus.c user/markj/netdump/sys/dev/spibus/spibusvar.h user/markj/netdump/sys/dev/spibus/spigen.c user/markj/netdump/sys/dev/syscons/scvidctl.c user/markj/netdump/sys/dev/syscons/syscons.c user/markj/netdump/sys/dev/uart/uart_kbd_sun.c user/markj/netdump/sys/dev/usb/controller/ehci_fsl.c user/markj/netdump/sys/dev/usb/input/ukbd.c user/markj/netdump/sys/dev/vkbd/vkbd.c user/markj/netdump/sys/dev/vmware/vmci/vmci.c user/markj/netdump/sys/dev/vmware/vmci/vmci.h user/markj/netdump/sys/dev/vmware/vmci/vmci_call_defs.h user/markj/netdump/sys/dev/vmware/vmci/vmci_datagram.c user/markj/netdump/sys/dev/vmware/vmci/vmci_datagram.h user/markj/netdump/sys/dev/vmware/vmci/vmci_defs.h user/markj/netdump/sys/dev/vmware/vmci/vmci_doorbell.c user/markj/netdump/sys/dev/vmware/vmci/vmci_doorbell.h user/markj/netdump/sys/dev/vmware/vmci/vmci_driver.c user/markj/netdump/sys/dev/vmware/vmci/vmci_driver.h user/markj/netdump/sys/dev/vmware/vmci/vmci_event.c user/markj/netdump/sys/dev/vmware/vmci/vmci_event.h user/markj/netdump/sys/dev/vmware/vmci/vmci_hashtable.c user/markj/netdump/sys/dev/vmware/vmci/vmci_hashtable.h user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_api.h user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_api_1.h user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_api_2.h user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_defs.h user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_if.c user/markj/netdump/sys/dev/vmware/vmci/vmci_kernel_if.h user/markj/netdump/sys/dev/vmware/vmci/vmci_qpair.c user/markj/netdump/sys/dev/vmware/vmci/vmci_queue.h user/markj/netdump/sys/dev/vmware/vmci/vmci_queue_pair.c user/markj/netdump/sys/dev/vmware/vmci/vmci_queue_pair.h user/markj/netdump/sys/dev/vmware/vmci/vmci_resource.c user/markj/netdump/sys/dev/vmware/vmci/vmci_resource.h user/markj/netdump/sys/dev/vmware/vmci/vmci_utils.h user/markj/netdump/sys/dev/vnic/thunder_bgx_fdt.c user/markj/netdump/sys/dev/vt/vt_core.c user/markj/netdump/sys/dev/vt/vt_font.c user/markj/netdump/sys/dts/arm/armada-380.dtsi user/markj/netdump/sys/dts/arm/armada-385.dtsi user/markj/netdump/sys/dts/arm/db78460.dts user/markj/netdump/sys/dts/arm/rpi.dts user/markj/netdump/sys/dts/arm/rpi2.dts user/markj/netdump/sys/fs/cd9660/iso.h user/markj/netdump/sys/fs/cuse/cuse.c user/markj/netdump/sys/fs/devfs/devfs_devs.c user/markj/netdump/sys/fs/procfs/procfs_dbregs.c user/markj/netdump/sys/fs/procfs/procfs_fpregs.c user/markj/netdump/sys/fs/procfs/procfs_ioctl.c user/markj/netdump/sys/fs/procfs/procfs_map.c user/markj/netdump/sys/fs/procfs/procfs_regs.c user/markj/netdump/sys/geom/geom_dev.c user/markj/netdump/sys/geom/geom_subr.c user/markj/netdump/sys/geom/label/g_label_disk_ident.c user/markj/netdump/sys/geom/raid/md_ddf.c user/markj/netdump/sys/geom/raid/md_intel.c user/markj/netdump/sys/i386/i386/genassym.c user/markj/netdump/sys/i386/i386/locore.s user/markj/netdump/sys/i386/i386/machdep.c user/markj/netdump/sys/i386/i386/mp_machdep.c user/markj/netdump/sys/i386/i386/sigtramp.s user/markj/netdump/sys/i386/i386/vm_machdep.c user/markj/netdump/sys/i386/include/smp.h user/markj/netdump/sys/i386/linux/linux_dummy.c user/markj/netdump/sys/i386/linux/linux_sysvec.c user/markj/netdump/sys/kern/imgact_elf.c user/markj/netdump/sys/kern/init_sysent.c user/markj/netdump/sys/kern/kern_descrip.c user/markj/netdump/sys/kern/kern_event.c user/markj/netdump/sys/kern/kern_exec.c user/markj/netdump/sys/kern/kern_exit.c user/markj/netdump/sys/kern/kern_jail.c user/markj/netdump/sys/kern/kern_mib.c user/markj/netdump/sys/kern/kern_module.c user/markj/netdump/sys/kern/kern_proc.c user/markj/netdump/sys/kern/kern_prot.c user/markj/netdump/sys/kern/kern_resource.c user/markj/netdump/sys/kern/kern_sendfile.c user/markj/netdump/sys/kern/kern_sharedpage.c user/markj/netdump/sys/kern/kern_sig.c user/markj/netdump/sys/kern/kern_sysctl.c user/markj/netdump/sys/kern/kern_tc.c user/markj/netdump/sys/kern/kern_thr.c user/markj/netdump/sys/kern/kern_umtx.c user/markj/netdump/sys/kern/kern_xxx.c user/markj/netdump/sys/kern/makesyscalls.sh user/markj/netdump/sys/kern/subr_dummy_vdso_tc.c user/markj/netdump/sys/kern/subr_lock.c user/markj/netdump/sys/kern/sys_generic.c user/markj/netdump/sys/kern/sys_getrandom.c user/markj/netdump/sys/kern/sys_pipe.c user/markj/netdump/sys/kern/sys_process.c user/markj/netdump/sys/kern/syscalls.master user/markj/netdump/sys/kern/sysv_ipc.c user/markj/netdump/sys/kern/sysv_msg.c user/markj/netdump/sys/kern/sysv_sem.c user/markj/netdump/sys/kern/sysv_shm.c user/markj/netdump/sys/kern/tty.c user/markj/netdump/sys/kern/tty_compat.c user/markj/netdump/sys/kern/uipc_mqueue.c user/markj/netdump/sys/kern/uipc_sem.c user/markj/netdump/sys/kern/uipc_socket.c user/markj/netdump/sys/kern/uipc_syscalls.c user/markj/netdump/sys/kern/vfs_aio.c user/markj/netdump/sys/kern/vfs_bio.c user/markj/netdump/sys/kern/vfs_subr.c user/markj/netdump/sys/kern/vfs_syscalls.c user/markj/netdump/sys/mips/include/reg.h user/markj/netdump/sys/mips/include/sigframe.h user/markj/netdump/sys/mips/include/tls.h user/markj/netdump/sys/mips/include/ucontext.h user/markj/netdump/sys/mips/mediatek/mtk_pinctrl.c user/markj/netdump/sys/mips/mips/freebsd32_machdep.c user/markj/netdump/sys/mips/mips/pm_machdep.c user/markj/netdump/sys/mips/mips/swtch.S user/markj/netdump/sys/mips/mips/trap.c user/markj/netdump/sys/mips/mips/vm_machdep.c user/markj/netdump/sys/modules/aac/Makefile user/markj/netdump/sys/modules/aacraid/Makefile user/markj/netdump/sys/modules/cam/Makefile user/markj/netdump/sys/modules/cryptodev/Makefile user/markj/netdump/sys/modules/cuse/Makefile user/markj/netdump/sys/modules/drm2/drm2/Makefile user/markj/netdump/sys/modules/drm2/i915kms/Makefile user/markj/netdump/sys/modules/drm2/radeonkms/Makefile user/markj/netdump/sys/modules/dtrace/dtrace/Makefile user/markj/netdump/sys/modules/dtrace/dtraceall/Makefile user/markj/netdump/sys/modules/dtrace/dtraceall/dtraceall.c user/markj/netdump/sys/modules/dtrace/fasttrap/Makefile user/markj/netdump/sys/modules/filemon/Makefile user/markj/netdump/sys/modules/hyperv/vmbus/Makefile user/markj/netdump/sys/modules/if_tap/Makefile user/markj/netdump/sys/modules/isp/Makefile user/markj/netdump/sys/modules/kbdmux/Makefile user/markj/netdump/sys/modules/linux/Makefile user/markj/netdump/sys/modules/linux64/Makefile user/markj/netdump/sys/modules/linux_common/Makefile user/markj/netdump/sys/modules/mfi/Makefile user/markj/netdump/sys/modules/mpr/Makefile user/markj/netdump/sys/modules/mps/Makefile user/markj/netdump/sys/modules/mqueue/Makefile user/markj/netdump/sys/modules/procfs/Makefile user/markj/netdump/sys/modules/rp/Makefile user/markj/netdump/sys/modules/sem/Makefile user/markj/netdump/sys/modules/sgx/Makefile user/markj/netdump/sys/modules/sio/Makefile user/markj/netdump/sys/modules/spigen/Makefile user/markj/netdump/sys/modules/sysvipc/sysvmsg/Makefile user/markj/netdump/sys/modules/sysvipc/sysvsem/Makefile user/markj/netdump/sys/modules/sysvipc/sysvshm/Makefile user/markj/netdump/sys/modules/usb/ukbd/Makefile user/markj/netdump/sys/modules/vkbd/Makefile user/markj/netdump/sys/modules/vmware/vmci/Makefile user/markj/netdump/sys/net/bpf.c user/markj/netdump/sys/net/if.c user/markj/netdump/sys/net/if.h user/markj/netdump/sys/net/if_tap.c user/markj/netdump/sys/net/netmap.h user/markj/netdump/sys/net/netmap_user.h user/markj/netdump/sys/net/netmap_virt.h user/markj/netdump/sys/net/pfvar.h user/markj/netdump/sys/net/rtsock.c user/markj/netdump/sys/netinet/in_jail.c user/markj/netdump/sys/netinet/in_pcb.c user/markj/netdump/sys/netinet/in_prot.c user/markj/netdump/sys/netinet/sctp_input.c user/markj/netdump/sys/netinet/sctp_os_bsd.h user/markj/netdump/sys/netinet/sctp_syscalls.c user/markj/netdump/sys/netinet/sctp_usrreq.c user/markj/netdump/sys/netinet/tcp_subr.c user/markj/netdump/sys/netinet/tcp_usrreq.c user/markj/netdump/sys/netinet6/in6.c user/markj/netdump/sys/netinet6/in6_jail.c user/markj/netdump/sys/netinet6/sctp6_usrreq.c user/markj/netdump/sys/netpfil/pf/pf_ioctl.c user/markj/netdump/sys/netpfil/pf/pf_table.c user/markj/netdump/sys/opencrypto/cryptodev.c user/markj/netdump/sys/opencrypto/cryptosoft.c user/markj/netdump/sys/powerpc/aim/aim_machdep.c user/markj/netdump/sys/powerpc/aim/mmu_oea64.c user/markj/netdump/sys/powerpc/booke/booke_machdep.c user/markj/netdump/sys/powerpc/booke/pmap.c user/markj/netdump/sys/powerpc/include/reg.h user/markj/netdump/sys/powerpc/include/spr.h user/markj/netdump/sys/powerpc/mpc85xx/fsl_diu.c user/markj/netdump/sys/powerpc/ofw/ofw_real.c user/markj/netdump/sys/powerpc/powermac/macio.c user/markj/netdump/sys/powerpc/powermac/uninorth.c user/markj/netdump/sys/powerpc/powerpc/altivec.c user/markj/netdump/sys/powerpc/powerpc/cpu.c user/markj/netdump/sys/powerpc/powerpc/exec_machdep.c user/markj/netdump/sys/powerpc/powerpc/fpu.c user/markj/netdump/sys/powerpc/powerpc/machdep.c user/markj/netdump/sys/powerpc/powerpc/ptrace_machdep.c user/markj/netdump/sys/powerpc/powerpc/sys_machdep.c user/markj/netdump/sys/powerpc/powerpc/trap.c user/markj/netdump/sys/powerpc/psim/iobus.c user/markj/netdump/sys/sparc64/central/central.c user/markj/netdump/sys/sparc64/ebus/ebus.c user/markj/netdump/sys/sparc64/fhc/fhc.c user/markj/netdump/sys/sparc64/isa/isa.c user/markj/netdump/sys/sparc64/pci/ofw_pci.c user/markj/netdump/sys/sparc64/sbus/dma_sbus.c user/markj/netdump/sys/sparc64/sbus/sbus.c user/markj/netdump/sys/sparc64/sparc64/exception.S user/markj/netdump/sys/sparc64/sparc64/machdep.c user/markj/netdump/sys/sparc64/sparc64/nexus.c user/markj/netdump/sys/sparc64/sparc64/upa.c user/markj/netdump/sys/sys/module.h user/markj/netdump/sys/sys/param.h user/markj/netdump/sys/sys/spigenio.h user/markj/netdump/sys/teken/libteken/teken.3 user/markj/netdump/sys/teken/teken.c user/markj/netdump/sys/teken/teken.h user/markj/netdump/sys/teken/teken_scs.h user/markj/netdump/sys/teken/teken_subr.h user/markj/netdump/sys/teken/teken_subr_compat.h user/markj/netdump/sys/teken/teken_wcwidth.h user/markj/netdump/sys/ufs/ffs/ffs_softdep.c user/markj/netdump/sys/ufs/ffs/softdep.h user/markj/netdump/sys/vm/swap_pager.c user/markj/netdump/sys/vm/vm_meter.c user/markj/netdump/sys/vm/vm_mmap.c user/markj/netdump/sys/vm/vm_page.c user/markj/netdump/sys/vm/vm_page.h user/markj/netdump/sys/vm/vm_unix.c user/markj/netdump/sys/x86/include/init.h user/markj/netdump/sys/x86/include/x86_smp.h user/markj/netdump/sys/x86/x86/cpu_machdep.c user/markj/netdump/sys/x86/x86/mp_x86.c user/markj/netdump/sys/x86/x86/tsc.c user/markj/netdump/tests/sys/netpfil/pf/Makefile user/markj/netdump/tools/diag/prtblknos/Makefile user/markj/netdump/tools/diag/prtblknos/prtblknos.c user/markj/netdump/usr.bin/Makefile user/markj/netdump/usr.bin/vtfontcvt/vtfontcvt.c user/markj/netdump/usr.sbin/bhyve/bhyve.8 user/markj/netdump/usr.sbin/bhyve/bhyverun.c user/markj/netdump/usr.sbin/bhyvectl/bhyvectl.c user/markj/netdump/usr.sbin/syslogd/Makefile user/markj/netdump/usr.sbin/syslogd/syslogd.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/Makefile.inc1 ============================================================================== --- user/markj/netdump/Makefile.inc1 Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/Makefile.inc1 Mon Apr 9 21:38:45 2018 (r332339) @@ -802,11 +802,13 @@ _sanity_check: .PHONY .MAKE # tree changes, particularly with respect to removing source files and # replacing generated files. Handle these cases here in an ad-hoc fashion. _cleanobj_fast_depend_hack: .PHONY -# Syscall stubs rewritten in C +# Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls -# 20160829 r305012 ptrace # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs -.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs +# 20180404 r332048 sigreturn +# 20180405 r332080 shmat +# 20180406 r332119 setlogin +.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ Modified: user/markj/netdump/UPDATING ============================================================================== --- user/markj/netdump/UPDATING Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/UPDATING Mon Apr 9 21:38:45 2018 (r332339) @@ -51,6 +51,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180406: + In addition to supporting RFC 3164 formatted messages, the + syslogd(8) service is now capable of parsing RFC 5424 formatted + log messages. The main benefit of using RFC 5424 is that clients + may now send log messages with timestamps containing year numbers, + microseconds and time zone offsets. + + Similarly, the syslog(3) C library function has been altered to + send RFC 5424 formatted messages to the local system logging + daemon. On systems using syslogd(8), this change should have no + negative impact, as long as syslogd(8) and the C library are + updated at the same time. On systems using a different system + logging daemon, it may be necessary to make configuration + adjustments, depending on the software used. + + When using syslog-ng, add the 'syslog-protocol' flag to local + input sources to enable parsing of RFC 5424 formatted messages: + + source src { + unix-dgram("/var/run/log" flags(syslog-protocol)); + } + + When using rsyslog, disable the 'SysSock.UseSpecialParser' option + of the 'imuxsock' module to let messages be processed by the + regular RFC 3164/5424 parsing pipeline: + + module(load="imuxsock" SysSock.UseSpecialParser="off") + + Do note that these changes only affect communication between local + applications and syslogd(8). The format that syslogd(8) uses to + store messages on disk or forward messages to other systems + remains unchanged. syslogd(8) still uses RFC 3164 for these + purposes. Options to customize this behaviour will be added in the + future. Utilities that process log files stored in /var/log are + thus expected to continue to function as before. + + __FreeBSD_version has been incremented to 1200061 to denote this + change. + 20180328: Support for token ring networks has been removed. If you have "device token" in your kernel config you should remove Modified: user/markj/netdump/etc/mtree/BSD.include.dist ============================================================================== --- user/markj/netdump/etc/mtree/BSD.include.dist Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/etc/mtree/BSD.include.dist Mon Apr 9 21:38:45 2018 (r332339) @@ -319,6 +319,18 @@ .. nfsserver .. + opencsd + c_api + .. + etmv3 + .. + etmv4 + .. + ptm + .. + stm + .. + .. openssl .. pcap Modified: user/markj/netdump/etc/mtree/BSD.tests.dist ============================================================================== --- user/markj/netdump/etc/mtree/BSD.tests.dist Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/etc/mtree/BSD.tests.dist Mon Apr 9 21:38:45 2018 (r332339) @@ -742,6 +742,8 @@ .. netpfil pf + ioctl + .. .. .. opencrypto Modified: user/markj/netdump/include/pthread.h ============================================================================== --- user/markj/netdump/include/pthread.h Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/include/pthread.h Mon Apr 9 21:38:45 2018 (r332339) @@ -48,8 +48,6 @@ #include #include -__NULLABILITY_PRAGMA_PUSH - /* * Run-time invariant values: */ @@ -151,35 +149,33 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t * _Nonnull); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( - const pthread_attr_t * _Nonnull __restrict, - void ** _Nonnull __restrict, - size_t * _Nonnull __restrict); -int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); -int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); + const pthread_attr_t * __restrict, void ** __restrict, + size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, + size_t *); +int pthread_attr_getguardsize(const pthread_attr_t *, + size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_init(pthread_attr_t * _Nonnull); -int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *, +int pthread_attr_getdetachstate(const pthread_attr_t *, + int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int); -int pthread_barrier_destroy(pthread_barrier_t * _Nonnull); -int pthread_barrier_init(pthread_barrier_t * _Nonnull, +int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_barrier_destroy(pthread_barrier_t *); +int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); -int pthread_barrier_wait(pthread_barrier_t * _Nonnull); -int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull); +int pthread_barrier_wait(pthread_barrier_t *); +int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t * _Nonnull, int * _Nonnull); -int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull); -int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull, - int); + const pthread_barrierattr_t *, int *); +int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ { \ @@ -194,108 +190,99 @@ int pthread_barrierattr_setpshared(pthread_barrieratt __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t * _Nonnull); -int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull, - clockid_t * _Nonnull); -int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull, - int * _Nonnull); -int pthread_condattr_init(pthread_condattr_t * _Nonnull); -int pthread_condattr_setclock(pthread_condattr_t * _Nonnull, - clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int); -int pthread_cond_broadcast(pthread_cond_t * _Nonnull); -int pthread_cond_destroy(pthread_cond_t * _Nonnull); -int pthread_cond_init(pthread_cond_t * _Nonnull, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t * _Nonnull); -int pthread_cond_timedwait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getclock(const pthread_condattr_t *, + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t * __mutex, + const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex) +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *, - void *(* _Nonnull) (void *), void *); +int pthread_create(pthread_t *, const pthread_attr_t *, + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t * _Nonnull, - void (*) (void *)); +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t * _Nonnull, int * _Nonnull); -int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull, - int * _Nonnull); -int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull, - int); -int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); +int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex, +int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t *) __requires_unlocked(*__mutex); -int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); -int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_mutex_timedlock(pthread_mutex_t * __mutex, + const struct timespec *) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t * _Nonnull, - void (* _Nonnull) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_once(pthread_once_t *, void (*) (void)); +int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock, +int pthread_rwlock_init(pthread_rwlock_t * __rwlock, const pthread_rwlockattr_t *) __requires_unlocked(*__rwlock); -int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __unlocks(*__rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t * _Nonnull, int *); -int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t * _Nonnull, int * _Nonnull); -int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull, +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull, - int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int) +int pthread_spin_init(pthread_spinlock_t * __spin, int) __requires_unlocked(*__spin); -int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_destroy(pthread_spinlock_t * __spin) __requires_unlocked(*__spin); -int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_lock(pthread_spinlock_t * __spin) __locks_exclusive(*__spin); -int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_trylock(pthread_spinlock_t * __spin) __trylocks_exclusive(0, *__spin); -int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_unlock(pthread_spinlock_t * __spin) __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); @@ -317,27 +304,23 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( - pthread_mutexattr_t * _Nonnull __restrict, - int * _Nonnull __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, - int); + pthread_mutexattr_t * __restrict, int * __restrict); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); -int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull, - struct sched_param * _Nonnull); -int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_getscope(const pthread_attr_t * _Nonnull, - int * _Nonnull); +int pthread_attr_getschedparam(const pthread_attr_t *, + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); -int pthread_attr_setschedparam(pthread_attr_t * _Nonnull, - const struct sched_param * _Nonnull); -int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int); -int pthread_attr_setscope(pthread_attr_t * _Nonnull, int); -int pthread_getschedparam(pthread_t pthread, int * _Nonnull, - struct sched_param * _Nonnull); +int pthread_attr_setschedparam(pthread_attr_t *, + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); +int pthread_getschedparam(pthread_t pthread, int *, + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param * _Nonnull); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); @@ -347,6 +330,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), voi struct _pthread_cleanup_info *); void __pthread_cleanup_pop_imp(int); __END_DECLS -__NULLABILITY_PRAGMA_POP #endif /* !_PTHREAD_H_ */ Modified: user/markj/netdump/include/stdio.h ============================================================================== --- user/markj/netdump/include/stdio.h Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/include/stdio.h Mon Apr 9 21:38:45 2018 (r332339) @@ -51,6 +51,11 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #if __POSIX_VISIBLE >= 200809 #ifndef _OFF_T_DECLARED #define _OFF_T_DECLARED @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t int getc(FILE *); int getchar(void); char *gets(char *); +#if __EXT1_VISIBLE +char *gets_s(char *, rsize_t); +#endif void perror(const char *); int printf(const char * __restrict, ...); int putc(int, FILE *); Modified: user/markj/netdump/lib/Makefile ============================================================================== --- user/markj/netdump/lib/Makefile Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/Makefile Mon Apr 9 21:38:45 2018 (r332339) @@ -175,6 +175,10 @@ SUBDIR.${MK_NIS}+= libypclnt _libvgl= libvgl .endif +.if ${MACHINE_CPUARCH} == "aarch64" +SUBDIR.${MK_PMC}+= libopencsd +.endif + .if ${MACHINE_CPUARCH} == "amd64" SUBDIR.${MK_PMC}+= libipt SUBDIR.${MK_BHYVE}+= libvmmapi Modified: user/markj/netdump/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/aarch64/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/aarch64/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -5,8 +5,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c MDASM= cerror.S \ - shmat.S \ - sigreturn.S \ syscall.S \ vfork.S Modified: user/markj/netdump/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -9,7 +9,7 @@ SRCS+= \ amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S + sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/arm/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/arm/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/arm/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/gen/getlogin.c ============================================================================== --- user/markj/netdump/lib/libc/gen/getlogin.c Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/gen/getlogin.c Mon Apr 9 21:38:45 2018 (r332339) @@ -47,62 +47,33 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" -#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex) -#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex) - extern int _getlogin(char *, int); -int _logname_valid __hidden; /* known to setlogin() */ -static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER; - -static char * -getlogin_basic(int *status) -{ - static char logname[MAXLOGNAME]; - - if (_logname_valid == 0) { - if (_getlogin(logname, sizeof(logname)) < 0) { - *status = errno; - return (NULL); - } - _logname_valid = 1; - } - *status = 0; - return (*logname ? logname : NULL); -} - char * getlogin(void) { - char *result; - int status; + static char logname[MAXLOGNAME]; - THREAD_LOCK(); - result = getlogin_basic(&status); - THREAD_UNLOCK(); - return (result); + if (_getlogin(logname, sizeof(logname)) < 0) + return (NULL); + return (logname[0] != '\0' ? logname : NULL); } int getlogin_r(char *logname, int namelen) { - char *result; + char tmpname[MAXLOGNAME]; int len; - int status; if (namelen < 1) return (ERANGE); logname[0] = '\0'; - THREAD_LOCK(); - result = getlogin_basic(&status); - if (status == 0 && result != NULL) { - len = strlen(result) + 1; - if (len > namelen) - status = ERANGE; - else - strncpy(logname, result, len); - } - THREAD_UNLOCK(); - return (status); + if (_getlogin(tmpname, sizeof(tmpname)) < 0) + return (errno); + len = strlen(tmpname) + 1; + if (len > namelen) + return (ERANGE); + strlcpy(logname, tmpname, len); + return (0); } Modified: user/markj/netdump/lib/libc/gen/syslog.3 ============================================================================== --- user/markj/netdump/lib/libc/gen/syslog.3 Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/gen/syslog.3 Mon Apr 9 21:38:45 2018 (r332339) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 5, 2017 +.Dd April 6, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -156,6 +156,9 @@ Write the message to standard error output as well to .It Dv LOG_PID Log the process id with each message: useful for identifying instantiations of daemons. +On +.Fx , +this option is enabled by default. .El .Pp The Modified: user/markj/netdump/lib/libc/gen/syslog.c ============================================================================== --- user/markj/netdump/lib/libc/gen/syslog.c Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/gen/syslog.c Mon Apr 9 21:38:45 2018 (r332339) @@ -36,9 +36,10 @@ static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include +#include #include #include +#include #include #include #include @@ -134,11 +135,13 @@ syslog(int pri, const char *fmt, ...) static void vsyslog1(int pri, const char *fmt, va_list ap) { - int cnt; + struct timeval now; + struct tm tm; char ch, *p; - time_t now; - int fd, saved_errno; - char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26], errstr[64]; + long tz_offset; + int cnt, fd, saved_errno; + char hostname[MAXHOSTNAMELEN], *stdp, tbuf[2048], fmt_cpy[1024], + errstr[64], tz_sign; FILE *fp, *fmt_fp; struct bufcookie tbuf_cookie; struct bufcookie fmt_cookie; @@ -168,24 +171,46 @@ vsyslog1(int pri, const char *fmt, va_list ap) if (fp == NULL) return; - /* Build the message. */ - (void)time(&now); - (void)fprintf(fp, "<%d>", pri); - (void)fprintf(fp, "%.15s ", ctime_r(&now, timbuf) + 4); + /* Build the message according to RFC 5424. Tag and version. */ + (void)fprintf(fp, "<%d>1 ", pri); + /* Timestamp similar to RFC 3339. */ + if (gettimeofday(&now, NULL) == 0 && + localtime_r(&now.tv_sec, &tm) != NULL) { + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + (void)fprintf(fp, + "%04d-%02d-%02d" /* Date. */ + "T%02d:%02d:%02d.%06ld" /* Time. */ + "%c%02ld:%02ld ", /* Time zone offset. */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, now.tv_usec, + tz_sign, tz_offset / 3600, (tz_offset % 3600) / 60); + } else + (void)fprintf(fp, "- "); + /* Hostname. */ + (void)gethostname(hostname, sizeof(hostname)); + (void)fprintf(fp, "%s ", hostname); if (LogStat & LOG_PERROR) { /* Transfer to string buffer */ (void)fflush(fp); stdp = tbuf + (sizeof(tbuf) - tbuf_cookie.left); } + /* + * Application name, process ID, message ID and structured data. + * Provide the process ID regardless of whether LOG_PID has been + * specified, as it provides valuable information. Many + * applications tend not to use this, even though they should. + */ if (LogTag == NULL) LogTag = _getprogname(); - if (LogTag != NULL) - (void)fprintf(fp, "%s", LogTag); - if (LogStat & LOG_PID) - (void)fprintf(fp, "[%d]", getpid()); - if (LogTag != NULL) { - (void)fprintf(fp, ": "); - } + (void)fprintf(fp, "%s %d - - ", + LogTag == NULL ? "-" : LogTag, getpid()); /* Check to see if we can skip expanding the %m */ if (strstr(fmt, "%m")) { @@ -313,7 +338,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) struct iovec iov[2]; struct iovec *v = iov; - p = strchr(tbuf, '>') + 1; + p = strchr(tbuf, '>') + 3; v->iov_base = p; v->iov_len = cnt - (p - tbuf); ++v; Modified: user/markj/netdump/lib/libc/i386/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/i386/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/i386/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_io i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S syscall.S + sbrk.S syscall.S NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: user/markj/netdump/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/riscv/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/riscv/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -2,10 +2,7 @@ SRCS+= trivial-vdso_tc.c -#MDASM= ptrace.S MDASM= cerror.S \ - shmat.S \ - sigreturn.S \ syscall.S \ vfork.S Modified: user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S Modified: user/markj/netdump/lib/libc/stdio/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/stdio/Makefile.inc Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/stdio/Makefile.inc Mon Apr 9 21:38:45 2018 (r332339) @@ -14,7 +14,7 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c dprintf.c \ fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ fwrite.c getc.c getchar.c getdelim.c getline.c \ - gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ + gets.c gets_s.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ open_memstream.c open_wmemstream.c \ perror.c printf.c printf-pos.c putc.c putchar.c \ puts.c putw.c putwc.c putwchar.c \ @@ -50,6 +50,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ ferror.3 fileno.3 ferror.3 fileno_unlocked.3 MLINKS+=fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 +MLINKS+=fgets.3 gets_s.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 MLINKS+=fputs.3 puts.3 Modified: user/markj/netdump/lib/libc/stdio/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/stdio/Symbol.map Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/stdio/Symbol.map Mon Apr 9 21:38:45 2018 (r332339) @@ -167,6 +167,10 @@ FBSD_1.4 { fopencookie; }; +FBSD_1.5 { + gets_s; +}; + FBSDprivate_1.0 { _flockfile; _flockfile_debug_stub; Modified: user/markj/netdump/lib/libc/stdio/fgets.3 ============================================================================== --- user/markj/netdump/lib/libc/stdio/fgets.3 Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/stdio/fgets.3 Mon Apr 9 21:38:45 2018 (r332339) @@ -32,12 +32,13 @@ .\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 5, 2012 +.Dd April 3, 2018 .Dt FGETS 3 .Os .Sh NAME .Nm fgets , -.Nm gets +.Nm gets , +.Nm gets_s .Nd get a line from a stream .Sh LIBRARY .Lb libc @@ -46,6 +47,8 @@ .Ft char * .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" .Ft char * +.Fn gets_s "char *str" "rsize_t size" +.Ft char * .Fn gets "char *str" .Sh DESCRIPTION The @@ -65,6 +68,17 @@ If any characters are read and there is no error, a character is appended to end the string. .Pp The +.Fn gets_s +function +is equivalent to +.Fn fgets +with a +.Fa stream +of +.Dv stdin , +except that the newline character (if any) is not stored in the string. +.Pp +The .Fn gets function is equivalent to @@ -80,7 +94,8 @@ It is the caller's responsibility to ensure that the i if any, is sufficiently short to fit in the string. .Sh RETURN VALUES Upon successful completion, -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets return @@ -94,7 +109,8 @@ they return .Dv NULL and the buffer contents are indeterminate. The -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets functions @@ -141,6 +157,13 @@ and .Fn gets conform to .St -isoC-99 . +.Fn gets_s +conforms to +.St -isoC-2011 +K.3.7.4.1. +.Fn gets +has been removed from +.St -isoC-2011 . .Sh SECURITY CONSIDERATIONS The .Fn gets Copied: user/markj/netdump/lib/libc/stdio/gets_s.c (from r332338, head/lib/libc/stdio/gets_s.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/stdio/gets_s.c Mon Apr 9 21:38:45 2018 (r332339, copy of r332338, head/lib/libc/stdio/gets_s.c) @@ -0,0 +1,102 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017, 2018 + * Cyril S. E. Schubert. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +static inline char * +_gets_s(char *buf, rsize_t n) +{ + int c; + char *s; + + ORIENT(stdin, -1); + for (s = buf, n--; (c = __sgetc(stdin)) != '\n' && n > 0 ; n--) { + if (c == EOF) { + if (s == buf) { + return (NULL); + } else + break; + } else + *s++ = c; + } + + /* + * If end of buffer reached, discard until \n or eof. + * Then throw an error. + */ + if (n == 0) { + /* discard */ + while ((c = __sgetc(stdin)) != '\n' && c != EOF); + /* throw the error after lock released prior to exit */ + __throw_constraint_handler_s("gets_s : end of buffer", E2BIG); + return (NULL); + } + *s = 0; + return (buf); +} + +/* ISO/IEC 9899:2011 K.3.7.4.1 */ +char * +gets_s(char *buf, rsize_t n) +{ + char *ret; + if (buf == NULL) { + __throw_constraint_handler_s("gets_s : str is NULL", EINVAL); + return(NULL); + } else if (n > RSIZE_MAX) { + __throw_constraint_handler_s("gets_s : n > RSIZE_MAX", + EINVAL); + return(NULL); + } else if (n == 0) { + __throw_constraint_handler_s("gets_s : n == 0", EINVAL); + return(NULL); + } + + FLOCKFILE_CANCELSAFE(stdin); + ret = _gets_s(buf, n); + FUNLOCKFILE_CANCELSAFE(); + return (ret); +} Modified: user/markj/netdump/lib/libc/tests/stdio/Makefile ============================================================================== --- user/markj/netdump/lib/libc/tests/stdio/Makefile Mon Apr 9 21:37:39 2018 (r332338) +++ user/markj/netdump/lib/libc/tests/stdio/Makefile Mon Apr 9 21:38:45 2018 (r332339) @@ -7,6 +7,7 @@ ATF_TESTS_C+= fmemopen2_test ATF_TESTS_C+= fopen2_test ATF_TESTS_C+= freopen_test ATF_TESTS_C+= getdelim_test +ATF_TESTS_C+= gets_s_test ATF_TESTS_C+= mkostemp_test ATF_TESTS_C+= open_memstream2_test ATF_TESTS_C+= open_wmemstream_test Copied: user/markj/netdump/lib/libc/tests/stdio/gets_s_test.c (from r332338, head/lib/libc/tests/stdio/gets_s_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/tests/stdio/gets_s_test.c Mon Apr 9 21:38:45 2018 (r332339, copy of r332338, head/lib/libc/tests/stdio/gets_s_test.c) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2017 Cyril S. E. Schubert. 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +static errno_t error_code; +static const char * message; + +void +h(const char * msg, void * ptr __unused, errno_t error) +{ + error_code = error; + message = msg; +} + +/* null ptr */ +ATF_TC_WITHOUT_HEAD(null_ptr); +ATF_TC_BODY(null_ptr, tc) +{ + ATF_CHECK_MSG(gets_s(NULL, 1) == NULL, + "gets_s() failed to handle NULL pointer"); +} + +/* normal */ +ATF_TC_WITHOUT_HEAD(normal); +ATF_TC_BODY(normal, tc) +{ + pid_t kidpid; + int fd[2]; + int nfd; + + // close(STDIN_FILENO); + // close(STDOUT_FILENO); + pipe(fd); + + if ((kidpid = fork()) == 0) { + char b[10]; + + close(fd[1]); + nfd = dup2(fd[0], 0); + close(fd[0]); + stdin = fdopen(nfd, "r"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Apr 10 08:56:49 2018 Return-Path: Delivered-To: svn-src-user@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 D09FBF8A574 for ; Tue, 10 Apr 2018 08:56:48 +0000 (UTC) (envelope-from pho@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 83C1C6B752; Tue, 10 Apr 2018 08:56:48 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A41A32BC; Tue, 10 Apr 2018 08:56:48 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A8umJF022477; Tue, 10 Apr 2018 08:56:48 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A8umRx022475; Tue, 10 Apr 2018 08:56:48 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201804100856.w3A8umRx022475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Tue, 10 Apr 2018 08:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332355 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 332355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:56:49 -0000 Author: pho Date: Tue Apr 10 08:56:47 2018 New Revision: 332355 URL: https://svnweb.freebsd.org/changeset/base/332355 Log: Added two mdconfig(8) test scenarios. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/mdconfig.sh (contents, props changed) user/pho/stress2/misc/mdconfig2.sh (contents, props changed) Added: user/pho/stress2/misc/mdconfig.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mdconfig.sh Tue Apr 10 08:56:47 2018 (r332355) @@ -0,0 +1,40 @@ +#!/bin/sh + +# +# Copyright (c) 2016 Dell EMC Isilon +# 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$ +# + +. ../default.cfg + +# Regression test for: +# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214721 +# https://people.freebsd.org/~pho/stress/log/mdconfig.txt + +mdconfig -at swap -S 65536 -s 20M -u $mdstart +mdconfig -d -u $mdstart + +exit 0 Added: user/pho/stress2/misc/mdconfig2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mdconfig2.sh Tue Apr 10 08:56:47 2018 (r332355) @@ -0,0 +1,55 @@ +#!/bin/sh + +# +# Copyright (c) 2018 Dell EMC Isilon +# 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$ +# + +# /dev/md* fails to be created. +# "kernel: g_dev_taste: make_dev_p() failed (gp->name=md10, error=17)" seen. +# The cause is that the device node is removed asynchronously. + +. ../default.cfg +[ `id -u` -ne 0 ] && echo "Must be root!" && exit 1 + +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -l | grep -q md$mdstart && + { echo FAIL; ls -l /dev/md$mdstart; mdconfig -lv; exit 1; } + +s=0 +start=`date +%s` +workaround=${workaround:-0} +while [ $((`date +%s` - start)) -lt 60 ]; do + mdconfig -a -t swap -s 100m -u $mdstart || { s=2; break; } + [ -c /dev/md$mdstart ] || + { echo FAIL; ls -l /dev/md$mdstart; mdconfig -lv; exit 3; } + mdconfig -d -u $mdstart || { s=4; break; } + while [ $workaround -eq 1 -a -c /dev/md$mdstart ]; do + echo "Note: Waiting for removal of /dev/md$mdstart" + sleep .1 + done +done +exit $s From owner-svn-src-user@freebsd.org Tue Apr 10 09:01:06 2018 Return-Path: Delivered-To: svn-src-user@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 6D953F8ACC9 for ; Tue, 10 Apr 2018 09:01:06 +0000 (UTC) (envelope-from pho@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 1D2CF6BEB7; Tue, 10 Apr 2018 09:01:06 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 155F632EE; Tue, 10 Apr 2018 09:01:06 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A915bE022711; Tue, 10 Apr 2018 09:01:05 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A915SW022710; Tue, 10 Apr 2018 09:01:05 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201804100901.w3A915SW022710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Tue, 10 Apr 2018 09:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332356 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 332356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 09:01:06 -0000 Author: pho Date: Tue Apr 10 09:01:05 2018 New Revision: 332356 URL: https://svnweb.freebsd.org/changeset/base/332356 Log: Do not trust /dev/md* when detaching memory disks. See test mdconfig2.sh Style fix, while here. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/cleanup.sh Modified: user/pho/stress2/misc/cleanup.sh ============================================================================== --- user/pho/stress2/misc/cleanup.sh Tue Apr 10 08:56:47 2018 (r332355) +++ user/pho/stress2/misc/cleanup.sh Tue Apr 10 09:01:05 2018 (r332356) @@ -36,7 +36,7 @@ MOUNTS=31 mount | grep -q "on $mntpoint " && umount -f $mntpoint rm -rf $mntpoint/stressX* rm -f /tmp/.snap/stress2* /var/.snap/stress2* -rm -rf /tmp/stressX.control $RUNDIR /tmp/misc.name +rm -rf /tmp/stressX.control $RUNDIR [ -d `dirname "$diskimage"` ] || mkdir -p `dirname "$diskimage"` mkdir -p $RUNDIR chmod 0777 $RUNDIR @@ -44,20 +44,26 @@ chmod 0777 $RUNDIR s=0 for i in `jot $MOUNTS 0 | sort -nr` ""; do while mount | grep -q "on ${mntpoint}$i "; do - fstat -mf ${mntpoint}$i | sed 1d | awk '{print $3}' | xargs kill + fstat -mf ${mntpoint}$i | sed 1d | awk '{print $3}' | \ + xargs kill umount -f ${mntpoint}$i > /dev/null 2>&1 || s=1 done done # Delete the test mount points /mnt0 .. /mnt31 for i in `jot $MOUNTS 0`; do if ! mount | grep -q "on ${mntpoint}$i "; then - [ -d ${mntpoint}$i ] && find ${mntpoint}$i -delete 2>/dev/null + [ -d ${mntpoint}$i ] && find ${mntpoint}$i -delete \ + 2>/dev/null rm -rf ${mntpoint}$i > /dev/null 2>&1 fi done [ -d "$mntpoint" ] && (cd $mntpoint && find . -delete) -for i in `jot $MOUNTS $mdstart`; do - [ -c /dev/md$i ] && { mdconfig -d -u $i || s=1; } +units=`mdconfig -l | sed 's/md//g'` +for u in $units; do + if [ $u -ge $mdstart -a $u -lt $((mdstart + MOUNTS)) ]; then + mdconfig -d -u $u || s=1 + [ -c /dev/md$u ] && sleep .1 + fi done # Delete $testuser's ipcs From owner-svn-src-user@freebsd.org Tue Apr 10 10:27:56 2018 Return-Path: Delivered-To: svn-src-user@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 0F9B7F9031E for ; Tue, 10 Apr 2018 10:27:56 +0000 (UTC) (envelope-from pho@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 B746F814CE; Tue, 10 Apr 2018 10:27:55 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B233E4598; Tue, 10 Apr 2018 10:27:55 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AARtRk067867; Tue, 10 Apr 2018 10:27:55 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AARtnk067866; Tue, 10 Apr 2018 10:27:55 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201804101027.w3AARtnk067866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Tue, 10 Apr 2018 10:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332357 - user/pho/stress2 X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2 X-SVN-Commit-Revision: 332357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 10:27:56 -0000 Author: pho Date: Tue Apr 10 10:27:55 2018 New Revision: 332357 URL: https://svnweb.freebsd.org/changeset/base/332357 Log: Added more ddb commands. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/ddb.conf Modified: user/pho/stress2/ddb.conf ============================================================================== --- user/pho/stress2/ddb.conf Tue Apr 10 09:01:05 2018 (r332356) +++ user/pho/stress2/ddb.conf Tue Apr 10 10:27:55 2018 (r332357) @@ -3,4 +3,5 @@ # ddb commands used for stress2 crash reports # -script stress2=bt; show allpcpu; show alllocks; show lockedvnods; show mount;ps; allt; call doadump; reset +script pho1=bt; show allpcpu; show alllocks; show lockedvnods; show allchains; show mount; show bufqueues; show page; show pageq +script pho=set $lines 20000; run pho1; show freepages; ps; allt; dump From owner-svn-src-user@freebsd.org Tue Apr 10 15:02:25 2018 Return-Path: Delivered-To: svn-src-user@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 7B741FA32CF for ; Tue, 10 Apr 2018 15:02:25 +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 2674381ECC; Tue, 10 Apr 2018 15:02:25 +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 2140071DC; Tue, 10 Apr 2018 15:02:25 +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 w3AF2PqK008052; Tue, 10 Apr 2018 15:02:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AF2Ovi008046; Tue, 10 Apr 2018 15:02:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804101502.w3AF2Ovi008046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Apr 2018 15:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332375 - in user/jeff/numa/sys: amd64/include vm X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/jeff/numa/sys: amd64/include vm X-SVN-Commit-Revision: 332375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:02:25 -0000 Author: markj Date: Tue Apr 10 15:02:24 2018 New Revision: 332375 URL: https://svnweb.freebsd.org/changeset/base/332375 Log: Update the batch queue changes. This mainly consists of refactoring the page queue scan code to reduce code duplication and diffs with HEAD. In addition, enqueues at the head of the inactive queue are now batched, and active queue scans are performed without requeuing. Modified: user/jeff/numa/sys/amd64/include/vmparam.h user/jeff/numa/sys/vm/vm_object.c user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_page.h user/jeff/numa/sys/vm/vm_pageout.c user/jeff/numa/sys/vm/vm_pagequeue.h Modified: user/jeff/numa/sys/amd64/include/vmparam.h ============================================================================== --- user/jeff/numa/sys/amd64/include/vmparam.h Tue Apr 10 14:44:07 2018 (r332374) +++ user/jeff/numa/sys/amd64/include/vmparam.h Tue Apr 10 15:02:24 2018 (r332375) @@ -228,8 +228,8 @@ #define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ /* - * Use a fairly large batch size since we expect amd64 systems to have - * lots of memory. + * Use a fairly large batch size since we expect amd64 systems to have lots of + * memory. */ #define VM_BATCHQUEUE_SIZE 31 Modified: user/jeff/numa/sys/vm/vm_object.c ============================================================================== --- user/jeff/numa/sys/vm/vm_object.c Tue Apr 10 14:44:07 2018 (r332374) +++ user/jeff/numa/sys/vm/vm_object.c Tue Apr 10 15:02:24 2018 (r332375) @@ -745,8 +745,6 @@ vm_object_terminate_pages(vm_object_t object) if (p->wire_count != 0) continue; VM_CNT_INC(v_pfree); - p->flags &= ~PG_ZERO; - vm_page_free(p); } if (mtx != NULL) @@ -1994,7 +1992,6 @@ again: } if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0) pmap_remove_all(p); - p->flags &= ~PG_ZERO; vm_page_free(p); } if (mtx != NULL) Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Tue Apr 10 14:44:07 2018 (r332374) +++ user/jeff/numa/sys/vm/vm_page.c Tue Apr 10 15:02:24 2018 (r332375) @@ -173,7 +173,8 @@ static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); -static void vm_page_enqueue_lazy(vm_page_t m, uint8_t queue); +static void vm_page_dequeue_complete(vm_page_t m); +static void vm_page_enqueue(vm_page_t m, uint8_t queue); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); @@ -2353,8 +2354,7 @@ retry: vm_reserv_size(level)) - pa); #endif } else if (object->memattr == VM_MEMATTR_DEFAULT && - m->queue != PQ_NONE && - (m->aflags & PGA_DEQUEUE) == 0 && !vm_page_busied(m)) { + vm_page_enqueued(m) && !vm_page_busied(m)) { /* * The page is allocated but eligible for * relocation. Extend the current run by one @@ -2505,9 +2505,7 @@ retry: error = EINVAL; else if (object->memattr != VM_MEMATTR_DEFAULT) error = EINVAL; - else if (m->queue != PQ_NONE && - (m->aflags & PGA_DEQUEUE) == 0 && - !vm_page_busied(m)) { + else if (vm_page_enqueued(m) && !vm_page_busied(m)) { KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has an unexpected memattr", m)); @@ -3046,81 +3044,76 @@ vm_page_pagequeue_lockptr(vm_page_t m) return (&vm_page_pagequeue(m)->pq_mutex); } +static inline void +vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m) +{ + struct vm_domain *vmd; + uint8_t aflags; + + vm_pagequeue_assert_locked(pq); + KASSERT(pq == vm_page_pagequeue(m), + ("page %p doesn't belong to %p", m, pq)); + + aflags = m->aflags; + if ((aflags & PGA_DEQUEUE) != 0) { + if (__predict_true((aflags & PGA_ENQUEUED) != 0)) { + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + vm_pagequeue_cnt_dec(pq); + } + vm_page_dequeue_complete(m); + } else if ((aflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { + if ((aflags & PGA_ENQUEUED) != 0) + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + else { + vm_pagequeue_cnt_inc(pq); + vm_page_aflag_set(m, PGA_ENQUEUED); + } + if ((aflags & PGA_REQUEUE_HEAD) != 0) { + KASSERT(m->queue == PQ_INACTIVE, + ("head enqueue not supported for page %p", m)); + vmd = vm_pagequeue_domain(m); + TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); + } else + TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); + + /* + * PGA_REQUEUE and PGA_REQUEUE_HEAD must be cleared after + * setting PGA_ENQUEUED in order to synchronize with the + * page daemon. + */ + vm_page_aflag_clear(m, PGA_REQUEUE | PGA_REQUEUE_HEAD); + } +} + static void vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_batchqueue *bq, uint8_t queue) { vm_page_t m; - int delta; - uint8_t aflags; + int i; - vm_pagequeue_assert_locked(pq); - - delta = 0; - VM_BATCHQ_FOREACH(bq, m) { + for (i = 0; i < bq->bq_cnt; i++) { + m = bq->bq_pa[i]; if (__predict_false(m->queue != queue)) continue; - - aflags = m->aflags; - if ((aflags & PGA_DEQUEUE) != 0) { - if (__predict_true((aflags & PGA_ENQUEUED) != 0)) { - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - delta--; - } - - /* - * Synchronize with the page daemon, which may be - * simultaneously scanning this page with only the page - * lock held. We must be careful to avoid leaving the - * page in a state where it appears to belong to a page - * queue. - */ - m->queue = PQ_NONE; - atomic_thread_fence_rel(); - vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); - } else if ((aflags & PGA_ENQUEUED) == 0) { - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - delta++; - vm_page_aflag_set(m, PGA_ENQUEUED); - if (__predict_false((aflags & PGA_REQUEUE) != 0)) - vm_page_aflag_clear(m, PGA_REQUEUE); - } else if ((aflags & PGA_REQUEUE) != 0) { - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - vm_page_aflag_clear(m, PGA_REQUEUE); - } + vm_pqbatch_process_page(pq, m); } vm_batchqueue_init(bq); - vm_pagequeue_cnt_add(pq, delta); } -/* - * vm_page_dequeue_lazy: [ internal use only ] - * - * Request removal of the given page from its current page - * queue. Physical removal from the queue may be deferred - * arbitrarily, and may be cancelled by later queue operations - * on that page. - * - * The page must be locked. - */ -void -vm_page_dequeue_lazy(vm_page_t m) +static void +vm_pqbatch_submit_page(vm_page_t m, uint8_t queue) { struct vm_batchqueue *bq; struct vm_pagequeue *pq; - int domain, queue; + int domain; vm_page_assert_locked(m); + KASSERT(queue < PQ_COUNT, ("invalid queue %d", queue)); - queue = m->queue; - if (queue == PQ_NONE) - return; domain = vm_phys_domain(m); - pq = &VM_DOMAIN(domain)->vmd_pagequeues[queue]; + pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; - vm_page_aflag_set(m, PGA_DEQUEUE); - critical_enter(); bq = DPCPU_PTR(pqbatch[domain][queue]); if (vm_batchqueue_insert(bq, m)) { @@ -3136,23 +3129,66 @@ vm_page_dequeue_lazy(vm_page_t m) vm_pqbatch_process(pq, bq, queue); /* - * The page may have been dequeued by another thread before we - * acquired the page queue lock. However, since we hold the - * page lock, the page's queue field cannot change a second - * time and we can safely clear PGA_DEQUEUE. + * The page may have been logically dequeued before we acquired the + * page queue lock. In this case, the page lock prevents the page + * from being logically enqueued elsewhere. */ - KASSERT(m->queue == queue || m->queue == PQ_NONE, - ("%s: page %p migrated between queues", __func__, m)); - if (m->queue == queue) { - (void)vm_batchqueue_insert(bq, m); - vm_pqbatch_process(pq, bq, queue); - } else - vm_page_aflag_clear(m, PGA_DEQUEUE); + if (__predict_true(m->queue == queue)) + vm_pqbatch_process_page(pq, m); + else { + KASSERT(m->queue == PQ_NONE, + ("invalid queue transition for page %p", m)); + KASSERT((m->aflags & PGA_ENQUEUED) == 0, + ("page %p is enqueued with invalid queue index", m)); + vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); + } vm_pagequeue_unlock(pq); critical_exit(); } /* + * Complete the logical removal of a page from a page queue. We must be + * careful to synchronize with the page daemon, which may be concurrently + * examining the page with only the page lock held. The page must not be + * in a state where it appears to be logically enqueued. + */ +static void +vm_page_dequeue_complete(vm_page_t m) +{ + + m->queue = PQ_NONE; + atomic_thread_fence_rel(); + vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); +} + +/* + * vm_page_dequeue_deferred: [ internal use only ] + * + * Request removal of the given page from its current page + * queue. Physical removal from the queue may be deferred + * indefinitely. + * + * The page must be locked. + */ +void +vm_page_dequeue_deferred(vm_page_t m) +{ + int queue; + + vm_page_assert_locked(m); + + queue = m->queue; + if (queue == PQ_NONE) { + KASSERT((m->aflags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p has queue state", m)); + return; + } + if ((m->aflags & PGA_DEQUEUE) == 0) + vm_page_aflag_set(m, PGA_DEQUEUE); + vm_pqbatch_submit_page(m, queue); +} + +/* * vm_page_dequeue_locked: * * Remove the page from its page queue, which must be locked. @@ -3169,28 +3205,20 @@ vm_page_dequeue_locked(vm_page_t m) { struct vm_pagequeue *pq; + pq = vm_page_pagequeue(m); + KASSERT(m->queue != PQ_NONE, ("%s: page %p queue field is PQ_NONE", __func__, m)); - vm_pagequeue_assert_locked(vm_page_pagequeue(m)); + vm_pagequeue_assert_locked(pq); KASSERT((m->aflags & PGA_DEQUEUE) != 0 || mtx_owned(vm_page_lockptr(m)), ("%s: queued unlocked page %p", __func__, m)); if ((m->aflags & PGA_ENQUEUED) != 0) { - pq = vm_page_pagequeue(m); TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_pagequeue_cnt_dec(pq); } - - /* - * Synchronize with the page daemon, which may be simultaneously - * scanning this page with only the page lock held. We must be careful - * to avoid leaving the page in a state where it appears to belong to a - * page queue. - */ - m->queue = PQ_NONE; - atomic_thread_fence_rel(); - vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); + vm_page_dequeue_complete(m); } /* @@ -3224,55 +3252,25 @@ vm_page_dequeue(vm_page_t m) } /* - * vm_page_enqueue_lazy: - * - * Schedule the given page for insertion into the specified page queue. - * Physical insertion of the page may be deferred indefinitely. - * - * The page must be locked. + * Schedule the given page for insertion into the specified page queue. + * Physical insertion of the page may be deferred indefinitely. */ static void -vm_page_enqueue_lazy(vm_page_t m, uint8_t queue) +vm_page_enqueue(vm_page_t m, uint8_t queue) { - struct vm_batchqueue *bq; - struct vm_pagequeue *pq; - int domain; vm_page_assert_locked(m); KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, ("%s: page %p is already enqueued", __func__, m)); - domain = vm_phys_domain(m); - pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; - - /* - * The queue field might be changed back to PQ_NONE by a concurrent - * call to vm_page_dequeue(). In that case the batch queue entry will - * be a no-op. - */ m->queue = queue; - - critical_enter(); - bq = DPCPU_PTR(pqbatch[domain][queue]); - if (__predict_true(vm_batchqueue_insert(bq, m))) { - critical_exit(); - return; - } - if (!vm_pagequeue_trylock(pq)) { - critical_exit(); - vm_pagequeue_lock(pq); - critical_enter(); - bq = DPCPU_PTR(pqbatch[domain][queue]); - } - vm_pqbatch_process(pq, bq, queue); - (void)vm_batchqueue_insert(bq, m); - vm_pqbatch_process(pq, bq, queue); - vm_pagequeue_unlock(pq); - critical_exit(); + if ((m->aflags & PGA_REQUEUE) == 0) + vm_page_aflag_set(m, PGA_REQUEUE); + vm_pqbatch_submit_page(m, queue); } /* - * vm_page_requeue: + * vm_page_requeue: [ internal use only ] * * Schedule a requeue of the given page. * @@ -3281,44 +3279,14 @@ vm_page_enqueue_lazy(vm_page_t m, uint8_t queue) void vm_page_requeue(vm_page_t m) { - struct vm_batchqueue *bq; - struct vm_pagequeue *pq; - int domain, queue; - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); KASSERT(m->queue != PQ_NONE, - ("%s: page %p is not enqueued", __func__, m)); + ("%s: page %p is not logically enqueued", __func__, m)); - domain = vm_phys_domain(m); - queue = m->queue; - pq = vm_page_pagequeue(m); - - if (queue == PQ_NONE) - return; - - vm_page_aflag_set(m, PGA_REQUEUE); - critical_enter(); - bq = DPCPU_PTR(pqbatch[domain][queue]); - if (__predict_true(vm_batchqueue_insert(bq, m))) { - critical_exit(); - return; - } - if (!vm_pagequeue_trylock(pq)) { - critical_exit(); - vm_pagequeue_lock(pq); - critical_enter(); - bq = DPCPU_PTR(pqbatch[domain][queue]); - } - vm_pqbatch_process(pq, bq, queue); - KASSERT(m->queue == queue || m->queue == PQ_NONE, - ("%s: page %p migrated between queues", __func__, m)); - if (m->queue == queue) { - (void)vm_batchqueue_insert(bq, m); - vm_pqbatch_process(pq, bq, queue); - } else - vm_page_aflag_clear(m, PGA_REQUEUE); - vm_pagequeue_unlock(pq); - critical_exit(); + if ((m->aflags & PGA_REQUEUE) == 0) + vm_page_aflag_set(m, PGA_REQUEUE); + vm_pqbatch_submit_page(m, m->queue); } /* @@ -3347,7 +3315,7 @@ vm_page_activate(vm_page_t m) vm_page_remque(m); if (m->act_count < ACT_INIT) m->act_count = ACT_INIT; - vm_page_enqueue_lazy(m, PQ_ACTIVE); + vm_page_enqueue(m, PQ_ACTIVE); } /* @@ -3406,7 +3374,7 @@ vm_page_free_prep(vm_page_t m) * dequeue. */ if ((m->oflags & VPO_UNMANAGED) == 0) - vm_page_dequeue_lazy(m); + vm_page_dequeue_deferred(m); m->valid = 0; vm_page_undirty(m); @@ -3477,12 +3445,14 @@ void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) { vm_page_t m; + struct pglist pgl; int count; if (SLIST_EMPTY(free)) return; count = 0; + TAILQ_INIT(&pgl); while ((m = SLIST_FIRST(free)) != NULL) { count++; SLIST_REMOVE_HEAD(free, plinks.s.ss); @@ -3562,7 +3532,7 @@ vm_page_unwire(vm_page_t m, uint8_t queue) } else { vm_page_dequeue(m); if (queue != PQ_NONE) { - vm_page_enqueue_lazy(m, queue); + vm_page_enqueue(m, queue); if (queue == PQ_ACTIVE) /* Initialize act_count. */ vm_page_activate(m); @@ -3601,71 +3571,50 @@ vm_page_unwire_noq(vm_page_t m) } /* - * Move the specified page to the inactive queue, or requeue the page if it is - * already in the inactive queue. + * Move the specified page to the tail of the inactive queue, or requeue + * the page if it is already in the inactive queue. * - * Normally, "noreuse" is FALSE, resulting in LRU ordering of the inactive - * queue. However, setting "noreuse" to TRUE will accelerate the specified - * page's reclamation, but it will not unmap the page from any address space. - * This is implemented by inserting the page near the head of the inactive - * queue, using a marker page to guide FIFO insertion ordering. - * * The page must be locked. */ -static inline void -_vm_page_deactivate(vm_page_t m, bool noreuse) +void +vm_page_deactivate(vm_page_t m) { - struct vm_pagequeue *pq; vm_page_assert_locked(m); if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) return; - if (noreuse) { - /* This is slower than it could be. */ + if (!vm_page_inactive(m)) { vm_page_remque(m); - pq = &vm_pagequeue_domain(m)->vmd_pagequeues[PQ_INACTIVE]; - vm_pagequeue_lock(pq); - m->queue = PQ_INACTIVE; - TAILQ_INSERT_BEFORE(&vm_pagequeue_domain(m)->vmd_inacthead, m, - plinks.q); - vm_pagequeue_cnt_inc(pq); - vm_page_aflag_set(m, PGA_ENQUEUED); - if ((m->aflags & PGA_REQUEUE) != 0) - vm_page_aflag_clear(m, PGA_REQUEUE); - vm_pagequeue_unlock(pq); - } else if (!vm_page_inactive(m)) { - vm_page_remque(m); - vm_page_enqueue_lazy(m, PQ_INACTIVE); + vm_page_enqueue(m, PQ_INACTIVE); } else vm_page_requeue(m); } /* - * Move the specified page to the inactive queue, or requeue the page if it is - * already in the inactive queue. + * Move the specified page close to the head of the inactive queue, + * bypassing LRU. A marker page is used to maintain FIFO ordering. + * As with regular enqueues, we use a per-CPU batch queue to reduce + * contention on the page queue lock. * * The page must be locked. */ void -vm_page_deactivate(vm_page_t m) +vm_page_deactivate_noreuse(vm_page_t m) { - _vm_page_deactivate(m, false); -} + vm_page_assert_locked(m); -/* - * Move the specified page to the inactive queue with the expectation - * that it is unlikely to be reused. - * - * The page must be locked. - */ -void -vm_page_deactivate_noreuse(vm_page_t m) -{ + if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + return; - _vm_page_deactivate(m, true); + if (!vm_page_inactive(m)) + vm_page_remque(m); + m->queue = PQ_INACTIVE; + if ((m->aflags & PGA_REQUEUE_HEAD) == 0) + vm_page_aflag_set(m, PGA_REQUEUE_HEAD); + vm_pqbatch_submit_page(m, PQ_INACTIVE); } /* @@ -3685,7 +3634,7 @@ vm_page_launder(vm_page_t m) vm_page_requeue(m); else { vm_page_remque(m); - vm_page_enqueue_lazy(m, PQ_LAUNDRY); + vm_page_enqueue(m, PQ_LAUNDRY); } } @@ -3703,7 +3652,7 @@ vm_page_unswappable(vm_page_t m) ("page %p already unswappable", m)); vm_page_remque(m); - vm_page_enqueue_lazy(m, PQ_UNSWAPPABLE); + vm_page_enqueue(m, PQ_UNSWAPPABLE); } /* Modified: user/jeff/numa/sys/vm/vm_page.h ============================================================================== --- user/jeff/numa/sys/vm/vm_page.h Tue Apr 10 14:44:07 2018 (r332374) +++ user/jeff/numa/sys/vm/vm_page.h Tue Apr 10 15:02:24 2018 (r332375) @@ -352,9 +352,13 @@ extern struct mtx_padalign pa_lock[]; * actually inserted into the page queue. The page lock must be held to set * this flag, and the queue lock for the page must be held to clear it. * - * PGA_REQUEUE is set when the page is scheduled to be requeued in its page - * queue. The page lock must be held to set this flag, and the queue lock - * for the page must be held to clear it. + * PGA_REQUEUE is set when the page is scheduled to be enqueued or requeued + * in its page queue. The page lock must be held to set this flag, and the + * queue lock for the page must be held to clear it. + * + * PGA_REQUEUE_HEAD is a special flag for enqueuing pages near the head of + * the inactive queue, thus bypassing LRU. The page lock must be held to + * set this flag, and the queue lock for the page must be held to clear it. */ #define PGA_WRITEABLE 0x01 /* page may be mapped writeable */ #define PGA_REFERENCED 0x02 /* page has been referenced */ @@ -362,8 +366,10 @@ extern struct mtx_padalign pa_lock[]; #define PGA_ENQUEUED 0x08 /* page is enqueued in a page queue */ #define PGA_DEQUEUE 0x10 /* page is due to be dequeued */ #define PGA_REQUEUE 0x20 /* page is due to be requeued */ +#define PGA_REQUEUE_HEAD 0x40 /* page requeue should bypass LRU */ -#define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_DEQUEUE | PGA_REQUEUE) +#define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_DEQUEUE | PGA_REQUEUE | \ + PGA_REQUEUE_HEAD) /* * Page flags. If changed at any other time than page allocation or @@ -529,7 +535,7 @@ int vm_page_grab_pages(vm_object_t object, vm_pindex_t void vm_page_deactivate(vm_page_t); void vm_page_deactivate_noreuse(vm_page_t); void vm_page_dequeue(vm_page_t m); -void vm_page_dequeue_lazy(vm_page_t m); +void vm_page_dequeue_deferred(vm_page_t m); void vm_page_dequeue_locked(vm_page_t m); vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t); bool vm_page_free_prep(vm_page_t m); @@ -794,6 +800,24 @@ vm_page_in_laundry(vm_page_t m) { return (m->queue == PQ_LAUNDRY || m->queue == PQ_UNSWAPPABLE); +} + +/* + * vm_page_enqueued: + * + * Return true if the page is logically enqueued and no deferred + * dequeue is pending. + */ +static inline bool +vm_page_enqueued(vm_page_t m) +{ + + vm_page_assert_locked(m); + + if ((m->aflags & PGA_DEQUEUE) != 0) + return (false); + atomic_thread_fence_acq(); + return (m->queue != PQ_NONE); } /* Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Tue Apr 10 14:44:07 2018 (r332374) +++ user/jeff/numa/sys/vm/vm_pageout.c Tue Apr 10 15:02:24 2018 (r332375) @@ -205,6 +205,14 @@ static int vm_pageout_launder(struct vm_domain *vmd, i bool in_shortfall); static void vm_pageout_laundry_worker(void *arg); +struct scan_state { + struct vm_batchqueue bq; + struct vm_pagequeue *pq; + vm_page_t marker; + int maxscan; + int scanned; +}; + /* * Initialize a dummy page for marking the caller's place in the specified * paging queue. In principle, this function only needs to set the flag @@ -212,18 +220,96 @@ static void vm_pageout_laundry_worker(void *arg); * to one as safety precautions. */ static void -vm_pageout_init_marker(vm_page_t marker, u_short queue) +vm_pageout_init_marker(vm_page_t marker, u_short queue, uint8_t aflags) { bzero(marker, sizeof(*marker)); marker->flags = PG_MARKER; + marker->aflags = aflags; marker->busy_lock = VPB_SINGLE_EXCLUSIVER; marker->queue = queue; marker->hold_count = 1; - if (queue != PQ_NONE) - marker->aflags = PGA_ENQUEUED; } +/* + * Initialize and enqueue static queue markers. + */ +static void +vm_pageout_insert_markers(struct vm_domain *vmd) +{ + struct vm_pagequeue *pq; + vm_page_t marker; + int i; + + /* + * inacthead is used to provide FIFO ordering for LRU-bypassing + * insertions. + */ + marker = &vmd->vmd_inacthead; + pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; + vm_pageout_init_marker(marker, PQ_INACTIVE, PGA_ENQUEUED); + TAILQ_INSERT_HEAD(&pq->pq_pl, marker, plinks.q); + + /* + * The clock pages are used to implement active queue scanning without + * requeues. Scans start at clock[0], which is advanced after the scan + * ends. When the two clock hands meet, they are reset and scanning + * resumes from the head of the queue. + */ + marker = &vmd->vmd_clock[0]; + pq = &vmd->vmd_pagequeues[PQ_ACTIVE]; + vm_pageout_init_marker(marker, PQ_ACTIVE, PGA_ENQUEUED); + TAILQ_INSERT_HEAD(&pq->pq_pl, marker, plinks.q); + marker = &vmd->vmd_clock[1]; + vm_pageout_init_marker(marker, PQ_ACTIVE, PGA_ENQUEUED); + TAILQ_INSERT_TAIL(&pq->pq_pl, marker, plinks.q); + + for (i = 0; i < PQ_COUNT; i++) + vm_pageout_init_marker(&vmd->vmd_markers[i], i, 0); +} + +static void +vm_pageout_init_scan(struct scan_state *ss, struct vm_pagequeue *pq, + vm_page_t marker, vm_page_t after, int maxscan) +{ + + vm_pagequeue_assert_locked(pq); + KASSERT((marker->aflags & PGA_ENQUEUED) == 0, + ("marker %p already enqueued", marker)); + + if (after == NULL) + TAILQ_INSERT_HEAD(&pq->pq_pl, marker, plinks.q); + else + TAILQ_INSERT_AFTER(&pq->pq_pl, after, marker, plinks.q); + vm_page_aflag_set(marker, PGA_ENQUEUED); + + vm_batchqueue_init(&ss->bq); + ss->pq = pq; + ss->marker = marker; + ss->maxscan = maxscan; + ss->scanned = 0; + vm_pagequeue_unlock(pq); +} + +static void +vm_pageout_end_scan(struct scan_state *ss) +{ + struct vm_pagequeue *pq; + + pq = ss->pq; + vm_pagequeue_assert_locked(pq); + KASSERT((ss->marker->aflags & PGA_ENQUEUED) != 0, + ("marker %p not enqueued", ss->marker)); + + TAILQ_REMOVE(&pq->pq_pl, ss->marker, plinks.q); + vm_page_aflag_clear(ss->marker, PGA_ENQUEUED); + VM_CNT_ADD(v_pdpages, ss->scanned); +} + +/* + * Ensure that the page has not been dequeued after a pageout batch was + * collected. See vm_page_dequeue_complete(). + */ static inline bool vm_pageout_page_queued(vm_page_t m, int queue) { @@ -239,37 +325,42 @@ vm_pageout_page_queued(vm_page_t m, int queue) /* * Add a small number of queued pages to a batch queue for later processing * without the corresponding queue lock held. The caller must have enqueued a - * marker page at the desired start point for the scan. + * marker page at the desired start point for the scan. Pages will be + * physically dequeued if the caller so requests. Otherwise, the returned + * batch may contain marker pages, and it is up to the caller to handle them. * * When processing the batch queue, vm_pageout_page_queued() must be used to * determine whether the page was logically dequeued by another thread. Once * this check is performed, the page lock guarantees that the page will not be * disassociated from the queue. */ -static inline void -vm_pageout_collect_batch(struct vm_pagequeue *pq, struct vm_batchqueue *bq, - vm_page_t marker, int maxcollect, const bool dequeue) +static __always_inline void +vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) { - vm_page_t m; + struct vm_pagequeue *pq; + vm_page_t m, marker; - vm_pagequeue_assert_locked(pq); + marker = ss->marker; + pq = ss->pq; - vm_batchqueue_init(bq); - for (m = TAILQ_NEXT(marker, plinks.q); m != NULL && maxcollect > 0; - m = TAILQ_NEXT(m, plinks.q), maxcollect--) { - VM_CNT_INC(v_pdpages); - if (__predict_false((m->flags & PG_MARKER) != 0)) + KASSERT((marker->aflags & PGA_ENQUEUED) != 0, + ("marker %p not enqueued", ss->marker)); + + vm_pagequeue_lock(pq); + for (m = TAILQ_NEXT(marker, plinks.q); m != NULL && + ss->scanned < ss->maxscan && ss->bq.bq_cnt < VM_BATCHQUEUE_SIZE; + m = TAILQ_NEXT(m, plinks.q), ss->scanned++) { + if ((m->flags & PG_MARKER) == 0) { + KASSERT((m->aflags & PGA_ENQUEUED) != 0, + ("page %p not enqueued", m)); + KASSERT((m->flags & PG_FICTITIOUS) == 0, + ("Fictitious page %p cannot be in page queue", m)); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("Unmanaged page %p cannot be in page queue", m)); + } else if (dequeue) continue; - KASSERT((m->aflags & PGA_ENQUEUED) != 0, - ("page %p not enqueued", m)); - KASSERT((m->flags & PG_FICTITIOUS) == 0, - ("Fictitious page %p cannot be in page queue", m)); - KASSERT((m->oflags & VPO_UNMANAGED) == 0, - ("Unmanaged page %p cannot be in page queue", m)); - - if (!vm_batchqueue_insert(bq, m)) - break; + (void)vm_batchqueue_insert(&ss->bq, m); if (dequeue) { TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_page_aflag_clear(m, PGA_ENQUEUED); @@ -281,9 +372,20 @@ vm_pageout_collect_batch(struct vm_pagequeue *pq, stru else TAILQ_INSERT_TAIL(&pq->pq_pl, marker, plinks.q); if (dequeue) - vm_pagequeue_cnt_add(pq, -bq->bq_cnt); + vm_pagequeue_cnt_add(pq, -ss->bq.bq_cnt); + vm_pagequeue_unlock(pq); } +/* Return the next page to be scanned, or NULL if the scan is complete. */ +static __always_inline vm_page_t +vm_pageout_next(struct scan_state *ss, const bool dequeue) +{ + + if (ss->bq.bq_cnt == 0) + vm_pageout_collect_batch(ss, dequeue); + return (vm_batchqueue_pop(&ss->bq)); +} + /* * Scan for pages at adjacent offsets within the given page's object that are * eligible for laundering, form a cluster of these pages and the given page, @@ -659,15 +761,18 @@ unlock_mp: static int vm_pageout_launder(struct vm_domain *vmd, int launder, bool in_shortfall) { - struct vm_batchqueue bq; + struct scan_state ss; struct vm_pagequeue *pq; struct mtx *mtx; vm_object_t object; - vm_page_t m; - int act_delta, error, maxscan, numpagedout, queue, starting_target; + vm_page_t m, marker; + int act_delta, error, numpagedout, queue, starting_target; int vnodes_skipped; bool obj_locked, pageout_ok; + mtx = NULL; + obj_locked = false; + object = NULL; starting_target = launder; vnodes_skipped = 0; @@ -677,10 +782,6 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, * we've reached the end of the queue. A single iteration of this loop * may cause more than one page to be laundered because of clustering. * - * maxscan ensures that we don't re-examine requeued pages. Any - * additional pages written as part of a cluster are subtracted from - * maxscan since they must be taken from the laundry queue. - * * As an optimization, we avoid laundering from PQ_UNSWAPPABLE when no * swap devices are configured. */ @@ -688,206 +789,201 @@ vm_pageout_launder(struct vm_domain *vmd, int launder, queue = PQ_UNSWAPPABLE; else queue = PQ_LAUNDRY; + marker = &vmd->vmd_markers[queue]; pq = &vmd->vmd_pagequeues[queue]; scan: vm_pagequeue_lock(pq); - TAILQ_INSERT_HEAD(&pq->pq_pl, &vmd->vmd_laundry_marker, plinks.q); - for (maxscan = pq->pq_cnt; maxscan > 0 && launder > 0 && - TAILQ_NEXT(&vmd->vmd_laundry_marker, plinks.q) != NULL; - maxscan -= bq.bq_cnt) { - vm_pageout_collect_batch(pq, &bq, &vmd->vmd_laundry_marker, - min(maxscan, launder), false); - vm_pagequeue_unlock(pq); + vm_pageout_init_scan(&ss, pq, marker, NULL, pq->pq_cnt); + while ((m = vm_pageout_next(&ss, false)) != NULL) { + if (__predict_false((m->flags & PG_MARKER) != 0)) + continue; - mtx = NULL; - obj_locked = false; - object = NULL; - VM_BATCHQ_FOREACH(&bq, m) { - vm_page_change_lock(m, &mtx); + vm_page_change_lock(m, &mtx); recheck: - /* - * The page may have been disassociated from the queue - * while locks were dropped. - */ - if (!vm_pageout_page_queued(m, queue)) - continue; + /* + * The page may have been disassociated from the queue + * while locks were dropped. + */ + if (!vm_pageout_page_queued(m, queue)) + continue; - /* - * A requeue was requested, so this page gets a second - * chance. - */ - if ((m->aflags & PGA_REQUEUE) != 0) { - vm_page_requeue(m); - continue; - } + /* + * A requeue was requested, so this page gets a second + * chance. + */ + if ((m->aflags & PGA_REQUEUE) != 0) { + vm_page_requeue(m); + continue; + } - /* - * Held pages are essentially stuck in the queue. - * - * Wired pages may not be freed. Complete their removal - * from the queue now to avoid needless revisits during - * future scans. - */ - if (m->hold_count != 0) - continue; - if (m->wire_count != 0) { - vm_page_dequeue_lazy(m); - continue; - } + /* + * Held pages are essentially stuck in the queue. + * + * Wired pages may not be freed. Complete their removal + * from the queue now to avoid needless revisits during + * future scans. + */ + if (m->hold_count != 0) + continue; + if (m->wire_count != 0) { + vm_page_dequeue_deferred(m); + continue; + } - if (object != m->object) { - if (obj_locked) { - VM_OBJECT_WUNLOCK(object); - obj_locked = false; - } - object = m->object; + if (object != m->object) { + if (obj_locked) { + VM_OBJECT_WUNLOCK(object); + obj_locked = false; } - if (!obj_locked) { - if (!VM_OBJECT_TRYWLOCK(object)) { - mtx_unlock(mtx); - VM_OBJECT_WLOCK(object); - obj_locked = true; - mtx_lock(mtx); - goto recheck; - } else - obj_locked = true; - } + object = m->object; + } + if (!obj_locked) { + if (!VM_OBJECT_TRYWLOCK(object)) { + mtx_unlock(mtx); + /* Depends on type-stability. */ + VM_OBJECT_WLOCK(object); + obj_locked = true; + mtx_lock(mtx); + goto recheck; + } else + obj_locked = true; + } - if (vm_page_busied(m)) - continue; + if (vm_page_busied(m)) + continue; - /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Apr 10 15:19:34 2018 Return-Path: Delivered-To: svn-src-user@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 04888F801F0 for ; Tue, 10 Apr 2018 15:19: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 A616C8571A; Tue, 10 Apr 2018 15:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C98A747C; Tue, 10 Apr 2018 15:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AFJX8b013779; Tue, 10 Apr 2018 15:19:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AFJVl9013754; Tue, 10 Apr 2018 15:19:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804101519.w3AFJVl9013754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Apr 2018 15:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332376 - in user/jeff/numa: . contrib/opencsd etc/mtree include lib lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/gen lib/libc/i386/sys lib/libc/mips/sys lib/libc/p... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/jeff/numa: . contrib/opencsd etc/mtree include lib lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/gen lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/power... X-SVN-Commit-Revision: 332376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:19:34 -0000 Author: markj Date: Tue Apr 10 15:19:30 2018 New Revision: 332376 URL: https://svnweb.freebsd.org/changeset/base/332376 Log: MFH at r332375. Added: user/jeff/numa/contrib/opencsd/ - copied from r332375, head/contrib/opencsd/ user/jeff/numa/lib/libc/stdio/gets_s.c - copied unchanged from r332375, head/lib/libc/stdio/gets_s.c user/jeff/numa/lib/libc/tests/stdio/gets_s_test.c - copied unchanged from r332375, head/lib/libc/tests/stdio/gets_s_test.c user/jeff/numa/lib/libopencsd/ - copied from r332375, head/lib/libopencsd/ user/jeff/numa/share/man/man4/ocs_fc.4 - copied unchanged from r332375, head/share/man/man4/ocs_fc.4 user/jeff/numa/share/man/man4/spigen.4 - copied unchanged from r332375, head/share/man/man4/spigen.4 user/jeff/numa/share/man/man9/OF_child.9 - copied unchanged from r332375, head/share/man/man9/OF_child.9 user/jeff/numa/share/man/man9/OF_device_from_xref.9 - copied unchanged from r332375, head/share/man/man9/OF_device_from_xref.9 user/jeff/numa/share/man/man9/OF_finddevice.9 - copied unchanged from r332375, head/share/man/man9/OF_finddevice.9 user/jeff/numa/share/man/man9/OF_getprop.9 - copied unchanged from r332375, head/share/man/man9/OF_getprop.9 user/jeff/numa/share/man/man9/OF_node_from_xref.9 - copied unchanged from r332375, head/share/man/man9/OF_node_from_xref.9 user/jeff/numa/share/man/man9/OF_package_to_path.9 - copied unchanged from r332375, head/share/man/man9/OF_package_to_path.9 user/jeff/numa/share/man/man9/ofw_bus_is_compatible.9 - copied unchanged from r332375, head/share/man/man9/ofw_bus_is_compatible.9 user/jeff/numa/share/man/man9/ofw_bus_status_okay.9 - copied unchanged from r332375, head/share/man/man9/ofw_bus_status_okay.9 user/jeff/numa/stand/i386/isoboot/ - copied from r332375, head/stand/i386/isoboot/ user/jeff/numa/stand/libsa/cd9660read.c - copied unchanged from r332375, head/stand/libsa/cd9660read.c user/jeff/numa/stand/lua/logo-beastie.lua - copied unchanged from r332375, head/stand/lua/logo-beastie.lua user/jeff/numa/stand/lua/logo-beastiebw.lua - copied unchanged from r332375, head/stand/lua/logo-beastiebw.lua user/jeff/numa/stand/lua/logo-fbsdbw.lua - copied unchanged from r332375, head/stand/lua/logo-fbsdbw.lua user/jeff/numa/stand/lua/logo-orb.lua - copied unchanged from r332375, head/stand/lua/logo-orb.lua user/jeff/numa/stand/lua/logo-orbbw.lua - copied unchanged from r332375, head/stand/lua/logo-orbbw.lua user/jeff/numa/sys/arm/mv/armada38x/armada38x_pl310.h - copied unchanged from r332375, head/sys/arm/mv/armada38x/armada38x_pl310.h user/jeff/numa/sys/arm/mv/armv5_machdep.c - copied unchanged from r332375, head/sys/arm/mv/armv5_machdep.c user/jeff/numa/sys/arm/mv/files.arm7 - copied unchanged from r332375, head/sys/arm/mv/files.arm7 user/jeff/numa/sys/arm/mv/mv_armv7_machdep.c - copied unchanged from r332375, head/sys/arm/mv/mv_armv7_machdep.c user/jeff/numa/sys/arm64/coresight/ - copied from r332375, head/sys/arm64/coresight/ user/jeff/numa/sys/arm64/qualcomm/ - copied from r332375, head/sys/arm64/qualcomm/ user/jeff/numa/sys/dev/ocs_fc/ - copied from r332375, head/sys/dev/ocs_fc/ user/jeff/numa/sys/dev/vmware/vmci/LICENSE - copied unchanged from r332375, head/sys/dev/vmware/vmci/LICENSE user/jeff/numa/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso - copied unchanged from r332375, head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso user/jeff/numa/sys/dts/arm/overlays/sun8i-a83t-emac.dtso - copied unchanged from r332375, head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso user/jeff/numa/sys/dts/arm/overlays/sun8i-a83t-sid.dtso - copied unchanged from r332375, head/sys/dts/arm/overlays/sun8i-a83t-sid.dtso user/jeff/numa/sys/modules/ocs_fc/ - copied from r332375, head/sys/modules/ocs_fc/ user/jeff/numa/tests/sys/netpfil/pf/ioctl/ - copied from r332375, head/tests/sys/netpfil/pf/ioctl/ user/jeff/numa/tools/diag/prtblknos/main.c - copied unchanged from r332375, head/tools/diag/prtblknos/main.c user/jeff/numa/usr.bin/etdump/ - copied from r332375, head/usr.bin/etdump/ Deleted: user/jeff/numa/lib/libc/aarch64/sys/shmat.S user/jeff/numa/lib/libc/aarch64/sys/sigreturn.S user/jeff/numa/lib/libc/amd64/sys/setlogin.S user/jeff/numa/lib/libc/amd64/sys/sigreturn.S user/jeff/numa/lib/libc/arm/sys/shmat.S user/jeff/numa/lib/libc/arm/sys/sigreturn.S user/jeff/numa/lib/libc/i386/sys/setlogin.S user/jeff/numa/lib/libc/i386/sys/sigreturn.S user/jeff/numa/lib/libc/mips/sys/shmat.S user/jeff/numa/lib/libc/powerpc/sys/setlogin.S user/jeff/numa/lib/libc/powerpc64/sys/setlogin.S user/jeff/numa/lib/libc/riscv/sys/shmat.S user/jeff/numa/lib/libc/riscv/sys/sigreturn.S user/jeff/numa/lib/libc/sparc64/sys/setlogin.S user/jeff/numa/stand/i386/libfirewire/fwohcireg.h user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_gpio.h user/jeff/numa/sys/arm/mv/mv_machdep.c user/jeff/numa/sys/dts/arm/armada-380.dtsi user/jeff/numa/sys/dts/arm/armada-385-db-ap.dts user/jeff/numa/sys/dts/arm/armada-385.dtsi user/jeff/numa/sys/dts/arm/armada-388-clearfog.dts user/jeff/numa/sys/dts/arm/armada-388-gp.dts user/jeff/numa/sys/dts/arm/armada-388.dtsi user/jeff/numa/sys/dts/arm/armada-38x-solidrun-microsom.dtsi user/jeff/numa/sys/dts/arm/armada-38x.dtsi user/jeff/numa/sys/geom/geom_aes.c Modified: user/jeff/numa/Makefile.inc1 user/jeff/numa/UPDATING user/jeff/numa/etc/mtree/BSD.include.dist user/jeff/numa/etc/mtree/BSD.tests.dist user/jeff/numa/include/pthread.h user/jeff/numa/include/stdio.h user/jeff/numa/lib/Makefile user/jeff/numa/lib/libc/aarch64/sys/Makefile.inc user/jeff/numa/lib/libc/amd64/sys/Makefile.inc user/jeff/numa/lib/libc/arm/sys/Makefile.inc user/jeff/numa/lib/libc/gen/getlogin.c user/jeff/numa/lib/libc/gen/syslog.3 user/jeff/numa/lib/libc/gen/syslog.c user/jeff/numa/lib/libc/i386/sys/Makefile.inc user/jeff/numa/lib/libc/powerpc/sys/Makefile.inc user/jeff/numa/lib/libc/powerpc64/sys/Makefile.inc user/jeff/numa/lib/libc/riscv/sys/Makefile.inc user/jeff/numa/lib/libc/sparc64/sys/Makefile.inc user/jeff/numa/lib/libc/stdio/Makefile.inc user/jeff/numa/lib/libc/stdio/Symbol.map user/jeff/numa/lib/libc/stdio/fgets.3 user/jeff/numa/lib/libc/tests/stdio/Makefile user/jeff/numa/lib/libufs/inode.c user/jeff/numa/lib/libufs/type.c user/jeff/numa/lib/libvmmapi/vmmapi.c user/jeff/numa/lib/libvmmapi/vmmapi.h user/jeff/numa/release/Makefile.gce user/jeff/numa/release/amd64/mkisoimages.sh user/jeff/numa/sbin/camcontrol/camcontrol.8 user/jeff/numa/sbin/fsdb/Makefile user/jeff/numa/sbin/fsdb/fsdbutil.c user/jeff/numa/sbin/geom/class/eli/geli.8 user/jeff/numa/sbin/geom/class/eli/geom_eli.c user/jeff/numa/sbin/reboot/reboot.c user/jeff/numa/sbin/route/route.c user/jeff/numa/share/examples/etc/make.conf user/jeff/numa/share/man/man4/Makefile user/jeff/numa/share/man/man4/cfumass.4 user/jeff/numa/share/man/man4/cm.4 user/jeff/numa/share/man/man4/fpa.4 user/jeff/numa/share/man/man4/geom.4 user/jeff/numa/share/man/man4/snd_hda.4 user/jeff/numa/share/man/man4/vmci.4 user/jeff/numa/share/man/man7/development.7 user/jeff/numa/share/man/man7/hier.7 user/jeff/numa/share/man/man8/rc.subr.8 user/jeff/numa/share/man/man9/BUS_ADD_CHILD.9 user/jeff/numa/share/man/man9/Makefile user/jeff/numa/share/man/man9/timeout.9 user/jeff/numa/share/misc/committers-ports.dot user/jeff/numa/share/mk/bsd.cpu.mk user/jeff/numa/share/mk/bsd.libnames.mk user/jeff/numa/share/mk/src.libnames.mk user/jeff/numa/share/mk/src.opts.mk user/jeff/numa/stand/common/disk.c user/jeff/numa/stand/common/part.c user/jeff/numa/stand/common/part.h user/jeff/numa/stand/defaults/loader.conf user/jeff/numa/stand/efi/libefi/efinet.c user/jeff/numa/stand/forth/efi.4th user/jeff/numa/stand/forth/loader.4th user/jeff/numa/stand/forth/loader.rc user/jeff/numa/stand/i386/Makefile user/jeff/numa/stand/i386/Makefile.inc user/jeff/numa/stand/i386/gptboot/gptboot.c user/jeff/numa/stand/i386/libfirewire/firewire.c user/jeff/numa/stand/i386/libfirewire/fwohci.c user/jeff/numa/stand/i386/libfirewire/fwohci.h user/jeff/numa/stand/i386/loader/loader.rc user/jeff/numa/stand/libsa/cd9660.c user/jeff/numa/stand/lua/Makefile user/jeff/numa/stand/lua/config.lua user/jeff/numa/stand/lua/drawer.lua user/jeff/numa/stand/lua/loader.lua user/jeff/numa/sys/amd64/amd64/db_trace.c user/jeff/numa/sys/amd64/amd64/exception.S user/jeff/numa/sys/amd64/amd64/genassym.c user/jeff/numa/sys/amd64/amd64/machdep.c user/jeff/numa/sys/amd64/amd64/minidump_machdep.c user/jeff/numa/sys/amd64/amd64/mp_machdep.c user/jeff/numa/sys/amd64/amd64/mpboot.S user/jeff/numa/sys/amd64/amd64/pmap.c user/jeff/numa/sys/amd64/amd64/ptrace_machdep.c user/jeff/numa/sys/amd64/amd64/vm_machdep.c user/jeff/numa/sys/amd64/conf/GENERIC user/jeff/numa/sys/amd64/ia32/ia32_misc.c user/jeff/numa/sys/amd64/ia32/ia32_reg.c user/jeff/numa/sys/amd64/ia32/ia32_signal.c user/jeff/numa/sys/amd64/ia32/ia32_sigtramp.S user/jeff/numa/sys/amd64/ia32/ia32_syscall.c user/jeff/numa/sys/amd64/include/smp.h user/jeff/numa/sys/amd64/include/vmm.h user/jeff/numa/sys/amd64/include/vmm_dev.h user/jeff/numa/sys/amd64/linux/linux_dummy.c user/jeff/numa/sys/amd64/linux/linux_sysvec.c user/jeff/numa/sys/amd64/linux32/linux32_dummy.c user/jeff/numa/sys/amd64/linux32/linux32_sysent.c user/jeff/numa/sys/amd64/linux32/linux32_sysvec.c user/jeff/numa/sys/amd64/linux32/syscalls.master user/jeff/numa/sys/amd64/vmm/amd/svm.c user/jeff/numa/sys/amd64/vmm/intel/vmx.c user/jeff/numa/sys/amd64/vmm/vmm.c user/jeff/numa/sys/amd64/vmm/vmm_dev.c user/jeff/numa/sys/amd64/vmm/x86.c user/jeff/numa/sys/arm/allwinner/aw_gpio.c user/jeff/numa/sys/arm/allwinner/aw_if_dwc.c user/jeff/numa/sys/arm/allwinner/aw_sid.c user/jeff/numa/sys/arm/allwinner/axp81x.c user/jeff/numa/sys/arm/allwinner/clkng/aw_clk.h user/jeff/numa/sys/arm/allwinner/clkng/aw_clk_nm.c user/jeff/numa/sys/arm/allwinner/clkng/aw_clk_nm.h user/jeff/numa/sys/arm/allwinner/clkng/ccu_sun8i_r.c user/jeff/numa/sys/arm/allwinner/if_awg.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_ccm.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_mmc.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_pinctrl.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c user/jeff/numa/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c user/jeff/numa/sys/arm/annapurna/alpine/alpine_pci_msix.c user/jeff/numa/sys/arm/arm/gic_acpi.c user/jeff/numa/sys/arm/arm/machdep.c user/jeff/numa/sys/arm/arm/vm_machdep.c user/jeff/numa/sys/arm/at91/at91_pinctrl.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_bsc.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_gpio.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_intr.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_spi.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_spivar.h user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2836.c user/jeff/numa/sys/arm/conf/ARMADA38X user/jeff/numa/sys/arm/conf/ARMADAXP user/jeff/numa/sys/arm/conf/RPI-B user/jeff/numa/sys/arm/conf/RPI2 user/jeff/numa/sys/arm/freescale/imx/imx_iomux.c user/jeff/numa/sys/arm/freescale/vybrid/vf_ccm.c user/jeff/numa/sys/arm/freescale/vybrid/vf_iomuxc.c user/jeff/numa/sys/arm/include/intr.h user/jeff/numa/sys/arm/mv/armada/wdt.c user/jeff/numa/sys/arm/mv/armada38x/armada38x.c user/jeff/numa/sys/arm/mv/armada38x/armada38x_mp.c user/jeff/numa/sys/arm/mv/armada38x/armada38x_pl310.c user/jeff/numa/sys/arm/mv/armada38x/std.armada38x user/jeff/numa/sys/arm/mv/armadaxp/armadaxp.c user/jeff/numa/sys/arm/mv/armadaxp/armadaxp_mp.c user/jeff/numa/sys/arm/mv/armadaxp/std.mv78x60 user/jeff/numa/sys/arm/mv/files.mv user/jeff/numa/sys/arm/mv/gpio.c user/jeff/numa/sys/arm/mv/mpic.c user/jeff/numa/sys/arm/mv/mv_common.c user/jeff/numa/sys/arm/mv/mv_localbus.c user/jeff/numa/sys/arm/mv/mv_pci.c user/jeff/numa/sys/arm/mv/mv_pci_ctrl.c user/jeff/numa/sys/arm/mv/mvreg.h user/jeff/numa/sys/arm/mv/mvvar.h user/jeff/numa/sys/arm/mv/mvwin.h user/jeff/numa/sys/arm/mv/std-pj4b.mv user/jeff/numa/sys/arm/mv/timer.c user/jeff/numa/sys/arm/nvidia/as3722_gpio.c user/jeff/numa/sys/arm/nvidia/as3722_regulators.c user/jeff/numa/sys/arm/nvidia/drm2/tegra_drm_subr.c user/jeff/numa/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c user/jeff/numa/sys/arm/nvidia/tegra_pinmux.c user/jeff/numa/sys/arm/nvidia/tegra_usbphy.c user/jeff/numa/sys/arm/ti/cpsw/if_cpsw.c user/jeff/numa/sys/arm/ti/ti_adc.c user/jeff/numa/sys/arm/ti/ti_hwmods.c user/jeff/numa/sys/arm/ti/ti_pinmux.c user/jeff/numa/sys/arm/ti/usb/omap_host.c user/jeff/numa/sys/arm/xilinx/zy7_gpio.c user/jeff/numa/sys/arm64/arm64/machdep.c user/jeff/numa/sys/arm64/arm64/trap.c user/jeff/numa/sys/arm64/conf/GENERIC user/jeff/numa/sys/cam/scsi/scsi_cd.c user/jeff/numa/sys/cam/scsi/scsi_da.c user/jeff/numa/sys/cam/scsi/scsi_enc.c user/jeff/numa/sys/cam/scsi/scsi_pass.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c user/jeff/numa/sys/cddl/dev/dtrace/dtrace_cddl.h user/jeff/numa/sys/compat/freebsd32/freebsd32_ioctl.c user/jeff/numa/sys/compat/freebsd32/freebsd32_misc.c user/jeff/numa/sys/compat/freebsd32/freebsd32_sysent.c user/jeff/numa/sys/compat/ia32/ia32_genassym.c user/jeff/numa/sys/compat/ia32/ia32_sysvec.c user/jeff/numa/sys/compat/linux/linux_emul.c user/jeff/numa/sys/compat/linux/linux_emul.h user/jeff/numa/sys/compat/linux/linux_ioctl.c user/jeff/numa/sys/compat/linux/linux_util.c user/jeff/numa/sys/compat/linuxkpi/common/include/asm/smp.h user/jeff/numa/sys/compat/linuxkpi/common/include/linux/module.h user/jeff/numa/sys/compat/linuxkpi/common/src/linux_compat.c user/jeff/numa/sys/compat/linuxkpi/common/src/linux_pci.c user/jeff/numa/sys/compat/linuxkpi/common/src/linux_rcu.c user/jeff/numa/sys/compat/linuxkpi/common/src/linux_schedule.c user/jeff/numa/sys/conf/NOTES user/jeff/numa/sys/conf/files user/jeff/numa/sys/conf/files.arm64 user/jeff/numa/sys/conf/kern.post.mk user/jeff/numa/sys/conf/options user/jeff/numa/sys/conf/options.amd64 user/jeff/numa/sys/conf/options.arm64 user/jeff/numa/sys/conf/options.mips user/jeff/numa/sys/conf/options.powerpc user/jeff/numa/sys/contrib/ck/FREEBSD-Xlist user/jeff/numa/sys/contrib/ck/include/ck_cc.h user/jeff/numa/sys/contrib/ck/include/ck_hs.h user/jeff/numa/sys/contrib/ck/include/ck_md.h user/jeff/numa/sys/contrib/ck/include/ck_pr.h user/jeff/numa/sys/contrib/ck/include/ck_queue.h user/jeff/numa/sys/contrib/ck/include/ck_ring.h user/jeff/numa/sys/contrib/ck/include/gcc/ck_cc.h user/jeff/numa/sys/contrib/ck/include/gcc/ck_pr.h user/jeff/numa/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h user/jeff/numa/sys/contrib/ck/include/gcc/x86/ck_pr.h user/jeff/numa/sys/contrib/ck/include/gcc/x86_64/ck_pr.h user/jeff/numa/sys/contrib/ck/include/spinlock/dec.h user/jeff/numa/sys/contrib/ck/src/ck_hs.c user/jeff/numa/sys/contrib/ck/src/ck_ht.c user/jeff/numa/sys/contrib/ck/src/ck_ht_hash.h user/jeff/numa/sys/contrib/ck/src/ck_internal.h user/jeff/numa/sys/contrib/ck/src/ck_rhs.c user/jeff/numa/sys/dev/aac/aac.c user/jeff/numa/sys/dev/aacraid/aacraid.c user/jeff/numa/sys/dev/acpica/acpi_hpet.c user/jeff/numa/sys/dev/ahci/ahci_mv_fdt.c user/jeff/numa/sys/dev/altera/avgen/altera_avgen_fdt.c user/jeff/numa/sys/dev/an/if_an.c user/jeff/numa/sys/dev/ath/if_ath_ioctl.c user/jeff/numa/sys/dev/atkbdc/atkbd.c user/jeff/numa/sys/dev/atkbdc/atkbdc_ebus.c user/jeff/numa/sys/dev/cesa/cesa.c user/jeff/numa/sys/dev/cesa/cesa.h user/jeff/numa/sys/dev/cm/if_cm_isa.c user/jeff/numa/sys/dev/cpufreq/cpufreq_dt.c user/jeff/numa/sys/dev/cxgbe/adapter.h user/jeff/numa/sys/dev/cxgbe/common/common.h user/jeff/numa/sys/dev/cxgbe/t4_main.c user/jeff/numa/sys/dev/cxgbe/tom/t4_tom.c user/jeff/numa/sys/dev/cy/cy.c user/jeff/numa/sys/dev/dpaa/qman_fdt.c user/jeff/numa/sys/dev/drm2/drmP.h user/jeff/numa/sys/dev/drm2/drm_ioc32.c user/jeff/numa/sys/dev/drm2/i915/i915_ioc32.c user/jeff/numa/sys/dev/drm2/radeon/radeon_ioc32.c user/jeff/numa/sys/dev/etherswitch/e6000sw/e6000sw.c user/jeff/numa/sys/dev/ex/if_ex.c user/jeff/numa/sys/dev/extres/clk/clk.c user/jeff/numa/sys/dev/extres/phy/phy.c user/jeff/numa/sys/dev/extres/regulator/regulator.c user/jeff/numa/sys/dev/extres/syscon/syscon.c user/jeff/numa/sys/dev/fdt/fdt_clock.c user/jeff/numa/sys/dev/fdt/fdt_common.c user/jeff/numa/sys/dev/fdt/fdt_common.h user/jeff/numa/sys/dev/fdt/fdt_pinctrl.c user/jeff/numa/sys/dev/fdt/fdt_slicer.c user/jeff/numa/sys/dev/filemon/filemon.c user/jeff/numa/sys/dev/filemon/filemon_wrapper.c user/jeff/numa/sys/dev/firewire/fwohci_pci.c user/jeff/numa/sys/dev/firewire/fwohcireg.h user/jeff/numa/sys/dev/gpio/gpiokeys.c user/jeff/numa/sys/dev/gpio/gpioled_fdt.c user/jeff/numa/sys/dev/gpio/gpioregulator.c user/jeff/numa/sys/dev/gpio/ofw_gpiobus.c user/jeff/numa/sys/dev/hyperv/vmbus/hyperv.c user/jeff/numa/sys/dev/if_ndis/if_ndis.c user/jeff/numa/sys/dev/iicbus/adt746x.c user/jeff/numa/sys/dev/ipmi/ipmi_kcs.c user/jeff/numa/sys/dev/iwi/if_iwi.c user/jeff/numa/sys/dev/ixgb/if_ixgb.c user/jeff/numa/sys/dev/ixl/ixl_pf_main.c user/jeff/numa/sys/dev/kbdmux/kbdmux.c user/jeff/numa/sys/dev/le/lebuffer_sbus.c user/jeff/numa/sys/dev/md/md.c user/jeff/numa/sys/dev/mfi/mfi.c user/jeff/numa/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c user/jeff/numa/sys/dev/mlx5/driver.h user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_core.h user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_crspace.c user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_eq.c user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_health.c user/jeff/numa/sys/dev/mlx5/mlx5_core/mlx5_main.c user/jeff/numa/sys/dev/mlx5/mlx5_en/mlx5_en_main.c user/jeff/numa/sys/dev/mpr/mpr_user.c user/jeff/numa/sys/dev/mps/mps_user.c user/jeff/numa/sys/dev/mrsas/mrsas_linux.c user/jeff/numa/sys/dev/mwl/if_mwl.c user/jeff/numa/sys/dev/neta/if_mvneta_fdt.c user/jeff/numa/sys/dev/netmap/if_em_netmap.h user/jeff/numa/sys/dev/netmap/if_igb_netmap.h user/jeff/numa/sys/dev/netmap/if_ixl_netmap.h user/jeff/numa/sys/dev/netmap/if_lem_netmap.h user/jeff/numa/sys/dev/netmap/if_ptnet.c user/jeff/numa/sys/dev/netmap/if_re_netmap.h user/jeff/numa/sys/dev/netmap/if_vtnet_netmap.h user/jeff/numa/sys/dev/netmap/ixgbe_netmap.h user/jeff/numa/sys/dev/netmap/netmap.c user/jeff/numa/sys/dev/netmap/netmap_freebsd.c user/jeff/numa/sys/dev/netmap/netmap_generic.c user/jeff/numa/sys/dev/netmap/netmap_kern.h user/jeff/numa/sys/dev/netmap/netmap_mem2.c user/jeff/numa/sys/dev/netmap/netmap_mem2.h user/jeff/numa/sys/dev/netmap/netmap_monitor.c user/jeff/numa/sys/dev/netmap/netmap_offloadings.c user/jeff/numa/sys/dev/netmap/netmap_pipe.c user/jeff/numa/sys/dev/netmap/netmap_pt.c user/jeff/numa/sys/dev/netmap/netmap_vale.c user/jeff/numa/sys/dev/null/null.c user/jeff/numa/sys/dev/nxge/if_nxge.c user/jeff/numa/sys/dev/oce/oce_if.c user/jeff/numa/sys/dev/ofw/ofw_bus_subr.c user/jeff/numa/sys/dev/ofw/ofw_bus_subr.h user/jeff/numa/sys/dev/ofw/openfirm.c user/jeff/numa/sys/dev/ofw/openfirm.h user/jeff/numa/sys/dev/pci/pci_user.c user/jeff/numa/sys/dev/pdq/if_fpa.c user/jeff/numa/sys/dev/qlnx/qlnxe/qlnx_os.c user/jeff/numa/sys/dev/rp/rp.c user/jeff/numa/sys/dev/sbni/if_sbni.c user/jeff/numa/sys/dev/sfxge/sfxge.c user/jeff/numa/sys/dev/sio/sio.c user/jeff/numa/sys/dev/spibus/ofw_spibus.c user/jeff/numa/sys/dev/spibus/spibus.c user/jeff/numa/sys/dev/spibus/spibusvar.h user/jeff/numa/sys/dev/spibus/spigen.c user/jeff/numa/sys/dev/syscons/scvidctl.c user/jeff/numa/sys/dev/syscons/syscons.c user/jeff/numa/sys/dev/uart/uart_kbd_sun.c user/jeff/numa/sys/dev/usb/controller/ehci_fsl.c user/jeff/numa/sys/dev/usb/input/ukbd.c user/jeff/numa/sys/dev/vkbd/vkbd.c user/jeff/numa/sys/dev/vmware/vmci/vmci.c user/jeff/numa/sys/dev/vmware/vmci/vmci.h user/jeff/numa/sys/dev/vmware/vmci/vmci_call_defs.h user/jeff/numa/sys/dev/vmware/vmci/vmci_datagram.c user/jeff/numa/sys/dev/vmware/vmci/vmci_datagram.h user/jeff/numa/sys/dev/vmware/vmci/vmci_defs.h user/jeff/numa/sys/dev/vmware/vmci/vmci_doorbell.c user/jeff/numa/sys/dev/vmware/vmci/vmci_doorbell.h user/jeff/numa/sys/dev/vmware/vmci/vmci_driver.c user/jeff/numa/sys/dev/vmware/vmci/vmci_driver.h user/jeff/numa/sys/dev/vmware/vmci/vmci_event.c user/jeff/numa/sys/dev/vmware/vmci/vmci_event.h user/jeff/numa/sys/dev/vmware/vmci/vmci_hashtable.c user/jeff/numa/sys/dev/vmware/vmci/vmci_hashtable.h user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_api.h user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_api_1.h user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_api_2.h user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_defs.h user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_if.c user/jeff/numa/sys/dev/vmware/vmci/vmci_kernel_if.h user/jeff/numa/sys/dev/vmware/vmci/vmci_qpair.c user/jeff/numa/sys/dev/vmware/vmci/vmci_queue.h user/jeff/numa/sys/dev/vmware/vmci/vmci_queue_pair.c user/jeff/numa/sys/dev/vmware/vmci/vmci_queue_pair.h user/jeff/numa/sys/dev/vmware/vmci/vmci_resource.c user/jeff/numa/sys/dev/vmware/vmci/vmci_resource.h user/jeff/numa/sys/dev/vmware/vmci/vmci_utils.h user/jeff/numa/sys/dev/vnic/thunder_bgx_fdt.c user/jeff/numa/sys/dev/vt/vt_core.c user/jeff/numa/sys/dev/vt/vt_font.c user/jeff/numa/sys/dev/vxge/vxge.c user/jeff/numa/sys/dts/arm/db78460.dts user/jeff/numa/sys/dts/arm/rpi.dts user/jeff/numa/sys/dts/arm/rpi2.dts user/jeff/numa/sys/fs/cd9660/iso.h user/jeff/numa/sys/fs/cuse/cuse.c user/jeff/numa/sys/fs/devfs/devfs_devs.c user/jeff/numa/sys/fs/procfs/procfs_dbregs.c user/jeff/numa/sys/fs/procfs/procfs_fpregs.c user/jeff/numa/sys/fs/procfs/procfs_ioctl.c user/jeff/numa/sys/fs/procfs/procfs_map.c user/jeff/numa/sys/fs/procfs/procfs_regs.c user/jeff/numa/sys/geom/eli/g_eli_ctl.c user/jeff/numa/sys/geom/geom_dev.c user/jeff/numa/sys/geom/geom_subr.c user/jeff/numa/sys/geom/label/g_label_disk_ident.c user/jeff/numa/sys/geom/raid/md_ddf.c user/jeff/numa/sys/geom/raid/md_intel.c user/jeff/numa/sys/i386/i386/genassym.c user/jeff/numa/sys/i386/i386/locore.s user/jeff/numa/sys/i386/i386/machdep.c user/jeff/numa/sys/i386/i386/mp_machdep.c user/jeff/numa/sys/i386/i386/sigtramp.s user/jeff/numa/sys/i386/i386/vm_machdep.c user/jeff/numa/sys/i386/include/smp.h user/jeff/numa/sys/i386/linux/linux_dummy.c user/jeff/numa/sys/i386/linux/linux_sysvec.c user/jeff/numa/sys/kern/imgact_elf.c user/jeff/numa/sys/kern/init_sysent.c user/jeff/numa/sys/kern/kern_descrip.c user/jeff/numa/sys/kern/kern_event.c user/jeff/numa/sys/kern/kern_exec.c user/jeff/numa/sys/kern/kern_exit.c user/jeff/numa/sys/kern/kern_jail.c user/jeff/numa/sys/kern/kern_mib.c user/jeff/numa/sys/kern/kern_module.c user/jeff/numa/sys/kern/kern_proc.c user/jeff/numa/sys/kern/kern_prot.c user/jeff/numa/sys/kern/kern_resource.c user/jeff/numa/sys/kern/kern_sendfile.c user/jeff/numa/sys/kern/kern_sharedpage.c user/jeff/numa/sys/kern/kern_sig.c user/jeff/numa/sys/kern/kern_sysctl.c user/jeff/numa/sys/kern/kern_tc.c user/jeff/numa/sys/kern/kern_thr.c user/jeff/numa/sys/kern/kern_umtx.c user/jeff/numa/sys/kern/kern_xxx.c user/jeff/numa/sys/kern/makesyscalls.sh user/jeff/numa/sys/kern/subr_dummy_vdso_tc.c user/jeff/numa/sys/kern/subr_lock.c user/jeff/numa/sys/kern/sys_generic.c user/jeff/numa/sys/kern/sys_getrandom.c user/jeff/numa/sys/kern/sys_pipe.c user/jeff/numa/sys/kern/sys_process.c user/jeff/numa/sys/kern/syscalls.master user/jeff/numa/sys/kern/sysv_ipc.c user/jeff/numa/sys/kern/sysv_msg.c user/jeff/numa/sys/kern/sysv_sem.c user/jeff/numa/sys/kern/sysv_shm.c user/jeff/numa/sys/kern/tty.c user/jeff/numa/sys/kern/tty_compat.c user/jeff/numa/sys/kern/uipc_mqueue.c user/jeff/numa/sys/kern/uipc_sem.c user/jeff/numa/sys/kern/uipc_socket.c user/jeff/numa/sys/kern/uipc_syscalls.c user/jeff/numa/sys/kern/vfs_aio.c user/jeff/numa/sys/kern/vfs_bio.c user/jeff/numa/sys/kern/vfs_subr.c user/jeff/numa/sys/kern/vfs_syscalls.c user/jeff/numa/sys/mips/include/reg.h user/jeff/numa/sys/mips/include/sigframe.h user/jeff/numa/sys/mips/include/tls.h user/jeff/numa/sys/mips/include/ucontext.h user/jeff/numa/sys/mips/ingenic/jz4780_pinctrl.c user/jeff/numa/sys/mips/mediatek/fdt_reset.c user/jeff/numa/sys/mips/mediatek/mtk_pinctrl.c user/jeff/numa/sys/mips/mips/freebsd32_machdep.c user/jeff/numa/sys/mips/mips/pm_machdep.c user/jeff/numa/sys/mips/mips/swtch.S user/jeff/numa/sys/mips/mips/trap.c user/jeff/numa/sys/mips/mips/vm_machdep.c user/jeff/numa/sys/modules/Makefile user/jeff/numa/sys/modules/aac/Makefile user/jeff/numa/sys/modules/aacraid/Makefile user/jeff/numa/sys/modules/cam/Makefile user/jeff/numa/sys/modules/cryptodev/Makefile user/jeff/numa/sys/modules/cuse/Makefile user/jeff/numa/sys/modules/drm2/drm2/Makefile user/jeff/numa/sys/modules/drm2/i915kms/Makefile user/jeff/numa/sys/modules/drm2/radeonkms/Makefile user/jeff/numa/sys/modules/dtrace/dtrace/Makefile user/jeff/numa/sys/modules/dtrace/dtraceall/Makefile user/jeff/numa/sys/modules/dtrace/dtraceall/dtraceall.c user/jeff/numa/sys/modules/dtrace/fasttrap/Makefile user/jeff/numa/sys/modules/filemon/Makefile user/jeff/numa/sys/modules/hyperv/vmbus/Makefile user/jeff/numa/sys/modules/i2c/iicbus/Makefile user/jeff/numa/sys/modules/i2c/isl/Makefile user/jeff/numa/sys/modules/if_tap/Makefile user/jeff/numa/sys/modules/isp/Makefile user/jeff/numa/sys/modules/kbdmux/Makefile user/jeff/numa/sys/modules/linux/Makefile user/jeff/numa/sys/modules/linux64/Makefile user/jeff/numa/sys/modules/linux_common/Makefile user/jeff/numa/sys/modules/mfi/Makefile user/jeff/numa/sys/modules/mpr/Makefile user/jeff/numa/sys/modules/mps/Makefile user/jeff/numa/sys/modules/mqueue/Makefile user/jeff/numa/sys/modules/procfs/Makefile user/jeff/numa/sys/modules/rp/Makefile user/jeff/numa/sys/modules/sem/Makefile user/jeff/numa/sys/modules/sgx/Makefile user/jeff/numa/sys/modules/sio/Makefile user/jeff/numa/sys/modules/spi/at45d/Makefile user/jeff/numa/sys/modules/spi/mx25l/Makefile user/jeff/numa/sys/modules/spi/spibus/Makefile user/jeff/numa/sys/modules/spigen/Makefile user/jeff/numa/sys/modules/sysvipc/sysvmsg/Makefile user/jeff/numa/sys/modules/sysvipc/sysvsem/Makefile user/jeff/numa/sys/modules/sysvipc/sysvshm/Makefile user/jeff/numa/sys/modules/usb/ukbd/Makefile user/jeff/numa/sys/modules/vkbd/Makefile user/jeff/numa/sys/modules/vmware/vmci/Makefile user/jeff/numa/sys/net/bpf.c user/jeff/numa/sys/net/if.c user/jeff/numa/sys/net/if.h user/jeff/numa/sys/net/if_gif.c user/jeff/numa/sys/net/if_gre.c user/jeff/numa/sys/net/if_ipsec.c user/jeff/numa/sys/net/if_spppsubr.c user/jeff/numa/sys/net/if_tap.c user/jeff/numa/sys/net/if_var.h user/jeff/numa/sys/net/if_vlan.c user/jeff/numa/sys/net/iflib.c user/jeff/numa/sys/net/netmap.h user/jeff/numa/sys/net/netmap_user.h user/jeff/numa/sys/net/netmap_virt.h user/jeff/numa/sys/net/pfvar.h user/jeff/numa/sys/net/rtsock.c user/jeff/numa/sys/net80211/ieee80211_ioctl.c user/jeff/numa/sys/netinet/in_jail.c user/jeff/numa/sys/netinet/in_pcb.c user/jeff/numa/sys/netinet/in_prot.c user/jeff/numa/sys/netinet/ip_carp.c user/jeff/numa/sys/netinet/sctp_input.c user/jeff/numa/sys/netinet/sctp_os_bsd.h user/jeff/numa/sys/netinet/sctp_syscalls.c user/jeff/numa/sys/netinet/sctp_usrreq.c user/jeff/numa/sys/netinet/tcp_offload.c user/jeff/numa/sys/netinet/tcp_offload.h user/jeff/numa/sys/netinet/tcp_seq.h user/jeff/numa/sys/netinet/tcp_subr.c user/jeff/numa/sys/netinet/tcp_usrreq.c user/jeff/numa/sys/netinet/toecore.c user/jeff/numa/sys/netinet/toecore.h user/jeff/numa/sys/netinet6/in6.c user/jeff/numa/sys/netinet6/in6_jail.c user/jeff/numa/sys/netinet6/sctp6_usrreq.c user/jeff/numa/sys/netpfil/pf/if_pfsync.c user/jeff/numa/sys/netpfil/pf/pf_ioctl.c user/jeff/numa/sys/netpfil/pf/pf_table.c user/jeff/numa/sys/opencrypto/cryptodev.c user/jeff/numa/sys/opencrypto/cryptosoft.c user/jeff/numa/sys/powerpc/aim/aim_machdep.c user/jeff/numa/sys/powerpc/aim/mmu_oea64.c user/jeff/numa/sys/powerpc/booke/booke_machdep.c user/jeff/numa/sys/powerpc/booke/pmap.c user/jeff/numa/sys/powerpc/include/reg.h user/jeff/numa/sys/powerpc/include/spr.h user/jeff/numa/sys/powerpc/include/vmparam.h user/jeff/numa/sys/powerpc/mpc85xx/fsl_diu.c user/jeff/numa/sys/powerpc/mpc85xx/lbc.c user/jeff/numa/sys/powerpc/ofw/ofw_real.c user/jeff/numa/sys/powerpc/powermac/macio.c user/jeff/numa/sys/powerpc/powermac/uninorth.c user/jeff/numa/sys/powerpc/powerpc/altivec.c user/jeff/numa/sys/powerpc/powerpc/cpu.c user/jeff/numa/sys/powerpc/powerpc/exec_machdep.c user/jeff/numa/sys/powerpc/powerpc/fpu.c user/jeff/numa/sys/powerpc/powerpc/machdep.c user/jeff/numa/sys/powerpc/powerpc/ptrace_machdep.c user/jeff/numa/sys/powerpc/powerpc/sys_machdep.c user/jeff/numa/sys/powerpc/powerpc/trap.c user/jeff/numa/sys/powerpc/psim/iobus.c user/jeff/numa/sys/security/mac/mac_net.c user/jeff/numa/sys/sparc64/central/central.c user/jeff/numa/sys/sparc64/ebus/ebus.c user/jeff/numa/sys/sparc64/fhc/fhc.c user/jeff/numa/sys/sparc64/isa/isa.c user/jeff/numa/sys/sparc64/pci/ofw_pci.c user/jeff/numa/sys/sparc64/sbus/dma_sbus.c user/jeff/numa/sys/sparc64/sbus/sbus.c user/jeff/numa/sys/sparc64/sparc64/exception.S user/jeff/numa/sys/sparc64/sparc64/machdep.c user/jeff/numa/sys/sparc64/sparc64/nexus.c user/jeff/numa/sys/sparc64/sparc64/upa.c user/jeff/numa/sys/sys/module.h user/jeff/numa/sys/sys/param.h user/jeff/numa/sys/sys/proc.h user/jeff/numa/sys/sys/spigenio.h user/jeff/numa/sys/teken/libteken/teken.3 user/jeff/numa/sys/teken/teken.c user/jeff/numa/sys/teken/teken.h user/jeff/numa/sys/teken/teken_scs.h user/jeff/numa/sys/teken/teken_subr.h user/jeff/numa/sys/teken/teken_subr_compat.h user/jeff/numa/sys/teken/teken_wcwidth.h user/jeff/numa/sys/ufs/ffs/ffs_softdep.c user/jeff/numa/sys/ufs/ffs/softdep.h user/jeff/numa/sys/vm/swap_pager.c user/jeff/numa/sys/vm/uma_core.c user/jeff/numa/sys/vm/vm_map.c user/jeff/numa/sys/vm/vm_map.h user/jeff/numa/sys/vm/vm_meter.c user/jeff/numa/sys/vm/vm_mmap.c user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_page.h user/jeff/numa/sys/vm/vm_pageout.c user/jeff/numa/sys/vm/vm_pagequeue.h user/jeff/numa/sys/vm/vm_unix.c user/jeff/numa/sys/x86/include/init.h user/jeff/numa/sys/x86/include/x86_smp.h user/jeff/numa/sys/x86/x86/cpu_machdep.c user/jeff/numa/sys/x86/x86/mp_x86.c user/jeff/numa/sys/x86/x86/tsc.c user/jeff/numa/tests/sys/netpfil/Makefile user/jeff/numa/tests/sys/netpfil/pf/Makefile user/jeff/numa/tools/diag/prtblknos/Makefile user/jeff/numa/tools/diag/prtblknos/prtblknos.c user/jeff/numa/usr.bin/Makefile user/jeff/numa/usr.bin/calendar/calendars/calendar.freebsd user/jeff/numa/usr.bin/head/head.1 user/jeff/numa/usr.bin/head/head.c user/jeff/numa/usr.bin/systat/sctp.c user/jeff/numa/usr.bin/tail/tail.1 user/jeff/numa/usr.bin/tail/tail.c user/jeff/numa/usr.bin/vtfontcvt/vtfontcvt.c user/jeff/numa/usr.sbin/bhyve/bhyve.8 user/jeff/numa/usr.sbin/bhyve/bhyverun.c user/jeff/numa/usr.sbin/bhyvectl/bhyvectl.c user/jeff/numa/usr.sbin/ctld/ctl.conf.5 user/jeff/numa/usr.sbin/makefs/cd9660.c user/jeff/numa/usr.sbin/makefs/cd9660/cd9660_eltorito.c user/jeff/numa/usr.sbin/makefs/cd9660/cd9660_eltorito.h user/jeff/numa/usr.sbin/makefs/ffs.c user/jeff/numa/usr.sbin/makefs/makefs.8 user/jeff/numa/usr.sbin/syslogd/Makefile user/jeff/numa/usr.sbin/syslogd/syslogd.c Directory Properties: user/jeff/numa/ (props changed) user/jeff/numa/sys/cddl/contrib/opensolaris/ (props changed) user/jeff/numa/sys/contrib/ck/ (props changed) Modified: user/jeff/numa/Makefile.inc1 ============================================================================== --- user/jeff/numa/Makefile.inc1 Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/Makefile.inc1 Tue Apr 10 15:19:30 2018 (r332376) @@ -802,11 +802,13 @@ _sanity_check: .PHONY .MAKE # tree changes, particularly with respect to removing source files and # replacing generated files. Handle these cases here in an ad-hoc fashion. _cleanobj_fast_depend_hack: .PHONY -# Syscall stubs rewritten in C +# Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls -# 20160829 r305012 ptrace # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs -.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs +# 20180404 r332048 sigreturn +# 20180405 r332080 shmat +# 20180406 r332119 setlogin +.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ Modified: user/jeff/numa/UPDATING ============================================================================== --- user/jeff/numa/UPDATING Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/UPDATING Tue Apr 10 15:19:30 2018 (r332376) @@ -51,6 +51,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180406: + In addition to supporting RFC 3164 formatted messages, the + syslogd(8) service is now capable of parsing RFC 5424 formatted + log messages. The main benefit of using RFC 5424 is that clients + may now send log messages with timestamps containing year numbers, + microseconds and time zone offsets. + + Similarly, the syslog(3) C library function has been altered to + send RFC 5424 formatted messages to the local system logging + daemon. On systems using syslogd(8), this change should have no + negative impact, as long as syslogd(8) and the C library are + updated at the same time. On systems using a different system + logging daemon, it may be necessary to make configuration + adjustments, depending on the software used. + + When using syslog-ng, add the 'syslog-protocol' flag to local + input sources to enable parsing of RFC 5424 formatted messages: + + source src { + unix-dgram("/var/run/log" flags(syslog-protocol)); + } + + When using rsyslog, disable the 'SysSock.UseSpecialParser' option + of the 'imuxsock' module to let messages be processed by the + regular RFC 3164/5424 parsing pipeline: + + module(load="imuxsock" SysSock.UseSpecialParser="off") + + Do note that these changes only affect communication between local + applications and syslogd(8). The format that syslogd(8) uses to + store messages on disk or forward messages to other systems + remains unchanged. syslogd(8) still uses RFC 3164 for these + purposes. Options to customize this behaviour will be added in the + future. Utilities that process log files stored in /var/log are + thus expected to continue to function as before. + + __FreeBSD_version has been incremented to 1200061 to denote this + change. + 20180328: Support for token ring networks has been removed. If you have "device token" in your kernel config you should remove Modified: user/jeff/numa/etc/mtree/BSD.include.dist ============================================================================== --- user/jeff/numa/etc/mtree/BSD.include.dist Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/etc/mtree/BSD.include.dist Tue Apr 10 15:19:30 2018 (r332376) @@ -317,6 +317,18 @@ .. nfsserver .. + opencsd + c_api + .. + etmv3 + .. + etmv4 + .. + ptm + .. + stm + .. + .. openssl .. pcap Modified: user/jeff/numa/etc/mtree/BSD.tests.dist ============================================================================== --- user/jeff/numa/etc/mtree/BSD.tests.dist Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/etc/mtree/BSD.tests.dist Tue Apr 10 15:19:30 2018 (r332376) @@ -742,6 +742,8 @@ .. netpfil pf + ioctl + .. .. .. opencrypto Modified: user/jeff/numa/include/pthread.h ============================================================================== --- user/jeff/numa/include/pthread.h Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/include/pthread.h Tue Apr 10 15:19:30 2018 (r332376) @@ -48,8 +48,6 @@ #include #include -__NULLABILITY_PRAGMA_PUSH - /* * Run-time invariant values: */ @@ -151,35 +149,33 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t * _Nonnull); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( - const pthread_attr_t * _Nonnull __restrict, - void ** _Nonnull __restrict, - size_t * _Nonnull __restrict); -int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); -int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); + const pthread_attr_t * __restrict, void ** __restrict, + size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, + size_t *); +int pthread_attr_getguardsize(const pthread_attr_t *, + size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_init(pthread_attr_t * _Nonnull); -int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *, +int pthread_attr_getdetachstate(const pthread_attr_t *, + int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int); -int pthread_barrier_destroy(pthread_barrier_t * _Nonnull); -int pthread_barrier_init(pthread_barrier_t * _Nonnull, +int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_barrier_destroy(pthread_barrier_t *); +int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); -int pthread_barrier_wait(pthread_barrier_t * _Nonnull); -int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull); +int pthread_barrier_wait(pthread_barrier_t *); +int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t * _Nonnull, int * _Nonnull); -int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull); -int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull, - int); + const pthread_barrierattr_t *, int *); +int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ { \ @@ -194,108 +190,99 @@ int pthread_barrierattr_setpshared(pthread_barrieratt __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t * _Nonnull); -int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull, - clockid_t * _Nonnull); -int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull, - int * _Nonnull); -int pthread_condattr_init(pthread_condattr_t * _Nonnull); -int pthread_condattr_setclock(pthread_condattr_t * _Nonnull, - clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int); -int pthread_cond_broadcast(pthread_cond_t * _Nonnull); -int pthread_cond_destroy(pthread_cond_t * _Nonnull); -int pthread_cond_init(pthread_cond_t * _Nonnull, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t * _Nonnull); -int pthread_cond_timedwait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getclock(const pthread_condattr_t *, + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t * __mutex, + const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex) +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *, - void *(* _Nonnull) (void *), void *); +int pthread_create(pthread_t *, const pthread_attr_t *, + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t * _Nonnull, - void (*) (void *)); +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t * _Nonnull, int * _Nonnull); -int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull, - int * _Nonnull); -int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull, - int); -int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); +int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex, +int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t *) __requires_unlocked(*__mutex); -int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); -int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_mutex_timedlock(pthread_mutex_t * __mutex, + const struct timespec *) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t * _Nonnull, - void (* _Nonnull) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_once(pthread_once_t *, void (*) (void)); +int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock, +int pthread_rwlock_init(pthread_rwlock_t * __rwlock, const pthread_rwlockattr_t *) __requires_unlocked(*__rwlock); -int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __unlocks(*__rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t * _Nonnull, int *); -int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t * _Nonnull, int * _Nonnull); -int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull, +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull, - int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int) +int pthread_spin_init(pthread_spinlock_t * __spin, int) __requires_unlocked(*__spin); -int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_destroy(pthread_spinlock_t * __spin) __requires_unlocked(*__spin); -int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_lock(pthread_spinlock_t * __spin) __locks_exclusive(*__spin); -int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_trylock(pthread_spinlock_t * __spin) __trylocks_exclusive(0, *__spin); -int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_unlock(pthread_spinlock_t * __spin) __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); @@ -317,27 +304,23 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( - pthread_mutexattr_t * _Nonnull __restrict, - int * _Nonnull __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, - int); + pthread_mutexattr_t * __restrict, int * __restrict); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); -int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull, - struct sched_param * _Nonnull); -int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_getscope(const pthread_attr_t * _Nonnull, - int * _Nonnull); +int pthread_attr_getschedparam(const pthread_attr_t *, + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); -int pthread_attr_setschedparam(pthread_attr_t * _Nonnull, - const struct sched_param * _Nonnull); -int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int); -int pthread_attr_setscope(pthread_attr_t * _Nonnull, int); -int pthread_getschedparam(pthread_t pthread, int * _Nonnull, - struct sched_param * _Nonnull); +int pthread_attr_setschedparam(pthread_attr_t *, + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); +int pthread_getschedparam(pthread_t pthread, int *, + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param * _Nonnull); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); @@ -347,6 +330,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), voi struct _pthread_cleanup_info *); void __pthread_cleanup_pop_imp(int); __END_DECLS -__NULLABILITY_PRAGMA_POP #endif /* !_PTHREAD_H_ */ Modified: user/jeff/numa/include/stdio.h ============================================================================== --- user/jeff/numa/include/stdio.h Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/include/stdio.h Tue Apr 10 15:19:30 2018 (r332376) @@ -51,6 +51,11 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #if __POSIX_VISIBLE >= 200809 #ifndef _OFF_T_DECLARED #define _OFF_T_DECLARED @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t int getc(FILE *); int getchar(void); char *gets(char *); +#if __EXT1_VISIBLE +char *gets_s(char *, rsize_t); +#endif void perror(const char *); int printf(const char * __restrict, ...); int putc(int, FILE *); Modified: user/jeff/numa/lib/Makefile ============================================================================== --- user/jeff/numa/lib/Makefile Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/Makefile Tue Apr 10 15:19:30 2018 (r332376) @@ -175,6 +175,10 @@ SUBDIR.${MK_NIS}+= libypclnt _libvgl= libvgl .endif +.if ${MACHINE_CPUARCH} == "aarch64" +SUBDIR.${MK_PMC}+= libopencsd +.endif + .if ${MACHINE_CPUARCH} == "amd64" SUBDIR.${MK_PMC}+= libipt SUBDIR.${MK_BHYVE}+= libvmmapi Modified: user/jeff/numa/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/aarch64/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/aarch64/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -5,8 +5,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c MDASM= cerror.S \ - shmat.S \ - sigreturn.S \ syscall.S \ vfork.S Modified: user/jeff/numa/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/amd64/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/amd64/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -9,7 +9,7 @@ SRCS+= \ amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S + sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/jeff/numa/lib/libc/arm/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/arm/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/arm/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/jeff/numa/lib/libc/gen/getlogin.c ============================================================================== --- user/jeff/numa/lib/libc/gen/getlogin.c Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/gen/getlogin.c Tue Apr 10 15:19:30 2018 (r332376) @@ -47,62 +47,33 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" -#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex) -#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex) - extern int _getlogin(char *, int); -int _logname_valid __hidden; /* known to setlogin() */ -static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER; - -static char * -getlogin_basic(int *status) -{ - static char logname[MAXLOGNAME]; - - if (_logname_valid == 0) { - if (_getlogin(logname, sizeof(logname)) < 0) { - *status = errno; - return (NULL); - } - _logname_valid = 1; - } - *status = 0; - return (*logname ? logname : NULL); -} - char * getlogin(void) { - char *result; - int status; + static char logname[MAXLOGNAME]; - THREAD_LOCK(); - result = getlogin_basic(&status); - THREAD_UNLOCK(); - return (result); + if (_getlogin(logname, sizeof(logname)) < 0) + return (NULL); + return (logname[0] != '\0' ? logname : NULL); } int getlogin_r(char *logname, int namelen) { - char *result; + char tmpname[MAXLOGNAME]; int len; - int status; if (namelen < 1) return (ERANGE); logname[0] = '\0'; - THREAD_LOCK(); - result = getlogin_basic(&status); - if (status == 0 && result != NULL) { - len = strlen(result) + 1; - if (len > namelen) - status = ERANGE; - else - strncpy(logname, result, len); - } - THREAD_UNLOCK(); - return (status); + if (_getlogin(tmpname, sizeof(tmpname)) < 0) + return (errno); + len = strlen(tmpname) + 1; + if (len > namelen) + return (ERANGE); + strlcpy(logname, tmpname, len); + return (0); } Modified: user/jeff/numa/lib/libc/gen/syslog.3 ============================================================================== --- user/jeff/numa/lib/libc/gen/syslog.3 Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/gen/syslog.3 Tue Apr 10 15:19:30 2018 (r332376) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 5, 2017 +.Dd April 6, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -156,6 +156,9 @@ Write the message to standard error output as well to .It Dv LOG_PID Log the process id with each message: useful for identifying instantiations of daemons. +On +.Fx , +this option is enabled by default. .El .Pp The Modified: user/jeff/numa/lib/libc/gen/syslog.c ============================================================================== --- user/jeff/numa/lib/libc/gen/syslog.c Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/gen/syslog.c Tue Apr 10 15:19:30 2018 (r332376) @@ -36,9 +36,10 @@ static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include +#include #include #include +#include #include #include #include @@ -134,11 +135,13 @@ syslog(int pri, const char *fmt, ...) static void vsyslog1(int pri, const char *fmt, va_list ap) { - int cnt; + struct timeval now; + struct tm tm; char ch, *p; - time_t now; - int fd, saved_errno; - char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26], errstr[64]; + long tz_offset; + int cnt, fd, saved_errno; + char hostname[MAXHOSTNAMELEN], *stdp, tbuf[2048], fmt_cpy[1024], + errstr[64], tz_sign; FILE *fp, *fmt_fp; struct bufcookie tbuf_cookie; struct bufcookie fmt_cookie; @@ -168,24 +171,46 @@ vsyslog1(int pri, const char *fmt, va_list ap) if (fp == NULL) return; - /* Build the message. */ - (void)time(&now); - (void)fprintf(fp, "<%d>", pri); - (void)fprintf(fp, "%.15s ", ctime_r(&now, timbuf) + 4); + /* Build the message according to RFC 5424. Tag and version. */ + (void)fprintf(fp, "<%d>1 ", pri); + /* Timestamp similar to RFC 3339. */ + if (gettimeofday(&now, NULL) == 0 && + localtime_r(&now.tv_sec, &tm) != NULL) { + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + (void)fprintf(fp, + "%04d-%02d-%02d" /* Date. */ + "T%02d:%02d:%02d.%06ld" /* Time. */ + "%c%02ld:%02ld ", /* Time zone offset. */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, now.tv_usec, + tz_sign, tz_offset / 3600, (tz_offset % 3600) / 60); + } else + (void)fprintf(fp, "- "); + /* Hostname. */ + (void)gethostname(hostname, sizeof(hostname)); + (void)fprintf(fp, "%s ", hostname); if (LogStat & LOG_PERROR) { /* Transfer to string buffer */ (void)fflush(fp); stdp = tbuf + (sizeof(tbuf) - tbuf_cookie.left); } + /* + * Application name, process ID, message ID and structured data. + * Provide the process ID regardless of whether LOG_PID has been + * specified, as it provides valuable information. Many + * applications tend not to use this, even though they should. + */ if (LogTag == NULL) LogTag = _getprogname(); - if (LogTag != NULL) - (void)fprintf(fp, "%s", LogTag); - if (LogStat & LOG_PID) - (void)fprintf(fp, "[%d]", getpid()); - if (LogTag != NULL) { - (void)fprintf(fp, ": "); - } + (void)fprintf(fp, "%s %d - - ", + LogTag == NULL ? "-" : LogTag, getpid()); /* Check to see if we can skip expanding the %m */ if (strstr(fmt, "%m")) { @@ -313,7 +338,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) struct iovec iov[2]; struct iovec *v = iov; - p = strchr(tbuf, '>') + 1; + p = strchr(tbuf, '>') + 3; v->iov_base = p; v->iov_len = cnt - (p - tbuf); ++v; Modified: user/jeff/numa/lib/libc/i386/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/i386/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/i386/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_io i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S syscall.S + sbrk.S syscall.S NOASM+= vfork.o Modified: user/jeff/numa/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/powerpc/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/powerpc/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: user/jeff/numa/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/powerpc64/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/powerpc64/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: user/jeff/numa/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/riscv/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/riscv/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -2,10 +2,7 @@ SRCS+= trivial-vdso_tc.c -#MDASM= ptrace.S MDASM= cerror.S \ - shmat.S \ - sigreturn.S \ syscall.S \ vfork.S Modified: user/jeff/numa/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/sparc64/sys/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/sparc64/sys/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S Modified: user/jeff/numa/lib/libc/stdio/Makefile.inc ============================================================================== --- user/jeff/numa/lib/libc/stdio/Makefile.inc Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/stdio/Makefile.inc Tue Apr 10 15:19:30 2018 (r332376) @@ -14,7 +14,7 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c dprintf.c \ fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ fwrite.c getc.c getchar.c getdelim.c getline.c \ - gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ + gets.c gets_s.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ open_memstream.c open_wmemstream.c \ perror.c printf.c printf-pos.c putc.c putchar.c \ puts.c putw.c putwc.c putwchar.c \ @@ -50,6 +50,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ ferror.3 fileno.3 ferror.3 fileno_unlocked.3 MLINKS+=fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 +MLINKS+=fgets.3 gets_s.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 MLINKS+=fputs.3 puts.3 Modified: user/jeff/numa/lib/libc/stdio/Symbol.map ============================================================================== --- user/jeff/numa/lib/libc/stdio/Symbol.map Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/stdio/Symbol.map Tue Apr 10 15:19:30 2018 (r332376) @@ -167,6 +167,10 @@ FBSD_1.4 { fopencookie; }; +FBSD_1.5 { + gets_s; +}; + FBSDprivate_1.0 { _flockfile; _flockfile_debug_stub; Modified: user/jeff/numa/lib/libc/stdio/fgets.3 ============================================================================== --- user/jeff/numa/lib/libc/stdio/fgets.3 Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/stdio/fgets.3 Tue Apr 10 15:19:30 2018 (r332376) @@ -32,12 +32,13 @@ .\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 5, 2012 +.Dd April 3, 2018 .Dt FGETS 3 .Os .Sh NAME .Nm fgets , -.Nm gets +.Nm gets , +.Nm gets_s .Nd get a line from a stream .Sh LIBRARY .Lb libc @@ -46,6 +47,8 @@ .Ft char * .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" .Ft char * +.Fn gets_s "char *str" "rsize_t size" +.Ft char * .Fn gets "char *str" .Sh DESCRIPTION The @@ -65,6 +68,17 @@ If any characters are read and there is no error, a character is appended to end the string. .Pp The +.Fn gets_s +function +is equivalent to +.Fn fgets +with a +.Fa stream +of +.Dv stdin , +except that the newline character (if any) is not stored in the string. +.Pp +The .Fn gets function is equivalent to @@ -80,7 +94,8 @@ It is the caller's responsibility to ensure that the i if any, is sufficiently short to fit in the string. .Sh RETURN VALUES Upon successful completion, -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets return @@ -94,7 +109,8 @@ they return .Dv NULL and the buffer contents are indeterminate. The -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets functions @@ -141,6 +157,13 @@ and .Fn gets conform to .St -isoC-99 . +.Fn gets_s +conforms to +.St -isoC-2011 +K.3.7.4.1. +.Fn gets +has been removed from +.St -isoC-2011 . .Sh SECURITY CONSIDERATIONS The .Fn gets Copied: user/jeff/numa/lib/libc/stdio/gets_s.c (from r332375, head/lib/libc/stdio/gets_s.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/jeff/numa/lib/libc/stdio/gets_s.c Tue Apr 10 15:19:30 2018 (r332376, copy of r332375, head/lib/libc/stdio/gets_s.c) @@ -0,0 +1,102 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017, 2018 + * Cyril S. E. Schubert. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" +#include "local.h" + +static inline char * +_gets_s(char *buf, rsize_t n) +{ + int c; + char *s; + + ORIENT(stdin, -1); + for (s = buf, n--; (c = __sgetc(stdin)) != '\n' && n > 0 ; n--) { + if (c == EOF) { + if (s == buf) { + return (NULL); + } else + break; + } else + *s++ = c; + } + + /* + * If end of buffer reached, discard until \n or eof. + * Then throw an error. + */ + if (n == 0) { + /* discard */ + while ((c = __sgetc(stdin)) != '\n' && c != EOF); + /* throw the error after lock released prior to exit */ + __throw_constraint_handler_s("gets_s : end of buffer", E2BIG); + return (NULL); + } + *s = 0; + return (buf); +} + +/* ISO/IEC 9899:2011 K.3.7.4.1 */ +char * +gets_s(char *buf, rsize_t n) +{ + char *ret; + if (buf == NULL) { + __throw_constraint_handler_s("gets_s : str is NULL", EINVAL); + return(NULL); + } else if (n > RSIZE_MAX) { + __throw_constraint_handler_s("gets_s : n > RSIZE_MAX", + EINVAL); + return(NULL); + } else if (n == 0) { + __throw_constraint_handler_s("gets_s : n == 0", EINVAL); + return(NULL); + } + + FLOCKFILE_CANCELSAFE(stdin); + ret = _gets_s(buf, n); + FUNLOCKFILE_CANCELSAFE(); + return (ret); +} Modified: user/jeff/numa/lib/libc/tests/stdio/Makefile ============================================================================== --- user/jeff/numa/lib/libc/tests/stdio/Makefile Tue Apr 10 15:02:24 2018 (r332375) +++ user/jeff/numa/lib/libc/tests/stdio/Makefile Tue Apr 10 15:19:30 2018 (r332376) @@ -7,6 +7,7 @@ ATF_TESTS_C+= fmemopen2_test ATF_TESTS_C+= fopen2_test ATF_TESTS_C+= freopen_test ATF_TESTS_C+= getdelim_test +ATF_TESTS_C+= gets_s_test ATF_TESTS_C+= mkostemp_test ATF_TESTS_C+= open_memstream2_test ATF_TESTS_C+= open_wmemstream_test Copied: user/jeff/numa/lib/libc/tests/stdio/gets_s_test.c (from r332375, head/lib/libc/tests/stdio/gets_s_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/jeff/numa/lib/libc/tests/stdio/gets_s_test.c Tue Apr 10 15:19:30 2018 (r332376, copy of r332375, head/lib/libc/tests/stdio/gets_s_test.c) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2017 Cyril S. E. Schubert. 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +static errno_t error_code; +static const char * message; + +void +h(const char * msg, void * ptr __unused, errno_t error) +{ + error_code = error; + message = msg; +} + +/* null ptr */ +ATF_TC_WITHOUT_HEAD(null_ptr); +ATF_TC_BODY(null_ptr, tc) +{ + ATF_CHECK_MSG(gets_s(NULL, 1) == NULL, + "gets_s() failed to handle NULL pointer"); +} + +/* normal */ +ATF_TC_WITHOUT_HEAD(normal); +ATF_TC_BODY(normal, tc) +{ + pid_t kidpid; + int fd[2]; + int nfd; + + // close(STDIN_FILENO); + // close(STDOUT_FILENO); + pipe(fd); + + if ((kidpid = fork()) == 0) { + char b[10]; + + close(fd[1]); + nfd = dup2(fd[0], 0); + close(fd[0]); + stdin = fdopen(nfd, "r"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Wed Apr 11 14:24:12 2018 Return-Path: Delivered-To: svn-src-user@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 5C99FF986F9 for ; Wed, 11 Apr 2018 14:24:12 +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 107538172A; Wed, 11 Apr 2018 14:24:12 +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 068D71D609; Wed, 11 Apr 2018 14:24:12 +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 w3BEOBOQ023333; Wed, 11 Apr 2018 14:24:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BEOB4w023332; Wed, 11 Apr 2018 14:24:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804111424.w3BEOB4w023332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 14:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332406 - user/markj/netdump/sys/kern X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: user/markj/netdump/sys/kern X-SVN-Commit-Revision: 332406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 14:24:12 -0000 Author: markj Date: Wed Apr 11 14:24:11 2018 New Revision: 332406 URL: https://svnweb.freebsd.org/changeset/base/332406 Log: Don't hard-code the cluster size. Modified: user/markj/netdump/sys/kern/kern_mbuf.c Modified: user/markj/netdump/sys/kern/kern_mbuf.c ============================================================================== --- user/markj/netdump/sys/kern/kern_mbuf.c Wed Apr 11 13:33:12 2018 (r332405) +++ user/markj/netdump/sys/kern/kern_mbuf.c Wed Apr 11 14:24:11 2018 (r332406) @@ -443,7 +443,7 @@ nd_pack_import(void *arg __unused, void **store, int c m_free(m); break; } - mb_ctor_clust(clust, MCLBYTES, m, 0); + mb_ctor_clust(clust, nd_clsize, m, 0); store[i] = m; } return (i); From owner-svn-src-user@freebsd.org Wed Apr 11 14:38:57 2018 Return-Path: Delivered-To: svn-src-user@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 C9E55F9983A for ; Wed, 11 Apr 2018 14:38: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 766C384C9A; Wed, 11 Apr 2018 14:38: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 716C51D7A5; Wed, 11 Apr 2018 14:38: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 w3BEcv9N028601; Wed, 11 Apr 2018 14:38:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BEcuRG028591; Wed, 11 Apr 2018 14:38:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804111438.w3BEcuRG028591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 14:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332407 - in user/markj/netdump/sys: dev/alc dev/bge dev/bxe dev/cxgb dev/mlx4/mlx4_en dev/re dev/virtio/network net netinet/netdump X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump/sys: dev/alc dev/bge dev/bxe dev/cxgb dev/mlx4/mlx4_en dev/re dev/virtio/network net netinet/netdump X-SVN-Commit-Revision: 332407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 14:38:58 -0000 Author: markj Date: Wed Apr 11 14:38:56 2018 New Revision: 332407 URL: https://svnweb.freebsd.org/changeset/base/332407 Log: Let the driver specify the required number of netdump clusters. In most cases, NETDUMP_MAX_IN_FLIGHT (64) is sufficient. However, the iflib and cxgb rx buffer allocation schemes have an edge case which make this insufficient. Both drivers allocate mbufs and clusters separately and keep them in separate arrays. If a received packet can fit in the mbuf, the cluster at the corresponding index is not consumed and will simply be left alone until the consumer wraps around. netdump ACKs fit in an mbuf's inline buffer, so the clusters are generally not used at all. However, if the drivers fail to allocate a cluster for a given producer index, they will not replenish the mbuf either, so unless there are enough pre-allocated clusters for the whole ring (which almost certainly has more than 64 entries), we quickly stop being able to receive packets. For these drivers, be sure to pre-allocate enough clusters to avoid the problem. This is quite wasteful but is the simplest path forward for now. Other drivers continue to pre-allocate 64 clusters. Modified: user/markj/netdump/sys/dev/alc/if_alc.c user/markj/netdump/sys/dev/bge/if_bge.c user/markj/netdump/sys/dev/bxe/bxe.c user/markj/netdump/sys/dev/cxgb/cxgb_main.c user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c user/markj/netdump/sys/dev/re/if_re.c user/markj/netdump/sys/dev/virtio/network/if_vtnet.c user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/netinet/netdump/netdump.h user/markj/netdump/sys/netinet/netdump/netdump_client.c Modified: user/markj/netdump/sys/dev/alc/if_alc.c ============================================================================== --- user/markj/netdump/sys/dev/alc/if_alc.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/alc/if_alc.c Wed Apr 11 14:38:56 2018 (r332407) @@ -4658,7 +4658,7 @@ sysctl_hw_alc_int_mod(SYSCTL_HANDLER_ARGS) #ifdef NETDUMP static void -alc_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +alc_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { struct alc_softc *sc; @@ -4666,6 +4666,7 @@ alc_netdump_init(struct ifnet *ifp, int *nrxr, int *cl KASSERT(sc->alc_buf_size <= MCLBYTES, ("incorrect cluster size")); *nrxr = ALC_RX_RING_CNT; + *ncl = NETDUMP_MAX_IN_FLIGHT; *clsize = MCLBYTES; } Modified: user/markj/netdump/sys/dev/bge/if_bge.c ============================================================================== --- user/markj/netdump/sys/dev/bge/if_bge.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/bge/if_bge.c Wed Apr 11 14:38:56 2018 (r332407) @@ -6811,13 +6811,14 @@ bge_get_counter(if_t ifp, ift_counter cnt) #ifdef NETDUMP static void -bge_netdump_init(if_t ifp, int *nrxr, int *clsize) +bge_netdump_init(if_t ifp, int *nrxr, int *ncl, int *clsize) { struct bge_softc *sc; sc = if_getsoftc(ifp); BGE_LOCK(sc); *nrxr = sc->bge_return_ring_cnt; + *ncl = NETDUMP_MAX_IN_FLIGHT; if ((sc->bge_flags & BGE_FLAG_JUMBO_STD) != 0 && (if_getmtu(sc->bge_ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) Modified: user/markj/netdump/sys/dev/bxe/bxe.c ============================================================================== --- user/markj/netdump/sys/dev/bxe/bxe.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/bxe/bxe.c Wed Apr 11 14:38:56 2018 (r332407) @@ -19172,13 +19172,14 @@ bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, #ifdef NETDUMP static void -bxe_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +bxe_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { struct bxe_softc *sc; sc = if_getsoftc(ifp); BXE_CORE_LOCK(sc); *nrxr = sc->num_queues; + *ncl = NETDUMP_MAX_IN_FLIGHT; *clsize = sc->fp[0].mbuf_alloc_size; BXE_CORE_UNLOCK(sc); } Modified: user/markj/netdump/sys/dev/cxgb/cxgb_main.c ============================================================================== --- user/markj/netdump/sys/dev/cxgb/cxgb_main.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/cxgb/cxgb_main.c Wed Apr 11 14:38:56 2018 (r332407) @@ -3587,7 +3587,7 @@ cxgbc_mod_event(module_t mod, int cmd, void *arg) #ifdef NETDUMP static void -cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { struct port_info *pi; adapter_t *adap; @@ -3596,6 +3596,7 @@ cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *c adap = pi->adapter; ADAPTER_LOCK(adap); *nrxr = SGE_QSETS; + *ncl = adap->sge.qs[0].fl[1].size; *clsize = adap->sge.qs[0].fl[1].buf_size; ADAPTER_UNLOCK(adap); } Modified: user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Wed Apr 11 14:38:56 2018 (r332407) @@ -2886,13 +2886,14 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p #ifdef NETDUMP static void -mlx4_en_netdump_init(struct ifnet *dev, int *nrxr, int *clsize) +mlx4_en_netdump_init(struct ifnet *dev, int *nrxr, int *ncl, int *clsize) { struct mlx4_en_priv *priv; priv = if_getsoftc(dev); mutex_lock(&priv->mdev->state_lock); *nrxr = priv->rx_ring_num; + *ncl = NETDUMP_MAX_IN_FLIGHT; *clsize = priv->rx_mb_size; mutex_unlock(&priv->mdev->state_lock); } Modified: user/markj/netdump/sys/dev/re/if_re.c ============================================================================== --- user/markj/netdump/sys/dev/re/if_re.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/re/if_re.c Wed Apr 11 14:38:56 2018 (r332407) @@ -4095,13 +4095,14 @@ sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) #ifdef NETDUMP static void -re_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +re_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { struct rl_softc *sc; sc = if_getsoftc(ifp); RL_LOCK(sc); *nrxr = sc->rl_ldata.rl_rx_desc_cnt; + *ncl = NETDUMP_MAX_IN_FLIGHT; *clsize = (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) ? MJUM9BYTES : MCLBYTES; RL_UNLOCK(sc); Modified: user/markj/netdump/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/dev/virtio/network/if_vtnet.c Wed Apr 11 14:38:56 2018 (r332407) @@ -3984,7 +3984,7 @@ vtnet_tunable_int(struct vtnet_softc *sc, const char * #ifdef NETDUMP static void -vtnet_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +vtnet_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { struct vtnet_softc *sc; @@ -3992,6 +3992,7 @@ vtnet_netdump_init(struct ifnet *ifp, int *nrxr, int * VTNET_CORE_LOCK(sc); *nrxr = sc->vtnet_max_vq_pairs; + *ncl = NETDUMP_MAX_IN_FLIGHT; *clsize = sc->vtnet_rx_clsize; VTNET_CORE_UNLOCK(sc); Modified: user/markj/netdump/sys/net/iflib.c ============================================================================== --- user/markj/netdump/sys/net/iflib.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/net/iflib.c Wed Apr 11 14:38:56 2018 (r332407) @@ -5974,13 +5974,14 @@ iflib_fixup_rx(struct mbuf *m) #ifdef NETDUMP static void -iflib_netdump_init(struct ifnet *ifp, int *nrxr, int *clsize) +iflib_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) { if_ctx_t ctx; ctx = if_getsoftc(ifp); CTX_LOCK(ctx); *nrxr = NRXQSETS(ctx); + *ncl = ctx->ifc_rxqs[0].ifr_fl->ifl_size; *clsize = ctx->ifc_rxqs[0].ifr_fl->ifl_buf_size; CTX_UNLOCK(ctx); } Modified: user/markj/netdump/sys/netinet/netdump/netdump.h ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump.h Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/netinet/netdump/netdump.h Wed Apr 11 14:38:56 2018 (r332407) @@ -88,7 +88,7 @@ struct mbuf; void netdump_reinit(struct ifnet *); -typedef void netdump_init_t(struct ifnet *, int *nrxr, int *clsize); +typedef void netdump_init_t(struct ifnet *, int *nrxr, int *ncl, int *clsize); typedef void netdump_event_t(struct ifnet *, enum netdump_ev); typedef int netdump_transmit_t(struct ifnet *, struct mbuf *); typedef int netdump_poll_t(struct ifnet *, int); Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump_client.c Wed Apr 11 14:24:11 2018 (r332406) +++ user/markj/netdump/sys/netinet/netdump/netdump_client.c Wed Apr 11 14:38:56 2018 (r332407) @@ -1081,21 +1081,21 @@ netdump_configure(struct netdump_conf *conf) void netdump_reinit(struct ifnet *ifp) { - int clsize, nmbuf, nclust, nrxr; + int clsize, nmbuf, ncl, nrxr; if (ifp != nd_ifp) return; - ifp->if_netdump_methods->nd_init(ifp, &nrxr, &clsize); + ifp->if_netdump_methods->nd_init(ifp, &nrxr, &ncl, &clsize); KASSERT(nrxr > 0, ("invalid receive ring count %d", nrxr)); /* * We need two headers per message on the transmit side. Multiply by * four to give us some breathing room. */ - nmbuf = NETDUMP_MAX_IN_FLIGHT * (4 + nrxr); - nclust = NETDUMP_MAX_IN_FLIGHT * nrxr; - netdump_mbuf_reinit(nmbuf, nclust, clsize); + nmbuf = ncl * (4 + nrxr); + ncl *= nrxr; + netdump_mbuf_reinit(nmbuf, ncl, clsize); } /* From owner-svn-src-user@freebsd.org Wed Apr 11 15:04:34 2018 Return-Path: Delivered-To: svn-src-user@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 C0FD6F9BC32 for ; Wed, 11 Apr 2018 15:04:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 6A4086CDF6; Wed, 11 Apr 2018 15:04:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62C151DCA0; Wed, 11 Apr 2018 15:04:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BF4XrH046685; Wed, 11 Apr 2018 15:04:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BF4Vsw046666; Wed, 11 Apr 2018 15:04:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804111504.w3BF4Vsw046666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 15:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332408 - in user/markj/netdump: bin/setfacl release/amd64 release/arm64 release/i386 release/powerpc sbin/camcontrol sbin/geom/class/eli sbin/ipfw share/man/man7 share/man/man9 share/m... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: bin/setfacl release/amd64 release/arm64 release/i386 release/powerpc sbin/camcontrol sbin/geom/class/eli sbin/ipfw share/man/man7 share/man/man9 share/misc sys/arm/amlogic/aml87... X-SVN-Commit-Revision: 332408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 15:04:34 -0000 Author: markj Date: Wed Apr 11 15:04:31 2018 New Revision: 332408 URL: https://svnweb.freebsd.org/changeset/base/332408 Log: MFH at r332407. Added: user/markj/netdump/share/man/man9/OF_child.9 - copied unchanged from r332407, head/share/man/man9/OF_child.9 user/markj/netdump/share/man/man9/OF_device_from_xref.9 - copied unchanged from r332407, head/share/man/man9/OF_device_from_xref.9 user/markj/netdump/share/man/man9/OF_finddevice.9 - copied unchanged from r332407, head/share/man/man9/OF_finddevice.9 user/markj/netdump/share/man/man9/OF_getprop.9 - copied unchanged from r332407, head/share/man/man9/OF_getprop.9 user/markj/netdump/share/man/man9/OF_node_from_xref.9 - copied unchanged from r332407, head/share/man/man9/OF_node_from_xref.9 user/markj/netdump/share/man/man9/OF_package_to_path.9 - copied unchanged from r332407, head/share/man/man9/OF_package_to_path.9 user/markj/netdump/sys/arm64/qualcomm/ - copied from r332407, head/sys/arm64/qualcomm/ Deleted: user/markj/netdump/sys/dts/arm/armada-380.dtsi user/markj/netdump/sys/dts/arm/armada-385-db-ap.dts user/markj/netdump/sys/dts/arm/armada-385.dtsi user/markj/netdump/sys/dts/arm/armada-388-clearfog.dts user/markj/netdump/sys/dts/arm/armada-388-gp.dts user/markj/netdump/sys/dts/arm/armada-388.dtsi user/markj/netdump/sys/dts/arm/armada-38x-solidrun-microsom.dtsi user/markj/netdump/sys/dts/arm/armada-38x.dtsi Modified: user/markj/netdump/bin/setfacl/setfacl.1 user/markj/netdump/bin/setfacl/setfacl.c user/markj/netdump/bin/setfacl/setfacl.h user/markj/netdump/bin/setfacl/util.c user/markj/netdump/release/amd64/make-memstick.sh user/markj/netdump/release/amd64/mkisoimages.sh user/markj/netdump/release/arm64/RPI3.conf user/markj/netdump/release/arm64/make-memstick.sh user/markj/netdump/release/i386/make-memstick.sh user/markj/netdump/release/powerpc/make-memstick.sh user/markj/netdump/sbin/camcontrol/camcontrol.8 user/markj/netdump/sbin/geom/class/eli/geli.8 user/markj/netdump/sbin/geom/class/eli/geom_eli.c user/markj/netdump/sbin/ipfw/ipfw.8 user/markj/netdump/share/man/man7/development.7 user/markj/netdump/share/man/man9/Makefile user/markj/netdump/share/misc/committers-src.dot user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c user/markj/netdump/sys/arm/annapurna/alpine/alpine_pci_msix.c user/markj/netdump/sys/arm/at91/at91_pinctrl.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_gpio.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/markj/netdump/sys/arm/freescale/imx/imx_iomux.c user/markj/netdump/sys/arm/mv/mv_common.c user/markj/netdump/sys/arm/mv/mvwin.h user/markj/netdump/sys/arm/nvidia/drm2/tegra_drm_subr.c user/markj/netdump/sys/arm/ti/ti_adc.c user/markj/netdump/sys/arm/ti/ti_pinmux.c user/markj/netdump/sys/arm64/conf/GENERIC user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/markj/netdump/sys/cddl/dev/dtrace/dtrace_cddl.h user/markj/netdump/sys/conf/files.arm64 user/markj/netdump/sys/dev/cesa/cesa.c user/markj/netdump/sys/dev/cesa/cesa.h user/markj/netdump/sys/dev/cpufreq/cpufreq_dt.c user/markj/netdump/sys/dev/dpaa/qman_fdt.c user/markj/netdump/sys/dev/etherswitch/e6000sw/e6000sw.c user/markj/netdump/sys/dev/extres/clk/clk.c user/markj/netdump/sys/dev/extres/phy/phy.c user/markj/netdump/sys/dev/extres/regulator/regulator.c user/markj/netdump/sys/dev/extres/syscon/syscon.c user/markj/netdump/sys/dev/fdt/fdt_clock.c user/markj/netdump/sys/dev/fdt/fdt_pinctrl.c user/markj/netdump/sys/dev/gpio/gpioregulator.c user/markj/netdump/sys/dev/gpio/ofw_gpiobus.c user/markj/netdump/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/markj/netdump/sys/dev/ofw/ofw_bus_subr.c user/markj/netdump/sys/dev/ofw/openfirm.c user/markj/netdump/sys/dev/ofw/openfirm.h user/markj/netdump/sys/dev/pci/pci_user.c user/markj/netdump/sys/dev/vnic/thunder_bgx_fdt.c user/markj/netdump/sys/geom/bde/g_bde.c user/markj/netdump/sys/geom/cache/g_cache.c user/markj/netdump/sys/geom/concat/g_concat.c user/markj/netdump/sys/geom/eli/g_eli.c user/markj/netdump/sys/geom/eli/g_eli_ctl.c user/markj/netdump/sys/geom/gate/g_gate.c user/markj/netdump/sys/geom/geom_bsd.c user/markj/netdump/sys/geom/geom_ccd.c user/markj/netdump/sys/geom/geom_fox.c user/markj/netdump/sys/geom/geom_map.c user/markj/netdump/sys/geom/geom_mbr.c user/markj/netdump/sys/geom/geom_redboot.c user/markj/netdump/sys/geom/geom_sunlabel.c user/markj/netdump/sys/geom/geom_vol_ffs.c user/markj/netdump/sys/geom/journal/g_journal_ufs.c user/markj/netdump/sys/geom/label/g_label.c user/markj/netdump/sys/geom/linux_lvm/g_linux_lvm.c user/markj/netdump/sys/geom/mirror/g_mirror.c user/markj/netdump/sys/geom/mountver/g_mountver.c user/markj/netdump/sys/geom/multipath/g_multipath.c user/markj/netdump/sys/geom/nop/g_nop.c user/markj/netdump/sys/geom/part/g_part_apm.c user/markj/netdump/sys/geom/part/g_part_bsd.c user/markj/netdump/sys/geom/part/g_part_bsd64.c user/markj/netdump/sys/geom/part/g_part_ebr.c user/markj/netdump/sys/geom/part/g_part_gpt.c user/markj/netdump/sys/geom/part/g_part_ldm.c user/markj/netdump/sys/geom/part/g_part_mbr.c user/markj/netdump/sys/geom/part/g_part_vtoc8.c user/markj/netdump/sys/geom/raid3/g_raid3.c user/markj/netdump/sys/geom/shsec/g_shsec.c user/markj/netdump/sys/geom/stripe/g_stripe.c user/markj/netdump/sys/geom/uzip/g_uzip.c user/markj/netdump/sys/geom/vinum/geom_vinum.c user/markj/netdump/sys/geom/virstor/g_virstor.c user/markj/netdump/sys/geom/zero/g_zero.c user/markj/netdump/sys/kern/kern_environment.c user/markj/netdump/sys/kern/kern_rwlock.c user/markj/netdump/sys/kern/kern_sx.c user/markj/netdump/sys/kern/subr_witness.c user/markj/netdump/sys/mips/ingenic/jz4780_pinctrl.c user/markj/netdump/sys/mips/mediatek/fdt_reset.c user/markj/netdump/sys/net/bpf.c user/markj/netdump/sys/net/bpfdesc.h user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/netinet/tcp_log_buf.c user/markj/netdump/sys/netinet/tcp_output.c user/markj/netdump/sys/netinet/tcp_subr.c user/markj/netdump/sys/netinet/tcp_var.h user/markj/netdump/sys/netpfil/ipfw/ip_fw_table.c user/markj/netdump/sys/netpfil/pf/pf.c user/markj/netdump/sys/netpfil/pf/pf_ioctl.c user/markj/netdump/sys/powerpc/booke/trap_subr.S user/markj/netdump/sys/powerpc/mpc85xx/lbc.c user/markj/netdump/sys/powerpc/powerpc/trap.c user/markj/netdump/tests/sys/acl/run user/markj/netdump/tests/sys/netpfil/Makefile user/markj/netdump/usr.bin/head/head.1 user/markj/netdump/usr.bin/head/head.c user/markj/netdump/usr.bin/systat/sctp.c user/markj/netdump/usr.bin/tail/tail.1 user/markj/netdump/usr.bin/tail/tail.c user/markj/netdump/usr.sbin/ctld/ctl.conf.5 Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/bin/setfacl/setfacl.1 ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.1 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.1 Wed Apr 11 15:04:31 2018 (r332408) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd April 10, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nd set ACL information .Sh SYNOPSIS .Nm +.Op Fl R Op Fl H | L | P .Op Fl bdhkn .Op Fl a Ar position entries .Op Fl m Ar entries @@ -79,18 +80,30 @@ entries of the current ACL. The operations apply to the default ACL entries instead of access ACL entries. Currently only directories may have -default ACL's. This option is not applicable to NFSv4 ACLs. +default ACL's. +This option is not applicable to NFSv4 ACLs. .It Fl h If the target of the operation is a symbolic link, perform the operation on the symbolic link itself, rather than following the link. +.It Fl H +If the +.Fl R +option is specified, symbolic links on the command line are followed +and hence unaffected by the command. +(Symbolic links encountered during tree traversal are not followed.) .It Fl k Delete any default ACL entries on the specified files. It is not considered an error if the specified files do not have any default ACL entries. An error will be reported if any of -the specified files cannot have a default entry (i.e.\& -non-directories). This option is not applicable to NFSv4 ACLs. +the specified files cannot have a default entry (i.e., +non-directories). +This option is not applicable to NFSv4 ACLs. +.It Fl L +If the +.Fl R +option is specified, all symbolic links are followed. .It Fl m Ar entries Modify the ACL on the specified file. New entries will be added, and existing entries will be modified @@ -116,6 +129,13 @@ the input is taken from stdin. Do not recalculate the permissions associated with the ACL mask entry. This option is not applicable to NFSv4 ACLs. +.It Fl P +If the +.Fl R +option is specified, no symbolic links are followed. +This is the default. +.It Fl R +Perform the action recursively on any specified directories. .It Fl x Ar entries | position If .Ar entries Modified: user/markj/netdump/bin/setfacl/setfacl.c ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.c Wed Apr 11 15:04:31 2018 (r332408) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include @@ -59,41 +62,20 @@ struct sf_entry { }; static TAILQ_HEAD(, sf_entry) entrylist; -/* TAILQ entry for files */ -struct sf_file { - const char *filename; - TAILQ_ENTRY(sf_file) next; -}; -static TAILQ_HEAD(, sf_file) filelist; - uint have_mask; uint need_mask; uint have_stdin; uint n_flag; -static void add_filename(const char *filename); static void usage(void); static void -add_filename(const char *filename) -{ - struct sf_file *file; - - if (strlen(filename) > PATH_MAX - 1) { - warn("illegal filename"); - return; - } - file = zmalloc(sizeof(struct sf_file)); - file->filename = filename; - TAILQ_INSERT_TAIL(&filelist, file, next); -} - -static void usage(void) { - fprintf(stderr, "usage: setfacl [-bdhkn] [-a position entries] " - "[-m entries] [-M file] [-x entries] [-X file] [file ...]\n"); + fprintf(stderr, "usage: setfacl [-R [-H | -L | -P]] [-bdhkn] " + "[-a position entries] [-m entries] [-M file] " + "[-x entries] [-X file] [file ...]\n"); exit(1); } @@ -104,23 +86,32 @@ main(int argc, char *argv[]) acl_type_t acl_type; acl_entry_t unused_entry; char filename[PATH_MAX]; - int local_error, carried_error, ch, i, entry_number, ret; - int h_flag; - struct sf_file *file; + int local_error, carried_error, ch, entry_number, ret, fts_options; + bool h_flag, H_flag, L_flag, R_flag, follow_symlink; + size_t fl_count, i; + FTS *ftsp; + FTSENT *file; + char **files_list; struct sf_entry *entry; - const char *fn_dup; char *end; - struct stat sb; acl_type = ACL_TYPE_ACCESS; - carried_error = local_error = 0; - h_flag = have_mask = have_stdin = n_flag = need_mask = 0; + carried_error = local_error = fts_options = 0; + have_mask = have_stdin = n_flag = need_mask = 0; + h_flag = H_flag = L_flag = R_flag = false; TAILQ_INIT(&entrylist); - TAILQ_INIT(&filelist); - while ((ch = getopt(argc, argv, "M:X:a:bdhkm:nx:")) != -1) + while ((ch = getopt(argc, argv, "HLM:PRX:a:bdhkm:nx:")) != -1) switch(ch) { + case 'H': + H_flag = true; + L_flag = false; + break; + case 'L': + L_flag = true; + H_flag = false; + break; case 'M': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -129,6 +120,12 @@ main(int argc, char *argv[]) entry->op = OP_MERGE_ACL; TAILQ_INSERT_TAIL(&entrylist, entry, next); break; + case 'P': + H_flag = L_flag = false; + break; + case 'R': + R_flag = true; + break; case 'X': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -213,43 +210,93 @@ main(int argc, char *argv[]) err(1, "cannot have more than one stdin"); have_stdin = 1; bzero(&filename, sizeof(filename)); + i = 0; + /* Start with an array size sufficient for basic cases. */ + fl_count = 1024; + files_list = zmalloc(fl_count * sizeof(char *)); while (fgets(filename, (int)sizeof(filename), stdin)) { /* remove the \n */ filename[strlen(filename) - 1] = '\0'; - fn_dup = strdup(filename); - if (fn_dup == NULL) + files_list[i] = strdup(filename); + if (files_list[i] == NULL) err(1, "strdup() failed"); - add_filename(fn_dup); + /* Grow array if necessary. */ + if (++i == fl_count) { + fl_count <<= 1; + if (fl_count > SIZE_MAX / sizeof(char *)) + errx(1, "Too many input files"); + files_list = zrealloc(files_list, + fl_count * sizeof(char *)); + } } + + /* fts_open() requires the last array element to be NULL. */ + files_list[i] = NULL; } else - for (i = 0; i < argc; i++) - add_filename(argv[i]); + files_list = argv; - /* cycle through each file */ - TAILQ_FOREACH(file, &filelist, next) { - local_error = 0; + if (R_flag) { + if (h_flag) + errx(1, "the -R and -h options may not be " + "specified together."); + if (L_flag) { + fts_options = FTS_LOGICAL; + } else { + fts_options = FTS_PHYSICAL; - if (stat(file->filename, &sb) == -1) { - warn("%s: stat() failed", file->filename); - carried_error++; + if (H_flag) { + fts_options |= FTS_COMFOLLOW; + } + } + } else if (h_flag) { + fts_options = FTS_PHYSICAL; + } else { + fts_options = FTS_LOGICAL; + } + + /* Open all files. */ + if ((ftsp = fts_open(files_list, fts_options | FTS_NOSTAT, 0)) == NULL) + err(1, "fts_open"); + while ((file = fts_read(ftsp)) != NULL) { + switch (file->fts_info) { + case FTS_D: + /* Do not recurse if -R not specified. */ + if (!R_flag) + fts_set(ftsp, file, FTS_SKIP); + break; + case FTS_DP: + /* Skip the second visit to a directory. */ continue; + case FTS_DNR: + case FTS_ERR: + warnx("%s: %s", file->fts_path, + strerror(file->fts_errno)); + continue; + default: + break; } - if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) { - warnx("%s: default ACL may only be set on a directory", - file->filename); + if (acl_type == ACL_TYPE_DEFAULT && file->fts_info != FTS_D) { + warnx("%s: default ACL may only be set on " + "a directory", file->fts_path); carried_error++; continue; } - if (h_flag) - ret = lpathconf(file->filename, _PC_ACL_NFS4); + local_error = 0; + + follow_symlink = ((fts_options & FTS_LOGICAL) || + ((fts_options & FTS_COMFOLLOW) && + file->fts_level == FTS_ROOTLEVEL)); + + if (follow_symlink) + ret = pathconf(file->fts_accpath, _PC_ACL_NFS4); else - ret = pathconf(file->filename, _PC_ACL_NFS4); + ret = lpathconf(file->fts_accpath, _PC_ACL_NFS4); if (ret > 0) { if (acl_type == ACL_TYPE_DEFAULT) { warnx("%s: there are no default entries " - "in NFSv4 ACLs", file->filename); + "in NFSv4 ACLs", file->fts_path); carried_error++; continue; } @@ -259,20 +306,20 @@ main(int argc, char *argv[]) acl_type = ACL_TYPE_ACCESS; } else if (ret < 0 && errno != EINVAL) { warn("%s: pathconf(..., _PC_ACL_NFS4) failed", - file->filename); + file->fts_path); } - if (h_flag) - acl = acl_get_link_np(file->filename, acl_type); + if (follow_symlink) + acl = acl_get_file(file->fts_accpath, acl_type); else - acl = acl_get_file(file->filename, acl_type); + acl = acl_get_link_np(file->fts_accpath, acl_type); if (acl == NULL) { - if (h_flag) - warn("%s: acl_get_link_np() failed", - file->filename); - else + if (follow_symlink) warn("%s: acl_get_file() failed", - file->filename); + file->fts_path); + else + warn("%s: acl_get_link_np() failed", + file->fts_path); carried_error++; continue; } @@ -285,11 +332,12 @@ main(int argc, char *argv[]) switch(entry->op) { case OP_ADD_ACL: local_error += add_acl(entry->acl, - entry->entry_number, &acl, file->filename); + entry->entry_number, + &acl, file->fts_path); break; case OP_MERGE_ACL: local_error += merge_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_EXT: @@ -301,37 +349,37 @@ main(int argc, char *argv[]) acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { local_error += remove_default(&acl, - file->filename); + file->fts_path); break; } - remove_ext(&acl, file->filename); + remove_ext(&acl, file->fts_path); need_mask = 0; break; case OP_REMOVE_DEF: if (acl_type == ACL_TYPE_NFS4) { warnx("%s: there are no default entries in NFSv4 ACLs; " - "cannot remove", file->filename); + "cannot remove", file->fts_path); local_error++; break; } - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); local_error++; } if (acl_type == ACL_TYPE_DEFAULT) local_error += remove_default(&acl, - file->filename); + file->fts_path); need_mask = 0; break; case OP_REMOVE_ACL: local_error += remove_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_BY_NUMBER: local_error += remove_by_number(entry->entry_number, - &acl, file->filename); + &acl, file->fts_path); need_mask = 1; break; } @@ -343,9 +391,9 @@ main(int argc, char *argv[]) */ if (acl_type == ACL_TYPE_DEFAULT && acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); carried_error++; } continue; @@ -358,22 +406,22 @@ main(int argc, char *argv[]) } if (acl_type != ACL_TYPE_NFS4 && need_mask && - set_acl_mask(&acl, file->filename) == -1) { - warnx("%s: failed to set ACL mask", file->filename); + set_acl_mask(&acl, file->fts_path) == -1) { + warnx("%s: failed to set ACL mask", file->fts_path); carried_error++; - } else if (h_flag) { - if (acl_set_link_np(file->filename, acl_type, + } else if (follow_symlink) { + if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_link_np() failed", - file->filename); + warn("%s: acl_set_file() failed", + file->fts_path); } } else { - if (acl_set_file(file->filename, acl_type, + if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_file() failed", - file->filename); + warn("%s: acl_set_link_np() failed", + file->fts_path); } } Modified: user/markj/netdump/bin/setfacl/setfacl.h ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.h Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.h Wed Apr 11 15:04:31 2018 (r332408) @@ -47,6 +47,7 @@ void remove_ext(acl_t *prev_acl, const char *filenam int set_acl_mask(acl_t *prev_acl, const char *filename); /* util.c */ void *zmalloc(size_t size); +void *zrealloc(void *ptr, size_t size); const char *brand_name(int brand); int branding_mismatch(int brand1, int brand2); Modified: user/markj/netdump/bin/setfacl/util.c ============================================================================== --- user/markj/netdump/bin/setfacl/util.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/util.c Wed Apr 11 15:04:31 2018 (r332408) @@ -44,6 +44,17 @@ zmalloc(size_t size) return (ptr); } +void * +zrealloc(void *ptr, size_t size) +{ + void *newptr; + + newptr = realloc(ptr, size); + if (newptr == NULL) + err(1, "realloc() failed"); + return (newptr); +} + const char * brand_name(int brand) { Modified: user/markj/netdump/release/amd64/make-memstick.sh ============================================================================== --- user/markj/netdump/release/amd64/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/amd64/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,12 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/amd64/mkisoimages.sh ============================================================================== --- user/markj/netdump/release/amd64/mkisoimages.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/amd64/mkisoimages.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=efi;efiboot.img -o no-emul-boot $bootable" + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi $bootable" shift else Modified: user/markj/netdump/release/arm64/RPI3.conf ============================================================================== --- user/markj/netdump/release/arm64/RPI3.conf Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/arm64/RPI3.conf Wed Apr 11 15:04:31 2018 (r332408) @@ -22,9 +22,10 @@ export BOARDNAME="RPI3" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3" - UBOOT_FILES="LICENCE.broadcom README armstub8.bin bootcode.bin config.txt \ - fixup.dat fixup_cd.dat fixup_x.dat start.elf start_cd.elf \ - start_x.elf u-boot.bin" + UBOOT_FILES="README u-boot.bin" + DTB_FILES="armstub8.bin bootcode.bin config.txt fixup_cd.dat \ + fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ + start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" UFSMOUNT="${DESTDIR%${KERNEL}}ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -34,7 +35,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${DTB} ${FATMOUNT}/${DTB} + for _DF in ${DTB_FILES}; do + chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ + ${FATMOUNT}/${_DF} + done chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays for _OL in ${OVERLAYS}; do chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ Modified: user/markj/netdump/release/arm64/make-memstick.sh ============================================================================== --- user/markj/netdump/release/arm64/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/arm64/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} +mkimg -s gpt \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd:=${2}.part \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/i386/make-memstick.sh ============================================================================== --- user/markj/netdump/release/i386/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/i386/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,11 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/powerpc/make-memstick.sh ============================================================================== --- user/markj/netdump/release/powerpc/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/powerpc/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -41,7 +41,10 @@ makefs -B big -o version=2 ${tempfile} ${1} rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} +mkimg -s apm \ + -p freebsd-boot:=${1}/boot/boot1.hfs \ + -p freebsd-ufs/FreeBSD_Install:=${tempfile} \ + -o ${2} rm -f ${tempfile} Modified: user/markj/netdump/sbin/camcontrol/camcontrol.8 ============================================================================== --- user/markj/netdump/sbin/camcontrol/camcontrol.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/camcontrol/camcontrol.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -561,7 +561,7 @@ the blocksize. Note that this command only displays the information, it does not update the kernel data structures. Use the -.Nm +.Nm reprobe subcommand to do that. .It Ic start Send the SCSI Start/Stop Unit (0x1B) command to the given device with the @@ -1593,7 +1593,7 @@ If the device is a .Tn SCSI device and it provides a recommended timeout for the WRITE BUFFER command (see the -.Nm +.Nm opcodes subcommand), that timeout will be used for the firmware download. The drive-recommended timeout value may be overridden on the command line with the @@ -1644,12 +1644,12 @@ will currently attempt a firmware download to any .Tn ATA or .Tn SATA -device, since the standard +device, since the standard .Tn ATA DOWNLOAD MICROCODE command may work. Firmware downloads to .Tn ATA -and +and .Tn SATA devices are supported for devices connected to standard @@ -1658,7 +1658,7 @@ and .Tn SATA controllers, and devices connected to SAS controllers with -.Tn SCSI +.Tn SCSI to .Tn ATA translation capability. @@ -1667,7 +1667,7 @@ In the latter case, uses the .Tn SCSI .Tn ATA -PASS-THROUGH command to send the +PASS-THROUGH command to send the .Tn ATA DOWNLOAD MICROCODE command to the drive. Some @@ -1991,9 +1991,9 @@ For instance, .Tn LTO tapes have MAM. Either the -.Fl r +.Fl r option or the -.Fl w +.Fl w option must be specified. .Bl -tag -width 14n .It Fl r Ar action @@ -2022,7 +2022,7 @@ This option is not yet implemented. .It Fl a Ar num Specify the attribute number to display. This option only works with the attr_values, attr_list and supp_attr -arguments to +arguments to .Fl r . .It Fl c Display cached attributes. @@ -2038,7 +2038,7 @@ Specify the output format for the attribute values (at comma separated list of options. The default output is currently set to field_all,nonascii_trim,text_raw. Once this code is ported to FreeBSD 10, any text fields will be converted -from their codeset to the user's native codeset with +from their codeset to the user's native codeset with .Xr iconv 3 . .Pp The text options are mutually exclusive; if you specify more than one, you @@ -2146,7 +2146,7 @@ action. This requests that the device report Nominal and Recommended timeout values for the given command or commands. The timeout values are in seconds. -The timeout descriptor also includes a command-specific +The timeout descriptor also includes a command-specific .El .It Ic zone Manage @@ -2287,8 +2287,8 @@ The summary and column headings are printed, fields ar and the fields themselves may contain spaces. .It summary Just print the summary: the number of zones, the maximum LBA (LBA of the -last logical block on the drive), and the value of the -.Dq same +last logical block on the drive), and the value of the +.Dq same field. The .Dq same @@ -2319,7 +2319,7 @@ to translation layer (SAT). It may be helpful to read the ATA Command Set - 4 (ACS-4) description of the Extended Power Conditions feature set, available at t13.org, to -understand the details of this particular +understand the details of this particular .Nm subcommand. .Bl -tag -width 6n @@ -2365,7 +2365,7 @@ Idle and Standby mode supported by the drive. .Bl -tag -width 8n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2395,7 +2395,7 @@ Enable or disable a particular power condition. .Bl -tag -width 7n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2485,7 +2485,7 @@ time, but override the system time zone and use UTC in .It Fl s Set the device's timestamp. Either the .Fl f -and +and .Fl T options or the .Fl U @@ -2494,7 +2494,7 @@ option must be specified. .It Fl f Ar format Specify the strptime format string, as documented in strptime(3). The time must also be specified with the -.Fl T +.Fl T option. .It Fl T Ar time Provide the time in the format specified with the @@ -2790,7 +2790,7 @@ camcontrol epc da4 -c goto -p Standby_z -H Tell drive .Pa da4 to go to the Standby_z power state (which is -the drive's lowest power state) and hold in that state until it is +the drive's lowest power state) and hold in that state until it is explicitly released by another .Cm goto command. @@ -2802,14 +2802,14 @@ camcontrol epc da2 -c status -P Report only the power state of drive .Pa da2 . -Some drives will power up in response to the commands sent by the +Some drives will power up in response to the commands sent by the .Pa status subcommand, and the .Fl P option causes .Nm to only send the -.Tn ATA +.Tn ATA CHECK POWER MODE command, which should not trigger a change in the drive's power state. .Pp @@ -2829,7 +2829,7 @@ camcontrol timestamp sa0 -s -f "%a, %d %b %Y %T %z" \e Set the timestamp of drive .Pa sa0 using a -.Xr strptime 3 +.Xr strptime 3 format string followed by a time string that was created using this format string. .Sh SEE ALSO Modified: user/markj/netdump/sbin/geom/class/eli/geli.8 ============================================================================== --- user/markj/netdump/sbin/geom/class/eli/geli.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/geom/class/eli/geli.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2017 +.Dd April 10, 2018 .Dt GELI 8 .Os .Sh NAME @@ -67,7 +67,7 @@ utility: .Cm init .Nm .Cm attach -.Op Fl dprv +.Op Fl dnprv .Op Fl j Ar passfile .Op Fl k Ar keyfile .Ar prov @@ -420,6 +420,9 @@ For more information see the description of the option for the .Cm init subcommand. +.It Fl n +Do a dry-run decryption. +This is useful to verify passphrase and keyfile without decrypting the device. .It Fl p Do not use a passphrase as a component of the User Key. Cannot be combined with the Modified: user/markj/netdump/sbin/geom/class/eli/geom_eli.c ============================================================================== --- user/markj/netdump/sbin/geom/class/eli/geom_eli.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/geom/class/eli/geom_eli.c Wed Apr 11 15:04:31 2018 (r332408) @@ -148,11 +148,12 @@ struct g_command class_commands[] = { { 'd', "detach", NULL, G_TYPE_BOOL }, { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'n', "dryrun", NULL, G_TYPE_BOOL }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-dprv] [-j passfile] [-k keyfile] prov" + "[-dnprv] [-j passfile] [-k keyfile] prov" }, { "detach", 0, NULL, { Modified: user/markj/netdump/sbin/ipfw/ipfw.8 ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/ipfw/ipfw.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -2233,7 +2233,7 @@ of the firewall and quickly (and atomically) switch be By default, tables from set 0 are referenced when adding rule with table opcodes regardless of rule set. This behavior can be changed by setting -.Va net.inet.ip.fw.tables_set +.Va net.inet.ip.fw.tables_sets variable to 1. Rule's set will then be used for table references. .Pp Modified: user/markj/netdump/share/man/man7/development.7 ============================================================================== --- user/markj/netdump/share/man/man7/development.7 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/share/man/man7/development.7 Wed Apr 11 15:04:31 2018 (r332408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2018 +.Dd April 10, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -75,6 +75,11 @@ Build instructions can be found in .Xr build 7 and .Xr release 7 . +Kernel APIs are usually documented, use +.Cm apropos -s 9 '' +for a list. +Regression test suite is described in +.Xr tests 7 . For coding conventions, see .Xr style 9 . .Pp Modified: user/markj/netdump/share/man/man9/Makefile ============================================================================== --- user/markj/netdump/share/man/man9/Makefile Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/share/man/man9/Makefile Wed Apr 11 15:04:31 2018 (r332408) @@ -208,6 +208,12 @@ MAN= accept_filter.9 \ namei.9 \ netisr.9 \ nv.9 \ + OF_child.9 \ + OF_device_from_xref.9 \ + OF_finddevice.9 \ + OF_getprop.9 \ + OF_node_from_xref.9 \ + OF_package_to_path.9 \ ofw_bus_is_compatible.9 \ ofw_bus_status_okay.9 \ osd.9 \ @@ -1527,6 +1533,21 @@ MLINKS+=nv.9 libnv.9 \ nv.9 nvlist_take_string_array.9 \ nv.9 nvlist_unpack.9 \ nv.9 nvlist_xfer.9 +MLINKS+=OF_child.9 OF_parent.9 \ + OF_child.9 OF_peer.9 +MLINKS+=OF_device_from_xref.9 OF_device_register_xref.9 \ + OF_device_from_xref.9 OF_xref_from_device.9 +MLINKS+=OF_getprop.9 OF_getencprop.9 \ + OF_getprop.9 OF_getencprop_alloc.9 \ + OF_getprop.9 OF_getprop_alloc.9 \ + OF_getprop.9 OF_getproplen.9 \ + OF_getprop.9 OF_hasprop.9 \ + OF_getprop.9 OF_nextprop.9 \ + OF_getprop.9 OF_prop_free.9 \ + OF_getprop.9 OF_searchencprop.9 \ + OF_getprop.9 OF_searchprop.9 \ + OF_getprop.9 OF_setprop.9 +MLINKS+=OF_node_from_xref.9 OF_xref_from_node.9 MLINKS+=ofw_bus_is_compatible.9 ofw_bus_is_compatible_strict.9 \ ofw_bus_is_compatible.9 ofw_bus_node_is_compatible.9 \ ofw_bus_is_compatible.9 ofw_bus_search_compatible.9 Copied: user/markj/netdump/share/man/man9/OF_child.9 (from r332407, head/share/man/man9/OF_child.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/share/man/man9/OF_child.9 Wed Apr 11 15:04:31 2018 (r332408, copy of r332407, head/share/man/man9/OF_child.9) @@ -0,0 +1,76 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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 April 9, 2018 +.Dt OF_CHILD 9 +.Os +.Sh NAME +.Nm OF_child , +.Nm OF_parent , +.Nm OF_peer +.Nd navigate device tree +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft phandle_t +.Fn OF_child "phandle_t node" +.Ft phandle_t +.Fn OF_parent "phandle_t node" +.Ft phandle_t +.Fn OF_peer "phandle_t node" +.Sh DESCRIPTION +.Pp +.Fn OF_child +returns the phandle value of the first child of the +.Fa node . +Zero is returned if there are no child nodes. +.Pp +.Fn OF_parent +returns the phandle for the parent of the +.Fa node . +Zero is returned if +.Fa node +is the root node. +.Pp +.Fn OF_peer +returns the phandle value of the next sibling of the +.Fa node . +Zero is returned if there is no sibling node. +.Sh EXAMPLES +.Bd -literal +phandle_t node, child; + ... +for (child = OF_child(node); child != 0; child = OF_peer(child) { + ... +} +.Ed +.Sh SEE ALSO +.Xr OF_finddevice 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Copied: user/markj/netdump/share/man/man9/OF_device_from_xref.9 (from r332407, head/share/man/man9/OF_device_from_xref.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/share/man/man9/OF_device_from_xref.9 Wed Apr 11 15:04:31 2018 (r332408, copy of r332407, head/share/man/man9/OF_device_from_xref.9) @@ -0,0 +1,91 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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 April 9, 2018 +.Dt OF_DEVICE_FROM_XREF 9 +.Os +.Sh NAME +.Nm OF_device_from_xref , +.Nm OF_xref_from_device, +.Nm OF_device_register_xref +.Nd "manage mappings between xrefs and devices" +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft int +.Fn OF_device_register_xref "phandle_t xref" "device_t dev" +.Ft device_t +.Fn OF_device_from_xref "phandle_t xref" +.Ft phandle_t +.Fn OF_xref_from_device "device_t dev" +.Sh DESCRIPTION +.Pp +When a device tree node references another node, the driver may +need to get a device_t instance associated with the referenced node. +For instance, an Ethernet driver accessing a PHY device. +To make this possible, the kernel maintains a table that +maps effective handles to device_t instances. +.Pp +.Fn OF_device_register_xref +adds a map entry from the effective phandle +.Fa xref +to device +.Fa dev . +If a mapping entry for +.Fa xref +already exists, it is replaced with the new one. +The function always returns 0. +.Pp +.Fn OF_device_from_xref +returns a device_t instance associated with the effective phandle +.Fa xref . *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Wed Apr 11 20:02:25 2018 Return-Path: Delivered-To: svn-src-user@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 353ABF8D3D4 for ; Wed, 11 Apr 2018 20:02:25 +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 D54EA726AD; Wed, 11 Apr 2018 20:02: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 D03E120CFC; Wed, 11 Apr 2018 20:02: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 w3BK2OXK098902; Wed, 11 Apr 2018 20:02:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BK2ObC098899; Wed, 11 Apr 2018 20:02:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804112002.w3BK2ObC098899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 20:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332417 - in user/markj/netdump/sys: kern netinet/netdump sys X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump/sys: kern netinet/netdump sys X-SVN-Commit-Revision: 332417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 20:02:25 -0000 Author: markj Date: Wed Apr 11 20:02:24 2018 New Revision: 332417 URL: https://svnweb.freebsd.org/changeset/base/332417 Log: Remove the unneeded EXT_NETDUMP. Modified: user/markj/netdump/sys/kern/kern_mbuf.c user/markj/netdump/sys/netinet/netdump/netdump_client.c user/markj/netdump/sys/sys/mbuf.h Modified: user/markj/netdump/sys/kern/kern_mbuf.c ============================================================================== --- user/markj/netdump/sys/kern/kern_mbuf.c Wed Apr 11 19:46:24 2018 (r332416) +++ user/markj/netdump/sys/kern/kern_mbuf.c Wed Apr 11 20:02:24 2018 (r332417) @@ -867,7 +867,6 @@ mb_free_ext(struct mbuf *m) case EXT_NET_DRV: case EXT_MOD_TYPE: case EXT_DISPOSABLE: - case EXT_NETDUMP: KASSERT(mref->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); mref->m_ext.ext_free(mref); Modified: user/markj/netdump/sys/netinet/netdump/netdump_client.c ============================================================================== --- user/markj/netdump/sys/netinet/netdump/netdump_client.c Wed Apr 11 19:46:24 2018 (r332416) +++ user/markj/netdump/sys/netinet/netdump/netdump_client.c Wed Apr 11 20:02:24 2018 (r332417) @@ -368,7 +368,7 @@ restart: } /* - * Dummy free function for EXT_NETDUMP clusters. + * Dummy free function for netdump clusters. */ static void netdump_mbuf_free(struct mbuf *m __unused) @@ -454,7 +454,7 @@ retransmit: return (ENOBUFS); } MEXTADD(m2, data + sent_so_far, pktlen, - netdump_mbuf_free, NULL, NULL, 0, EXT_NETDUMP); + netdump_mbuf_free, NULL, NULL, 0, EXT_DISPOSABLE); m2->m_len = pktlen; m_cat(m, m2); Modified: user/markj/netdump/sys/sys/mbuf.h ============================================================================== --- user/markj/netdump/sys/sys/mbuf.h Wed Apr 11 19:46:24 2018 (r332416) +++ user/markj/netdump/sys/sys/mbuf.h Wed Apr 11 20:02:24 2018 (r332417) @@ -438,7 +438,6 @@ struct mbuf { #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ -#define EXT_NETDUMP 8 /* network kernel dump */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ From owner-svn-src-user@freebsd.org Wed Apr 11 20:04:09 2018 Return-Path: Delivered-To: svn-src-user@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 6E945F8D57E for ; Wed, 11 Apr 2018 20:04:09 +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 1E12C728AA; Wed, 11 Apr 2018 20:04:09 +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 18C2F20D09; Wed, 11 Apr 2018 20:04:09 +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 w3BK49RE099050; Wed, 11 Apr 2018 20:04:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BK46PL099026; Wed, 11 Apr 2018 20:04:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804112004.w3BK46PL099026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 20:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332418 - in user/markj/netdump: . lib/libifconfig lib/libufs sbin/etherswitchcfg sbin/ifconfig share/man/man4 stand/efi/include stand/efi/libefi stand/efi/loader stand/forth stand/i386... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . lib/libifconfig lib/libufs sbin/etherswitchcfg sbin/ifconfig share/man/man4 stand/efi/include stand/efi/libefi stand/efi/loader stand/forth stand/i386/loader sys/conf sys/dev/... X-SVN-Commit-Revision: 332418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 20:04:09 -0000 Author: markj Date: Wed Apr 11 20:04:06 2018 New Revision: 332418 URL: https://svnweb.freebsd.org/changeset/base/332418 Log: MFH at r332417. Deleted: user/markj/netdump/share/man/man4/fpa.4 user/markj/netdump/sys/dev/pdq/if_fpa.c user/markj/netdump/sys/dev/pdq/pdq.c user/markj/netdump/sys/dev/pdq/pdq_freebsd.h user/markj/netdump/sys/dev/pdq/pdq_ifsubr.c user/markj/netdump/sys/dev/pdq/pdqreg.h user/markj/netdump/sys/dev/pdq/pdqvar.h user/markj/netdump/sys/net/fddi.h user/markj/netdump/sys/net/if_fddisubr.c Modified: user/markj/netdump/ObsoleteFiles.inc user/markj/netdump/UPDATING user/markj/netdump/lib/libifconfig/libifconfig_media.c user/markj/netdump/lib/libufs/inode.c user/markj/netdump/sbin/etherswitchcfg/ifmedia.c user/markj/netdump/sbin/ifconfig/ifmedia.c user/markj/netdump/share/man/man4/Makefile user/markj/netdump/stand/efi/include/efilib.h user/markj/netdump/stand/efi/include/efizfs.h user/markj/netdump/stand/efi/libefi/efipart.c user/markj/netdump/stand/efi/libefi/efizfs.c user/markj/netdump/stand/efi/loader/main.c user/markj/netdump/stand/forth/efi.4th user/markj/netdump/stand/forth/loader.4th user/markj/netdump/stand/forth/loader.rc user/markj/netdump/stand/i386/loader/loader.rc user/markj/netdump/sys/conf/NOTES user/markj/netdump/sys/conf/files user/markj/netdump/sys/dev/bnxt/bnxt_txrx.c user/markj/netdump/sys/dev/e1000/em_txrx.c user/markj/netdump/sys/dev/e1000/igb_txrx.c user/markj/netdump/sys/dev/ixgbe/ix_txrx.c user/markj/netdump/sys/net/if.c user/markj/netdump/sys/net/if_bridge.c user/markj/netdump/sys/net/if_media.c user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/netinet/if_ether.c user/markj/netdump/sys/netinet/ip_carp.c user/markj/netdump/sys/netinet6/in6.c user/markj/netdump/sys/netinet6/in6_ifattach.c user/markj/netdump/sys/netinet6/nd6.c user/markj/netdump/sys/netinet6/nd6_nbr.c user/markj/netdump/sys/nfs/bootp_subr.c user/markj/netdump/usr.bin/clang/clang/clang.1 Directory Properties: user/markj/netdump/ (props changed) Modified: user/markj/netdump/ObsoleteFiles.inc ============================================================================== --- user/markj/netdump/ObsoleteFiles.inc Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/ObsoleteFiles.inc Wed Apr 11 20:04:06 2018 (r332418) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180409: remove FDDI support +OLD_FILES+=usr/include/net/fddi.h # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays OLD_DIRS+=boot/overlays # 20180311: remove sys/sys/i386/include/pcaudioio.h Modified: user/markj/netdump/UPDATING ============================================================================== --- user/markj/netdump/UPDATING Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/UPDATING Wed Apr 11 20:04:06 2018 (r332418) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180411: + Support for FDDI networks has been removed. If you have device + fddi or device fpa in your kernel config file they must be + removed. + 20180406: In addition to supporting RFC 3164 formatted messages, the syslogd(8) service is now capable of parsing RFC 5424 formatted Modified: user/markj/netdump/lib/libifconfig/libifconfig_media.c ============================================================================== --- user/markj/netdump/lib/libifconfig/libifconfig_media.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/lib/libifconfig/libifconfig_media.c Wed Apr 11 20:04:06 2018 (r332418) @@ -86,15 +86,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -182,24 +173,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: user/markj/netdump/lib/libufs/inode.c ============================================================================== --- user/markj/netdump/lib/libufs/inode.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/lib/libufs/inode.c Wed Apr 11 20:04:06 2018 (r332418) @@ -60,7 +60,7 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i ERROR(disk, NULL); fs = &disk->d_fs; - if (inode >= fs->fs_ipg * fs->fs_ncg) { + if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) { ERROR(disk, "inode number out of range"); return (-1); } Modified: user/markj/netdump/sbin/etherswitchcfg/ifmedia.c ============================================================================== --- user/markj/netdump/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 20:04:06 2018 (r332418) @@ -380,15 +380,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -472,24 +463,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: user/markj/netdump/sbin/ifconfig/ifmedia.c ============================================================================== --- user/markj/netdump/sbin/ifconfig/ifmedia.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sbin/ifconfig/ifmedia.c Wed Apr 11 20:04:06 2018 (r332418) @@ -397,15 +397,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -489,24 +480,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: user/markj/netdump/share/man/man4/Makefile ============================================================================== --- user/markj/netdump/share/man/man4/Makefile Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/share/man/man4/Makefile Wed Apr 11 20:04:06 2018 (r332418) @@ -170,7 +170,6 @@ MAN= aac.4 \ ffclock.4 \ filemon.4 \ firewire.4 \ - fpa.4 \ full.4 \ fwe.4 \ fwip.4 \ Modified: user/markj/netdump/stand/efi/include/efilib.h ============================================================================== --- user/markj/netdump/stand/efi/include/efilib.h Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/efi/include/efilib.h Wed Apr 11 20:04:06 2018 (r332418) @@ -59,10 +59,13 @@ typedef struct pdinfo uint32_t pd_unit; /* unit number */ uint32_t pd_open; /* reference counter */ void *pd_bcache; /* buffer cache data */ + struct pdinfo *pd_parent; /* Linked items (eg partitions) */ + struct devsw *pd_devsw; /* Back pointer to devsw */ } pdinfo_t; pdinfo_list_t *efiblk_get_pdinfo_list(struct devsw *dev); pdinfo_t *efiblk_get_pdinfo(struct devdesc *dev); +pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h); void *efi_get_table(EFI_GUID *tbl); Modified: user/markj/netdump/stand/efi/include/efizfs.h ============================================================================== --- user/markj/netdump/stand/efi/include/efizfs.h Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/efi/include/efizfs.h Wed Apr 11 20:04:06 2018 (r332418) @@ -48,6 +48,7 @@ extern void efi_zfs_probe(void); extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); extern bool efi_zfs_is_preferred(EFI_HANDLE *h); extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); +extern bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); #endif Modified: user/markj/netdump/stand/efi/libefi/efipart.c ============================================================================== --- user/markj/netdump/stand/efi/libefi/efipart.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/efi/libefi/efipart.c Wed Apr 11 20:04:06 2018 (r332418) @@ -119,6 +119,7 @@ efiblk_get_pdinfo_list(struct devsw *dev) return (NULL); } +/* XXX this gets called way way too often, investigate */ pdinfo_t * efiblk_get_pdinfo(struct devdesc *dev) { @@ -136,6 +137,40 @@ efiblk_get_pdinfo(struct devdesc *dev) return (pd); } +static bool +same_handle(pdinfo_t *pd, EFI_HANDLE h) +{ + + return (pd->pd_handle == h || pd->pd_alias == h); +} + +pdinfo_t * +efiblk_get_pdinfo_by_handle(EFI_HANDLE h) +{ + pdinfo_t *dp, *pp; + + /* + * Check hard disks, then cd, then floppy + */ + STAILQ_FOREACH(dp, &hdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + if (same_handle(pp, h)) + return (pp); + } + } + STAILQ_FOREACH(dp, &cdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + } + STAILQ_FOREACH(dp, &fdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + } + return (NULL); +} + static int efiblk_pdinfo_count(pdinfo_list_t *pdi) { @@ -294,6 +329,8 @@ efipart_fdinfo_add(EFI_HANDLE handle, uint32_t uid, EF fd->pd_unit = uid; fd->pd_handle = handle; fd->pd_devpath = devpath; + fd->pd_parent = NULL; + fd->pd_devsw = &efipart_fddev; STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link); return (0); } @@ -364,6 +401,8 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias cd->pd_unit = unit; cd->pd_alias = alias; cd->pd_devpath = devpath; + cd->pd_parent = NULL; + cd->pd_devsw = &efipart_cddev; STAILQ_INSERT_TAIL(&cdinfo, cd, pd_link); return (0); } @@ -489,6 +528,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; pd->pd_devpath = part_devpath; + pd->pd_parent = hd; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link); return (0); } @@ -505,6 +546,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE hd->pd_handle = disk_handle; hd->pd_unit = unit; hd->pd_devpath = disk_devpath; + hd->pd_parent = NULL; + hd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); if (part_devpath == NULL) @@ -521,6 +564,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; pd->pd_devpath = part_devpath; + pd->pd_parent = hd; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link); return (0); @@ -579,6 +624,8 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) pd->pd_handle = disk_handle; pd->pd_unit = unit; pd->pd_devpath = devpath; + pd->pd_parent = NULL; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hdinfo, pd, pd_link); free(pathname); return (0); @@ -609,6 +656,8 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) pd->pd_handle = disk_handle; pd->pd_unit = unit; pd->pd_devpath = devpath; + pd->pd_parent = last; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&last->pd_part, pd, pd_link); free(pathname); return (0); Modified: user/markj/netdump/stand/efi/libefi/efizfs.c ============================================================================== --- user/markj/netdump/stand/efi/libefi/efizfs.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/efi/libefi/efizfs.c Wed Apr 11 20:04:06 2018 (r332418) @@ -64,6 +64,22 @@ efizfs_get_handle_by_guid(uint64_t guid) return (NULL); } +bool +efizfs_get_guid_by_handle(EFI_HANDLE handle, uint64_t *guid) +{ + zfsinfo_t *zi; + + if (guid == NULL) + return (false); + STAILQ_FOREACH(zi, &zfsinfo, zi_link) { + if (zi->zi_handle == handle) { + *guid = zi->zi_pool_guid; + return (true); + } + } + return (false); +} + static void insert_zfs(EFI_HANDLE handle, uint64_t guid) { Modified: user/markj/netdump/stand/efi/loader/main.c ============================================================================== --- user/markj/netdump/stand/efi/loader/main.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/efi/loader/main.c Wed Apr 11 20:04:06 2018 (r332418) @@ -78,6 +78,15 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; static EFI_LOADED_IMAGE *img; +/* + * Number of seconds to wait for a keystroke before exiting with failure + * in the event no currdev is found. -2 means always break, -1 means + * never break, 0 means poll once and then reboot, > 0 means wait for + * that many seconds. "fail_timeout" can be set in the environment as + * well. + */ +static int fail_timeout = 5; + #ifdef EFI_ZFS_BOOT bool efi_zfs_is_preferred(EFI_HANDLE *h) @@ -169,113 +178,183 @@ out: } static void -set_devdesc_currdev(struct devsw *dev, int unit) +set_currdev_devdesc(struct devdesc *currdev) { + const char *devname; + + devname = efi_fmtdev(currdev); + + printf("Setting currdev to %s\n", devname); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); +} + +static void +set_currdev_devsw(struct devsw *dev, int unit) +{ struct devdesc currdev; - char *devname; currdev.d_dev = dev; currdev.d_unit = unit; + + set_currdev_devdesc(&currdev); +} + +static void +set_currdev_pdinfo(pdinfo_t *dp) +{ + + /* + * Disks are special: they have partitions. if the parent + * pointer is non-null, we're a partition not a full disk + * and we need to adjust currdev appropriately. + */ + if (dp->pd_devsw->dv_type == DEVT_DISK) { + struct disk_devdesc currdev; + + currdev.dd.d_dev = dp->pd_devsw; + if (dp->pd_parent == NULL) { + currdev.dd.d_unit = dp->pd_unit; + currdev.d_slice = -1; + currdev.d_partition = -1; + } else { + currdev.dd.d_unit = dp->pd_parent->pd_unit; + currdev.d_slice = dp->pd_unit; + currdev.d_partition = 255; /* Assumes GPT */ + } + set_currdev_devdesc((struct devdesc *)&currdev); + } else { + set_currdev_devsw(dp->pd_devsw, dp->pd_unit); + } +} + +static bool +sanity_check_currdev(void) +{ + struct stat st; + + return (stat("/boot/defaults/loader.conf", &st) == 0); +} + +#ifdef EFI_ZFS_BOOT +static bool +probe_zfs_currdev(uint64_t guid) +{ + char *devname; + struct zfs_devdesc currdev; + + currdev.dd.d_dev = &zfs_dev; + currdev.dd.d_unit = 0; + currdev.pool_guid = guid; + currdev.root_guid = 0; + set_currdev_devdesc((struct devdesc *)&currdev); devname = efi_fmtdev(&currdev); + init_zfs_bootenv(devname); - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); + return (sanity_check_currdev()); } +#endif +static bool +try_as_currdev(pdinfo_t *hd, pdinfo_t *pp) +{ + uint64_t guid; + +#ifdef EFI_ZFS_BOOT + /* + * If there's a zpool on this device, try it as a ZFS + * filesystem, which has somewhat different setup than all + * other types of fs due to imperfect loader integration. + * This all stems from ZFS being both a device (zpool) and + * a filesystem, plus the boot env feature. + */ + if (efizfs_get_guid_by_handle(pp->pd_handle, &guid)) + return (probe_zfs_currdev(guid)); +#endif + /* + * All other filesystems just need the pdinfo + * initialized in the standard way. + */ + set_currdev_pdinfo(pp); + return (sanity_check_currdev()); +} + static int find_currdev(EFI_LOADED_IMAGE *img) { - pdinfo_list_t *pdi_list; pdinfo_t *dp, *pp; EFI_DEVICE_PATH *devpath, *copy; EFI_HANDLE h; - char *devname; + CHAR16 *text; struct devsw *dev; int unit; uint64_t extra; #ifdef EFI_ZFS_BOOT - /* Did efi_zfs_probe() detect the boot pool? */ + /* + * Did efi_zfs_probe() detect the boot pool? If so, use the zpool + * it found, if it's sane. ZFS is the only thing that looks for + * disks and pools to boot. This may change in the future, however, + * if we allow specifying which pool to boot from via UEFI variables + * rather than the bootenv stuff that FreeBSD uses today. + */ if (pool_guid != 0) { - struct zfs_devdesc currdev; - - currdev.dd.d_dev = &zfs_dev; - currdev.dd.d_unit = 0; - currdev.pool_guid = pool_guid; - currdev.root_guid = 0; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, env_noset, - env_nounset); - init_zfs_bootenv(devname); - return (0); + printf("Trying ZFS pool\n"); + if (probe_zfs_currdev(pool_guid)) + return (0); } #endif /* EFI_ZFS_BOOT */ - /* We have device lists for hd, cd, fd, walk them all. */ - pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - struct disk_devdesc currdev; - - currdev.dd.d_dev = &efipart_hddev; - currdev.dd.d_unit = dp->pd_unit; - currdev.d_slice = -1; - currdev.d_partition = -1; - - if (dp->pd_handle == img->DeviceHandle) { - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - return (0); + /* + * Try to find the block device by its handle based on the + * image we're booting. If we can't find a sane partition, + * search all the other partitions of the disk. We do not + * search other disks because it's a violation of the UEFI + * boot protocol to do so. We fail and let UEFI go on to + * the next candidate. + */ + dp = efiblk_get_pdinfo_by_handle(img->DeviceHandle); + if (dp != NULL) { + text = efi_devpath_name(dp->pd_devpath); + if (text != NULL) { + printf("Trying ESP: %S\n", text); + efi_free_devpath_name(text); } - /* Assuming GPT partitioning. */ - STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { - if (pp->pd_handle == img->DeviceHandle) { - currdev.d_slice = pp->pd_unit; - currdev.d_partition = 255; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - return (0); + set_currdev_pdinfo(dp); + if (sanity_check_currdev()) + return (0); + if (dp->pd_parent != NULL) { + dp = dp->pd_parent; + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + text = efi_devpath_name(pp->pd_devpath); + if (text != NULL) { + printf("And now the part: %S\n", text); + efi_free_devpath_name(text); + } + /* + * Roll up the ZFS special case + * for those partitions that have + * zpools on them + */ + if (try_as_currdev(dp, pp)) + return (0); } } + } else { + printf("Can't find device by handle\n"); } - pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (dp->pd_handle == img->DeviceHandle || - dp->pd_alias == img->DeviceHandle) { - set_devdesc_currdev(&efipart_cddev, dp->pd_unit); - return (0); - } - } - - pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (dp->pd_handle == img->DeviceHandle) { - set_devdesc_currdev(&efipart_fddev, dp->pd_unit); - return (0); - } - } - /* * Try the device handle from our loaded image first. If that * fails, use the device path from the loaded image and see if * any of the nodes in that path match one of the enumerated - * handles. + * handles. Currently, this handle list is only for netboot. */ if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &extra) == 0) { - set_devdesc_currdev(dev, unit); - return (0); + set_currdev_devsw(dev, unit); + if (sanity_check_currdev()) + return (0); } copy = NULL; @@ -289,8 +368,9 @@ find_currdev(EFI_LOADED_IMAGE *img) copy = NULL; if (efi_handle_lookup(h, &dev, &unit, &extra) == 0) { - set_devdesc_currdev(dev, unit); - return (0); + set_currdev_devsw(dev, unit); + if (sanity_check_currdev()) + return (0); } devpath = efi_lookup_devpath(h); @@ -304,6 +384,33 @@ find_currdev(EFI_LOADED_IMAGE *img) return (ENOENT); } +static bool +interactive_interrupt(const char *msg) +{ + time_t now, then, last; + + last = 0; + now = then = getsecs(); + printf("%s\n", msg); + if (fail_timeout == -2) /* Always break to OK */ + return (true); + if (fail_timeout == -1) /* Never break to OK */ + return (false); + do { + if (last != now) { + printf("press any key to interrupt reboot in %d seconds\r", + fail_timeout - (int)(now - then)); + last = now; + } + + /* XXX no pause or timeout wait for char */ + if (ischar()) + return (true); + now = getsecs(); + } while (now - then < fail_timeout); + return (false); +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -312,12 +419,13 @@ main(int argc, CHAR16 *argv[]) int i, j, vargood, howto; UINTN k; int has_kbd; + char *s; + EFI_DEVICE_PATH *imgpath; CHAR16 *text; + EFI_STATUS status; UINT16 boot_current; size_t sz; UINT16 boot_order[100]; - EFI_DEVICE_PATH *imgpath; - EFI_STATUS status; #if !defined(__arm__) char buf[40]; #endif @@ -356,12 +464,15 @@ main(int argc, CHAR16 *argv[]) /* * Parse the args to set the console settings, etc * boot1.efi passes these in, if it can read /boot.config or /boot/config - * or iPXE may be setup to pass these in. + * or iPXE may be setup to pass these in. Or the optional argument in the + * boot environment was used to pass these arguments in (in which case + * neither /boot.config nor /boot/config are consulted). * * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert - * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. + * args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this + * method is flawed for non-ASCII characters). */ howto = 0; for (i = 1; i < argc; i++) { @@ -441,6 +552,10 @@ main(int argc, CHAR16 *argv[]) for (i = 0; howto_names[i].ev != NULL; i++) if (howto & howto_names[i].mask) setenv(howto_names[i].ev, "YES", 1); + + /* + * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables + */ if (howto & RB_MULTIPLE) { if (howto & RB_SERIAL) setenv("console", "comconsole efi" , 1); @@ -448,13 +563,17 @@ main(int argc, CHAR16 *argv[]) setenv("console", "efi comconsole" , 1); } else if (howto & RB_SERIAL) { setenv("console", "comconsole" , 1); - } + } else + setenv("console", "efi", 1); if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); } + if ((s = getenv("fail_timeout")) != NULL) + fail_timeout = strtol(s, NULL, 10); + /* * Scan the BLOCK IO MEDIA handles then * march through the device switch probing for things. @@ -479,6 +598,7 @@ main(int argc, CHAR16 *argv[]) printf("\n%s", bootprog_info); + /* Determine the devpath of our image so we can prefer it. */ text = efi_devpath_name(img->FilePath); if (text != NULL) { printf(" Load Path: %S\n", text); @@ -520,8 +640,16 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); + /* + * Try and find a good currdev based on the image that was booted. + * It might be desirable here to have a short pause to allow falling + * through to the boot loader instead of returning instantly to follow + * the boot protocol and also allow an escape hatch for users wishing + * to try something different. + */ if (find_currdev(img) != 0) - return (EFI_NOT_FOUND); + if (!interactive_interrupt("Failed to find bootable partition")) + return (EFI_NOT_FOUND); efi_init_environment(); setenv("LINES", "24", 1); /* optional */ Modified: user/markj/netdump/stand/forth/efi.4th ============================================================================== --- user/markj/netdump/stand/forth/efi.4th Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/forth/efi.4th Wed Apr 11 20:04:06 2018 (r332418) @@ -26,5 +26,16 @@ only forth definitions -s" efi-autoresizecons" evaluate +: efiboot? ( -- flag ) + s" efi-version" getenv -1 <> dup if + swap drop ( c-addr flag -- flag ) + then +; + +: maybe-efi-resizecons + efiboot? if + s" efi-autoresizecons" evaluate + then +; + .( EFI boot environment) cr Modified: user/markj/netdump/stand/forth/loader.4th ============================================================================== --- user/markj/netdump/stand/forth/loader.4th Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/forth/loader.4th Wed Apr 11 20:04:06 2018 (r332418) @@ -46,9 +46,6 @@ include /boot/support.4th include /boot/color.4th include /boot/delay.4th include /boot/check-password.4th -s" efi-version" getenv? [if] - include /boot/efi.4th -[then] only forth definitions Modified: user/markj/netdump/stand/forth/loader.rc ============================================================================== --- user/markj/netdump/stand/forth/loader.rc Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/forth/loader.rc Wed Apr 11 20:04:06 2018 (r332418) @@ -6,11 +6,14 @@ \ \ Includes additional commands include /boot/loader.4th +include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables \ NOTE: Change to `initialize' if you enable the below boot menu start + +maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password Modified: user/markj/netdump/stand/i386/loader/loader.rc ============================================================================== --- user/markj/netdump/stand/i386/loader/loader.rc Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/stand/i386/loader/loader.rc Wed Apr 11 20:04:06 2018 (r332418) @@ -3,10 +3,13 @@ \ \ Includes additional commands include /boot/loader.4th +include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables initialize + +maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password Modified: user/markj/netdump/sys/conf/NOTES ============================================================================== --- user/markj/netdump/sys/conf/NOTES Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/conf/NOTES Wed Apr 11 20:04:06 2018 (r332418) @@ -845,9 +845,6 @@ device wlan_xauth device wlan_acl device wlan_amrr -# The `fddi' device provides generic code to support FDDI. -device fddi - # The `arcnet' device provides generic code to support Arcnet. device arcnet @@ -1975,7 +1972,6 @@ device xmphy # XaQti XMAC II # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, # Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet -# fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) # gem: Apple GMAC/Sun ERI/Sun GEM @@ -2152,9 +2148,6 @@ device ti # Alteon Networks Tigon I/II gigabit Ether device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') device vxge # Exar/Neterion XFrame 3100 10GbE - -# PCI FDDI NICs. -device fpa # PCI WAN adapters. device lmc Modified: user/markj/netdump/sys/conf/files ============================================================================== --- user/markj/netdump/sys/conf/files Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/conf/files Wed Apr 11 20:04:06 2018 (r332418) @@ -2642,9 +2642,6 @@ dev/pci/pcib_if.m standard dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci -dev/pdq/if_fpa.c optional fpa pci -dev/pdq/pdq.c optional nowerror fpa pci -dev/pdq/pdq_ifsubr.c optional nowerror fpa pci dev/pms/freebsd/driver/ini/src/agtiapi.c optional pmspcv \ compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" dev/pms/RefTisa/sallsdk/spc/sadisc.c optional pmspcv \ @@ -4130,7 +4127,6 @@ net/if_edsc.c optional edsc net/if_enc.c optional enc inet | enc inet6 net/if_epair.c optional epair net/if_ethersubr.c optional ether -net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip net/if_gif.c optional gif inet | gif inet6 | \ netgraph_gif inet | netgraph_gif inet6 Modified: user/markj/netdump/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- user/markj/netdump/sys/dev/bnxt/bnxt_txrx.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/dev/bnxt/bnxt_txrx.c Wed Apr 11 20:04:06 2018 (r332418) @@ -66,14 +66,14 @@ static int bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_ static int bnxt_intr(void *sc); struct if_txrx bnxt_txrx = { - bnxt_isc_txd_encap, - bnxt_isc_txd_flush, - bnxt_isc_txd_credits_update, - bnxt_isc_rxd_available, - bnxt_isc_rxd_pkt_get, - bnxt_isc_rxd_refill, - bnxt_isc_rxd_flush, - bnxt_intr + .ift_txd_encap = bnxt_isc_txd_encap, + .ift_txd_flush = bnxt_isc_txd_flush, + .ift_txd_credits_update = bnxt_isc_txd_credits_update, + .ift_rxd_available = bnxt_isc_rxd_available, + .ift_rxd_pkt_get = bnxt_isc_rxd_pkt_get, + .ift_rxd_refill = bnxt_isc_rxd_refill, + .ift_rxd_flush = bnxt_isc_rxd_flush, + .ift_legacy_intr = bnxt_intr }; /* Modified: user/markj/netdump/sys/dev/e1000/em_txrx.c ============================================================================== --- user/markj/netdump/sys/dev/e1000/em_txrx.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/dev/e1000/em_txrx.c Wed Apr 11 20:04:06 2018 (r332418) @@ -68,25 +68,25 @@ static int em_determine_rsstype(u32 pkt_info); extern int em_intr(void *arg); struct if_txrx em_txrx = { - em_isc_txd_encap, - em_isc_txd_flush, - em_isc_txd_credits_update, - em_isc_rxd_available, - em_isc_rxd_pkt_get, - em_isc_rxd_refill, - em_isc_rxd_flush, - em_intr + .ift_txd_encap = em_isc_txd_encap, + .ift_txd_flush = em_isc_txd_flush, + .ift_txd_credits_update = em_isc_txd_credits_update, + .ift_rxd_available = em_isc_rxd_available, + .ift_rxd_pkt_get = em_isc_rxd_pkt_get, + .ift_rxd_refill = em_isc_rxd_refill, + .ift_rxd_flush = em_isc_rxd_flush, + .ift_legacy_intr = em_intr }; struct if_txrx lem_txrx = { - em_isc_txd_encap, - em_isc_txd_flush, - em_isc_txd_credits_update, - lem_isc_rxd_available, - lem_isc_rxd_pkt_get, - lem_isc_rxd_refill, - em_isc_rxd_flush, - em_intr + .ift_txd_encap = em_isc_txd_encap, + .ift_txd_flush = em_isc_txd_flush, + .ift_txd_credits_update = em_isc_txd_credits_update, + .ift_rxd_available = lem_isc_rxd_available, + .ift_rxd_pkt_get = lem_isc_rxd_pkt_get, + .ift_rxd_refill = lem_isc_rxd_refill, + .ift_rxd_flush = em_isc_rxd_flush, + .ift_legacy_intr = em_intr }; extern if_shared_ctx_t em_sctx; Modified: user/markj/netdump/sys/dev/e1000/igb_txrx.c ============================================================================== --- user/markj/netdump/sys/dev/e1000/igb_txrx.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/dev/e1000/igb_txrx.c Wed Apr 11 20:04:06 2018 (r332418) @@ -62,14 +62,14 @@ extern void igb_if_enable_intr(if_ctx_t ctx); extern int em_intr(void *arg); struct if_txrx igb_txrx = { - igb_isc_txd_encap, - igb_isc_txd_flush, - igb_isc_txd_credits_update, - igb_isc_rxd_available, - igb_isc_rxd_pkt_get, - igb_isc_rxd_refill, - igb_isc_rxd_flush, - em_intr + .ift_txd_encap = igb_isc_txd_encap, + .ift_txd_flush = igb_isc_txd_flush, + .ift_txd_credits_update = igb_isc_txd_credits_update, + .ift_rxd_available = igb_isc_rxd_available, + .ift_rxd_pkt_get = igb_isc_rxd_pkt_get, + .ift_rxd_refill = igb_isc_rxd_refill, + .ift_rxd_flush = igb_isc_rxd_flush, + .ift_legacy_intr = em_intr }; extern if_shared_ctx_t em_sctx; Modified: user/markj/netdump/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- user/markj/netdump/sys/dev/ixgbe/ix_txrx.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/dev/ixgbe/ix_txrx.c Wed Apr 11 20:04:06 2018 (r332418) @@ -62,14 +62,14 @@ extern void ixgbe_if_enable_intr(if_ctx_t ctx); static int ixgbe_determine_rsstype(u16 pkt_info); struct if_txrx ixgbe_txrx = { - ixgbe_isc_txd_encap, - ixgbe_isc_txd_flush, - ixgbe_isc_txd_credits_update, - ixgbe_isc_rxd_available, - ixgbe_isc_rxd_pkt_get, - ixgbe_isc_rxd_refill, - ixgbe_isc_rxd_flush, - NULL + .ift_txd_encap = ixgbe_isc_txd_encap, + .ift_txd_flush = ixgbe_isc_txd_flush, + .ift_txd_credits_update = ixgbe_isc_txd_credits_update, + .ift_rxd_available = ixgbe_isc_rxd_available, + .ift_rxd_pkt_get = ixgbe_isc_rxd_pkt_get, + .ift_rxd_refill = ixgbe_isc_rxd_refill, + .ift_rxd_flush = ixgbe_isc_rxd_flush, + .ift_legacy_intr = NULL }; extern if_shared_ctx_t ixgbe_sctx; Modified: user/markj/netdump/sys/net/if.c ============================================================================== --- user/markj/netdump/sys/net/if.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/net/if.c Wed Apr 11 20:04:06 2018 (r332418) @@ -3696,7 +3696,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, } switch (ifp->if_type) { case IFT_ETHER: - case IFT_FDDI: case IFT_XETHER: case IFT_L2VLAN: case IFT_BRIDGE: Modified: user/markj/netdump/sys/net/if_bridge.c ============================================================================== --- user/markj/netdump/sys/net/if_bridge.c Wed Apr 11 20:02:24 2018 (r332417) +++ user/markj/netdump/sys/net/if_bridge.c Wed Apr 11 20:04:06 2018 (r332418) @@ -72,8 +72,8 @@ * * - Currently only supports Ethernet-like interfaces (Ethernet, * 802.11, VLANs on Ethernet, etc.) Figure out a nice way *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Fri Apr 13 16:50:19 2018 Return-Path: Delivered-To: svn-src-user@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 639F9F964BF for ; Fri, 13 Apr 2018 16:50:19 +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 14B476E416; Fri, 13 Apr 2018 16:50:19 +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 0AAA61C4CA; Fri, 13 Apr 2018 16:50:19 +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 w3DGoI0x039766; Fri, 13 Apr 2018 16:50:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DGoGPU039740; Fri, 13 Apr 2018 16:50:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804131650.w3DGoGPU039740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Apr 2018 16:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332477 - in user/markj/netdump: . cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common lib/libc/amd64 lib/libc/amd64/sys lib/libc/gen lib/libc/i386 lib/libc/i3... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common lib/libc/amd64 lib/libc/amd64/sys lib/libc/gen lib/libc/i386 lib/libc/i386/sys lib/libc/mips/sys ... X-SVN-Commit-Revision: 332477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 16:50:19 -0000 Author: markj Date: Fri Apr 13 16:50:16 2018 New Revision: 332477 URL: https://svnweb.freebsd.org/changeset/base/332477 Log: MFH at r332476. Added: user/markj/netdump/lib/libc/gen/exect.c - copied unchanged from r332476, head/lib/libc/gen/exect.c user/markj/netdump/sys/dev/altera/msgdma/ - copied from r332476, head/sys/dev/altera/msgdma/ user/markj/netdump/sys/dev/altera/softdma/ - copied from r332476, head/sys/dev/altera/softdma/ user/markj/netdump/sys/dev/netmap/netmap_legacy.c - copied unchanged from r332476, head/sys/dev/netmap/netmap_legacy.c user/markj/netdump/sys/dev/xdma/controller/ - copied from r332476, head/sys/dev/xdma/controller/ user/markj/netdump/sys/dev/xdma/xdma_bank.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_bank.c user/markj/netdump/sys/dev/xdma/xdma_bio.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_bio.c user/markj/netdump/sys/dev/xdma/xdma_mbuf.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_mbuf.c user/markj/netdump/sys/dev/xdma/xdma_queue.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_queue.c user/markj/netdump/sys/dev/xdma/xdma_sg.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_sg.c user/markj/netdump/sys/dev/xdma/xdma_sglist.c - copied unchanged from r332476, head/sys/dev/xdma/xdma_sglist.c user/markj/netdump/sys/mips/beri/beri_mp.c - copied unchanged from r332476, head/sys/mips/beri/beri_mp.c user/markj/netdump/sys/mips/beri/beri_mp.h - copied unchanged from r332476, head/sys/mips/beri/beri_mp.h user/markj/netdump/sys/net/netmap_legacy.h - copied unchanged from r332476, head/sys/net/netmap_legacy.h Deleted: user/markj/netdump/lib/libc/amd64/sys/exect.S user/markj/netdump/lib/libc/i386/sys/exect.S user/markj/netdump/lib/libc/mips/sys/exect.S user/markj/netdump/lib/libc/powerpc/sys/exect.S user/markj/netdump/lib/libc/powerpc64/sys/exect.S user/markj/netdump/lib/libc/sparc64/sys/exect.S user/markj/netdump/sys/dev/altera/atse/a_api.h Modified: user/markj/netdump/Makefile.inc1 user/markj/netdump/ObsoleteFiles.inc user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c user/markj/netdump/lib/libc/amd64/Symbol.map user/markj/netdump/lib/libc/amd64/sys/Makefile.inc user/markj/netdump/lib/libc/gen/Makefile.inc user/markj/netdump/lib/libc/gen/Symbol.map user/markj/netdump/lib/libc/gen/syslog.3 user/markj/netdump/lib/libc/i386/Symbol.map user/markj/netdump/lib/libc/i386/sys/Makefile.inc user/markj/netdump/lib/libc/mips/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc/Symbol.map user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc user/markj/netdump/lib/libc/powerpc64/Symbol.map user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc user/markj/netdump/lib/libc/sparc64/Symbol.map user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc user/markj/netdump/release/i386/make-memstick.sh user/markj/netdump/sbin/ipfw/ipfw2.c user/markj/netdump/sbin/ipfw/ipfw2.h user/markj/netdump/sbin/ipfw/ipv6.c user/markj/netdump/share/misc/bsd-family-tree user/markj/netdump/share/misc/committers-src.dot user/markj/netdump/share/mk/bsd.dtb.mk user/markj/netdump/share/mk/bsd.kmod.mk user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/amd64/pmap.c user/markj/netdump/sys/amd64/ia32/ia32_signal.c user/markj/netdump/sys/amd64/linux/linux_sysvec.c user/markj/netdump/sys/amd64/linux32/linux32_sysvec.c user/markj/netdump/sys/cam/scsi/scsi_da.c user/markj/netdump/sys/cam/scsi/scsi_sa.c user/markj/netdump/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/markj/netdump/sys/conf/files user/markj/netdump/sys/conf/kern.mk user/markj/netdump/sys/conf/kmod.mk user/markj/netdump/sys/conf/options.mips user/markj/netdump/sys/dev/altera/atse/if_atse.c user/markj/netdump/sys/dev/altera/atse/if_atse_fdt.c user/markj/netdump/sys/dev/altera/atse/if_atse_nexus.c user/markj/netdump/sys/dev/altera/atse/if_atsereg.h user/markj/netdump/sys/dev/cxgbe/t4_netmap.c user/markj/netdump/sys/dev/ixgbe/if_ixv.c user/markj/netdump/sys/dev/ixl/ixl_pf_main.c user/markj/netdump/sys/dev/ixl/ixl_txrx.c user/markj/netdump/sys/dev/netmap/if_ptnet.c user/markj/netdump/sys/dev/netmap/if_re_netmap.h user/markj/netdump/sys/dev/netmap/if_vtnet_netmap.h user/markj/netdump/sys/dev/netmap/netmap.c user/markj/netdump/sys/dev/netmap/netmap_freebsd.c user/markj/netdump/sys/dev/netmap/netmap_generic.c user/markj/netdump/sys/dev/netmap/netmap_kern.h user/markj/netdump/sys/dev/netmap/netmap_mem2.c user/markj/netdump/sys/dev/netmap/netmap_mem2.h user/markj/netdump/sys/dev/netmap/netmap_monitor.c user/markj/netdump/sys/dev/netmap/netmap_pipe.c user/markj/netdump/sys/dev/netmap/netmap_pt.c user/markj/netdump/sys/dev/netmap/netmap_vale.c user/markj/netdump/sys/dev/ocs_fc/ocs_os.c user/markj/netdump/sys/dev/re/if_re.c user/markj/netdump/sys/dev/vt/font/vt_font_default.c user/markj/netdump/sys/dev/vt/hw/vga/vt_vga.c user/markj/netdump/sys/dev/xdma/xdma.c user/markj/netdump/sys/dev/xdma/xdma.h user/markj/netdump/sys/dev/xdma/xdma_fdt_test.c user/markj/netdump/sys/dev/xdma/xdma_if.m user/markj/netdump/sys/dts/mips/beripad-de4.dts user/markj/netdump/sys/i386/i386/machdep.c user/markj/netdump/sys/mips/beri/files.beri user/markj/netdump/sys/mips/beri/std.beri user/markj/netdump/sys/mips/conf/BERI_DE4_BASE user/markj/netdump/sys/mips/include/cpufunc.h user/markj/netdump/sys/mips/include/hwfunc.h user/markj/netdump/sys/mips/ingenic/jz4780_aic.c user/markj/netdump/sys/mips/ingenic/jz4780_pdma.c user/markj/netdump/sys/mips/ingenic/jz4780_pdma.h user/markj/netdump/sys/mips/mips/mp_machdep.c user/markj/netdump/sys/modules/netmap/Makefile user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/net/netmap.h user/markj/netdump/sys/net/netmap_user.h user/markj/netdump/sys/net/netmap_virt.h user/markj/netdump/sys/netinet6/ip6_fastfwd.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64_translate.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64_translate.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64lsn_control.c user/markj/netdump/sys/netpfil/ipfw/nat64/nat64stl.h user/markj/netdump/sys/netpfil/ipfw/nat64/nat64stl_control.c user/markj/netdump/sys/sys/param.h user/markj/netdump/sys/sys/proc.h user/markj/netdump/usr.bin/etdump/etdump.c user/markj/netdump/usr.bin/mandoc/Makefile user/markj/netdump/usr.bin/mkimg/mkimg.c user/markj/netdump/usr.bin/mkimg/scheme.h user/markj/netdump/usr.sbin/cron/cron/database.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/cddl/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/ (props changed) user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/Makefile.inc1 ============================================================================== --- user/markj/netdump/Makefile.inc1 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/Makefile.inc1 Fri Apr 13 16:50:16 2018 (r332477) @@ -808,7 +808,8 @@ _cleanobj_fast_depend_hack: .PHONY # 20180404 r332048 sigreturn # 20180405 r332080 shmat # 20180406 r332119 setlogin -.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs +# 20170411 r332443 exect +.for f in exect fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ Modified: user/markj/netdump/ObsoleteFiles.inc ============================================================================== --- user/markj/netdump/ObsoleteFiles.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/ObsoleteFiles.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -40,6 +40,7 @@ # 20180409: remove FDDI support OLD_FILES+=usr/include/net/fddi.h +OLD_FILES+=usr/share/man/man4/fpa.4.gz # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays OLD_DIRS+=boot/overlays # 20180311: remove sys/sys/i386/include/pcaudioio.h @@ -1069,7 +1070,6 @@ OLD_FILES+=usr/share/man/man7/mm.7.gz OLD_FILES+=usr/share/man/man7/mmse.7.gz OLD_FILES+=usr/share/man/man7/ms.7.gz OLD_FILES+=usr/share/man/man7/orig_me.7.gz -OLD_FILES+=usr/share/man/man7/roff.7.gz OLD_FILES+=usr/share/me/acm.me OLD_FILES+=usr/share/me/chars.me OLD_FILES+=usr/share/me/deltext.me Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Apr 13 16:50:16 2018 (r332477) @@ -62,6 +62,7 @@ .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Nm .Cm destroy @@ -115,6 +116,7 @@ .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -961,6 +963,7 @@ do not actually discard any transactions. .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Xc .Pp @@ -1062,6 +1065,18 @@ or .Qq Cm none . For more information on dataset mount points, see .Xr zfs 8 . +.It Fl t Ar tempname +Sets the in-core pool name to +.Pa tempname +while the on-disk name will be the name specified as the pool name +.Pa pool . +This will set the default +.Sy cachefile +property to +.Sy none . +This is intended to handle name space collisions when creating pools +for other systems, such as virtual machines or physical machines +whose pools live on network block devices. .El .It Xo .Nm @@ -1316,6 +1331,7 @@ Searches for and imports all pools found. .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -1375,6 +1391,20 @@ Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root +.It Fl t +Used with +.Ar newpool . +Specifies that +.Ar newpool +is temporary. +Temporary pool names last until export. +Ensures that the original pool name will be used in all label updates and +therefore is retained upon export. +Will also set +.Sy cachefile +property to +.Sy none +when not explicitly specified. .It Fl F Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools Modified: user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 13 16:50:16 2018 (r332477) @@ -220,8 +220,9 @@ get_usage(zpool_help_t idx) case HELP_CREATE: return (gettext("\tcreate [-fnd] [-B] " "[-o property=value] ... \n" - "\t [-O file-system-property=value] ... \n" - "\t [-m mountpoint] [-R root] ...\n")); + "\t [-O file-system-property=value] ...\n" + "\t [-m mountpoint] [-R root] [-t tempname] " + " ...\n")); case HELP_CHECKPOINT: return (gettext("\tcheckpoint [--discard] ...\n")); case HELP_DESTROY: @@ -239,7 +240,7 @@ get_usage(zpool_help_t idx) "[-R root] [-F [-n]] -a\n" "\timport [-o mntopts] [-o property=value] ... \n" "\t [-d dir | -c cachefile] [-D] [-f] [-m] [-N] " - "[-R root] [-F [-n]]\n" + "[-R root] [-F [-n]] [-t]\n" "\t [--rewind-to-checkpoint] [newpool]\n")); case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " @@ -489,6 +490,21 @@ add_prop_list(const char *propname, char *propval, nvl } /* + * Set a default property pair (name, string-value) in a property nvlist + */ +static int +add_prop_list_default(const char *propname, char *propval, nvlist_t **props, + boolean_t poolprop) +{ + char *pval; + + if (nvlist_lookup_string(*props, propname, &pval) == 0) + return (0); + + return (add_prop_list(propname, propval, props, poolprop)); +} + +/* * zpool add [-fn] ... * * -f Force addition of devices, even if they appear in use @@ -850,15 +866,16 @@ errout: /* * zpool create [-fnd] [-B] [-o property=value] ... * [-O file-system-property=value] ... - * [-R root] [-m mountpoint] ... + * [-R root] [-m mountpoint] [-t tempname] ... * * -B Create boot partition. * -f Force creation, even if devices appear in use * -n Do not create the pool, but display the resulting layout if it * were to be created. - * -R Create a pool under an alternate root - * -m Set default mountpoint for the root dataset. By default it's + * -R Create a pool under an alternate root + * -m Set default mountpoint for the root dataset. By default it's * '/' + * -t Use the temporary name until the pool is exported. * -o Set property=value. * -d Don't automatically enable all supported pool features * (individual features can be enabled with -o). @@ -882,6 +899,7 @@ zpool_do_create(int argc, char **argv) int c; nvlist_t *nvroot = NULL; char *poolname; + char *tname = NULL; int ret = 1; char *altroot = NULL; char *mountpoint = NULL; @@ -890,7 +908,7 @@ zpool_do_create(int argc, char **argv) char *propval; /* check options */ - while ((c = getopt(argc, argv, ":fndBR:m:o:O:")) != -1) { + while ((c = getopt(argc, argv, ":fndBR:m:o:O:t:")) != -1) { switch (c) { case 'f': force = B_TRUE; @@ -922,11 +940,7 @@ zpool_do_create(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto errout; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto errout; break; @@ -999,6 +1013,27 @@ zpool_do_create(int argc, char **argv) goto errout; } break; + case 't': + /* + * Sanity check temporary pool name. + */ + if (strchr(optarg, '/') != NULL) { + (void) fprintf(stderr, gettext("cannot create " + "'%s': invalid character '/' in temporary " + "name\n"), optarg); + (void) fprintf(stderr, gettext("use 'zfs " + "create' to create a dataset\n")); + goto errout; + } + + if (add_prop_list(zpool_prop_to_name( + ZPOOL_PROP_TNAME), optarg, &props, B_TRUE)) + goto errout; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto errout; + tname = optarg; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -1205,8 +1240,8 @@ zpool_do_create(int argc, char **argv) ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { - zfs_handle_t *pool = zfs_open(g_zfs, poolname, - ZFS_TYPE_FILESYSTEM); + zfs_handle_t *pool = zfs_open(g_zfs, + tname ? tname : poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); @@ -2162,7 +2197,8 @@ zpool_do_checkpoint(int argc, char **argv) * import [-o mntopts] [-o prop=value] ... [-R root] [-D] * [-d dir | -c cachefile] [-f] -a * import [-o mntopts] [-o prop=value] ... [-R root] [-D] - * [-d dir | -c cachefile] [-f] [-n] [-F] [newpool] + * [-d dir | -c cachefile] [-f] [-n] [-F] [-t] + * [newpool] * * -c Read pool information from a cachefile instead of searching * devices. @@ -2191,6 +2227,9 @@ zpool_do_checkpoint(int argc, char **argv) * * -N Import the pool but don't mount datasets. * + * -t Use newpool as a temporary pool name instead of renaming + * the pool. + * * -T Specify a starting txg to use for import. This option is * intentionally undocumented option for testing purposes. * @@ -2241,7 +2280,7 @@ zpool_do_import(int argc, char **argv) }; /* check options */ - while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX", + while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:tT:VX", long_options, NULL)) != -1) { switch (c) { case 'a': @@ -2296,14 +2335,16 @@ zpool_do_import(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto error; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto error; break; + case 't': + flags |= ZFS_IMPORT_TEMP_NAME; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto error; + break; case 'T': errno = 0; txg = strtoull(optarg, &endptr, 0); @@ -2439,9 +2480,9 @@ zpool_do_import(int argc, char **argv) (void) fprintf(stderr, gettext("cannot import '%s': " "a pool with that name already exists\n"), argv[0]); - (void) fprintf(stderr, gettext("use the form '%s " - " ' to give it a new name\n"), - "zpool import"); + (void) fprintf(stderr, gettext("use the form 'zpool import " + "[-t] ' to give it a new temporary " + "or permanent name\n")); err = 1; } else if (pools == NULL && idata.exists) { (void) fprintf(stderr, gettext("cannot import '%s': " Modified: user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 13 16:50:16 2018 (r332477) @@ -644,11 +644,22 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char goto error; } break; + case ZPOOL_PROP_READONLY: if (!flags.import) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property '%s' can only be set at " "import time"), propname); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + + case ZPOOL_PROP_TNAME: + if (!flags.create) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property '%s' can only be set at " + "creation time"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } Modified: user/markj/netdump/lib/libc/amd64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/amd64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/amd64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -40,7 +40,6 @@ FBSD_1.0 { amd64_set_fsbase; amd64_set_gsbase; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/amd64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -8,8 +8,7 @@ SRCS+= \ amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S +MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/gen/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/gen/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -41,6 +41,7 @@ SRCS+= __getosreldate.c \ errlst.c \ errno.c \ exec.c \ + exect.c \ fdevname.c \ feature_present.c \ fmtcheck.c \ Modified: user/markj/netdump/lib/libc/gen/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/gen/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -105,6 +105,7 @@ FBSD_1.0 { sys_errlist; sys_nerr; errno; + exect; execl; execle; execlp; Copied: user/markj/netdump/lib/libc/gen/exect.c (from r332476, head/lib/libc/gen/exect.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/gen/exect.c Fri Apr 13 16:50:16 2018 (r332477, copy of r332476, head/lib/libc/gen/exect.c) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2018 Ali Mashtizadeh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +int +exect(const char *path, char *const argv[], char *const envp[]) +{ + + if (ptrace(PT_TRACE_ME, 0, 0, 0) != 0) { + if (errno != EBUSY) + return (-1); + } + + return (execve(path, argv, envp)); +} Modified: user/markj/netdump/lib/libc/gen/syslog.3 ============================================================================== --- user/markj/netdump/lib/libc/gen/syslog.3 Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/gen/syslog.3 Fri Apr 13 16:50:16 2018 (r332477) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2018 +.Dd April 12, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -295,4 +295,4 @@ for later interpolation by .Pp Always use the proper secure idiom: .Pp -.Dl syslog(priority, "%s", string); +.Dl syslog(priority, \*q%s\*q, string); Modified: user/markj/netdump/lib/libc/i386/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/i386/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/i386/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -31,7 +31,6 @@ FBSD_1.0 { ntohs; vfork; brk; - exect; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; Modified: user/markj/netdump/lib/libc/i386/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/i386/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/i386/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -7,8 +7,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S syscall.S NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/mips/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/mips/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/mips/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -2,8 +2,7 @@ SRCS+= trivial-vdso_tc.c -MDASM= Ovfork.S brk.S cerror.S exect.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: user/markj/netdump/lib/libc/powerpc/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/powerpc/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: user/markj/netdump/lib/libc/powerpc64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: user/markj/netdump/lib/libc/sparc64/Symbol.map ============================================================================== --- user/markj/netdump/lib/libc/sparc64/Symbol.map Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/sparc64/Symbol.map Fri Apr 13 16:50:16 2018 (r332477) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; @@ -82,8 +81,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_brk; _brk; - __sys_exect; - _exect; _end; __sys_sbrk; _sbrk; Modified: user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/lib/libc/sparc64/sys/Makefile.inc Fri Apr 13 16:50:16 2018 (r332477) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S +MDASM+= brk.S cerror.S sbrk.S sigaction1.S Modified: user/markj/netdump/release/i386/make-memstick.sh ============================================================================== --- user/markj/netdump/release/i386/make-memstick.sh Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/release/i386/make-memstick.sh Fri Apr 13 16:50:16 2018 (r332477) @@ -36,11 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt \ - -b ${1}/boot/pmbr \ - -p freebsd-boot:=${1}/boot/gptboot \ - -p freebsd-ufs:=${2}.part \ - -p freebsd-swap::1M \ +mkimg -s mbr \ + -b ${1}/boot/mbr \ + -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${2}.part Modified: user/markj/netdump/sbin/ipfw/ipfw2.c ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw2.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipfw2.c Fri Apr 13 16:50:16 2018 (r332477) @@ -1176,8 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, - char const *s) +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd) { struct hostent *he = NULL; struct in_addr *ia; @@ -1185,6 +1184,7 @@ print_ip(struct buf_pr *bp, const struct format_opts * uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; char *t; + bprintf(bp, " "); if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { uint32_t d = a[1]; const char *arg = ""; @@ -1192,12 +1192,9 @@ print_ip(struct buf_pr *bp, const struct format_opts * if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) arg = match_value(rule_options, lookup_key[d]); t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1); - bprintf(bp, "%s lookup %s %s", cmd->o.len & F_NOT ? " not": "", - arg, t); + bprintf(bp, "lookup %s %s", arg, t); return; } - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); - if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { bprintf(bp, "me"); return; @@ -1468,7 +1465,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP_DST_MASK: case O_IP_DST_ME: case O_IP_DST_SET: - print_ip(bp, fo, insntod(cmd, ip), ""); + print_ip(bp, fo, insntod(cmd, ip)); break; case O_IP6_SRC: case O_IP6_SRC_MASK: @@ -1476,7 +1473,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP6_DST: case O_IP6_DST_MASK: case O_IP6_DST_ME: - print_ip6(bp, insntod(cmd, ip6), ""); + print_ip6(bp, insntod(cmd, ip6)); break; case O_FLOW6ID: print_flow6id(bp, insntod(cmd, u32)); Modified: user/markj/netdump/sbin/ipfw/ipfw2.h ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw2.h Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipfw2.h Fri Apr 13 16:50:16 2018 (r332477) @@ -401,7 +401,7 @@ int ipfw_delete_pipe(int pipe_or_queue, int n); /* ipv6.c */ void print_unreach6_code(struct buf_pr *bp, uint16_t code); -void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd, char const *s); +void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd); void print_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct buf_pr *bp, struct _ipfw_insn *cmd ); Modified: user/markj/netdump/sbin/ipfw/ipv6.c ============================================================================== --- user/markj/netdump/sbin/ipfw/ipv6.c Fri Apr 13 16:45:35 2018 (r332476) +++ user/markj/netdump/sbin/ipfw/ipv6.c Fri Apr 13 16:50:16 2018 (r332477) @@ -48,11 +48,11 @@ } while (0) static struct _s_x icmp6codes[] = { - { "no-route", ICMP6_DST_UNREACH_NOROUTE }, - { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, - { "address", ICMP6_DST_UNREACH_ADDR }, - { "port", ICMP6_DST_UNREACH_NOPORT }, - { NULL, 0 } + { "no-route", ICMP6_DST_UNREACH_NOROUTE }, + { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, + { "address", ICMP6_DST_UNREACH_ADDR }, + { "port", ICMP6_DST_UNREACH_NOPORT }, + { NULL, 0 } }; void @@ -85,54 +85,56 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code) * Print the ip address contained in a command. */ void -print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char const *s) +print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd) { - struct hostent *he = NULL; - int len = F_LEN((ipfw_insn *) cmd) - 1; - struct in6_addr *a = &(cmd->addr6); - char trad[255]; + char trad[255]; + struct hostent *he = NULL; + struct in6_addr *a = &(cmd->addr6); + int len, mb; - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); + len = F_LEN((ipfw_insn *) cmd) - 1; + if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { + bprintf(bp, " me6"); + return; + } + if (cmd->o.opcode == O_IP6) { + bprintf(bp, " ip6"); + return; + } - if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { - bprintf(bp, "me6"); - return; - } - if (cmd->o.opcode == O_IP6) { - bprintf(bp, " ip6"); - return; - } + /* + * len == 4 indicates a single IP, whereas lists of 1 or more + * addr/mask pairs have len = (2n+1). We convert len to n so we + * use that to count the number of entries. + */ + bprintf(bp, " "); + for (len = len / 4; len > 0; len -= 2, a += 2) { + /* mask length */ + mb = (cmd->o.opcode == O_IP6_SRC || + cmd->o.opcode == O_IP6_DST) ? 128: + contigmask((uint8_t *)&(a[1]), 128); - /* - * len == 4 indicates a single IP, whereas lists of 1 or more - * addr/mask pairs have len = (2n+1). We convert len to n so we - * use that to count the number of entries. - */ + if (mb == 128 && co.do_resolv) + he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); - for (len = len / 4; len > 0; len -= 2, a += 2) { - int mb = /* mask length */ - (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ? - 128 : contigmask((uint8_t *)&(a[1]), 128); - - if (mb == 128 && co.do_resolv) - he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); - if (he != NULL) /* resolved to name */ - bprintf(bp, "%s", he->h_name); - else if (mb == 0) /* any */ - bprintf(bp, "any"); - else { /* numeric IP followed by some kind of mask */ - if (inet_ntop(AF_INET6, a, trad, sizeof( trad ) ) == NULL) - bprintf(bp, "Error ntop in print_ip6\n"); - bprintf(bp, "%s", trad ); - if (mb < 0) /* mask not contiguous */ - bprintf(bp, "/%s", - inet_ntop(AF_INET6, &a[1], trad, sizeof(trad))); - else if (mb < 128) - bprintf(bp, "/%d", mb); - } - if (len > 2) - bprintf(bp, ","); - } + if (he != NULL) /* resolved to name */ + bprintf(bp, "%s", he->h_name); + else if (mb == 0) /* any */ + bprintf(bp, "any"); + else { /* numeric IP followed by some kind of mask */ + if (inet_ntop(AF_INET6, a, trad, + sizeof(trad)) == NULL) + bprintf(bp, "Error ntop in print_ip6\n"); + bprintf(bp, "%s", trad ); + if (mb < 0) /* mask not contiguous */ + bprintf(bp, "/%s", inet_ntop(AF_INET6, &a[1], + trad, sizeof(trad))); + else if (mb < 128) + bprintf(bp, "/%d", mb); + } + if (len > 2) + bprintf(bp, ","); + } } void @@ -144,163 +146,154 @@ fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cb bzero(cmd, sizeof(*cmd)); while (*av) { - if (*av == ',') - av++; - type = strtoul(av, &av, 0); - if (*av != ',' && *av != '\0') - errx(EX_DATAERR, "invalid ICMP6 type"); - /* - * XXX: shouldn't this be 0xFF? I can't see any reason why - * we shouldn't be able to filter all possiable values - * regardless of the ability of the rest of the kernel to do - * anything useful with them. - */ - if (type > ICMP6_MAXTYPE) - errx(EX_DATAERR, "ICMP6 type out of range"); - cmd->d[type / 32] |= ( 1 << (type % 32)); + if (*av == ',') + av++; + type = strtoul(av, &av, 0); + if (*av != ',' && *av != '\0') + errx(EX_DATAERR, "invalid ICMP6 type"); + /* + * XXX: shouldn't this be 0xFF? I can't see any reason why + * we shouldn't be able to filter all possiable values + * regardless of the ability of the rest of the kernel to do + * anything useful with them. + */ + if (type > ICMP6_MAXTYPE) + errx(EX_DATAERR, "ICMP6 type out of range"); + cmd->d[type / 32] |= ( 1 << (type % 32)); } cmd->o.opcode = O_ICMP6TYPE; cmd->o.len |= F_INSN_SIZE(ipfw_insn_icmp6); } - void print_icmp6types(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - int i, j; - char sep= ' '; + int i, j; + char sep= ' '; - bprintf(bp, " ip6 icmp6types"); - for (i = 0; i < 7; i++) - for (j=0; j < 32; ++j) { - if ( (cmd->d[i] & (1 << (j))) == 0) - continue; - bprintf(bp, "%c%d", sep, (i*32 + j)); - sep = ','; - } + bprintf(bp, " ip6 icmp6types"); + for (i = 0; i < 7; i++) + for (j=0; j < 32; ++j) { + if ( (cmd->d[i] & (1 << (j))) == 0) + continue; + bprintf(bp, "%c%d", sep, (i*32 + j)); + sep = ','; + } } void print_flow6id(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - uint16_t i, limit = cmd->o.arg1; - char sep = ','; + uint16_t i, limit = cmd->o.arg1; + char sep = ','; - bprintf(bp, " flow-id "); - for( i=0; i < limit; ++i) { - if (i == limit - 1) - sep = ' '; - bprintf(bp, "%d%c", cmd->d[i], sep); - } + bprintf(bp, " flow-id "); + for( i=0; i < limit; ++i) { + if (i == limit - 1) + sep = ' '; + bprintf(bp, "%d%c", cmd->d[i], sep); + } } /* structure and define for the extension header in ipv6 */ static struct _s_x ext6hdrcodes[] = { - { "frag", EXT_FRAGMENT }, - { "hopopt", EXT_HOPOPTS }, - { "route", EXT_ROUTING }, - { "dstopt", EXT_DSTOPTS }, - { "ah", EXT_AH }, - { "esp", EXT_ESP }, - { "rthdr0", EXT_RTHDR0 }, - { "rthdr2", EXT_RTHDR2 }, - { NULL, 0 } + { "frag", EXT_FRAGMENT }, + { "hopopt", EXT_HOPOPTS }, + { "route", EXT_ROUTING }, + { "dstopt", EXT_DSTOPTS }, + { "ah", EXT_AH }, + { "esp", EXT_ESP }, + { "rthdr0", EXT_RTHDR0 }, + { "rthdr2", EXT_RTHDR2 }, + { NULL, 0 } }; /* fills command for the extension header filtering */ int fill_ext6hdr( ipfw_insn *cmd, char *av) { - int tok; - char *s = av; + int tok; + char *s = av; - cmd->arg1 = 0; - - while(s) { - av = strsep( &s, ",") ; - tok = match_token(ext6hdrcodes, av); - switch (tok) { - case EXT_FRAGMENT: - cmd->arg1 |= EXT_FRAGMENT; - break; - - case EXT_HOPOPTS: - cmd->arg1 |= EXT_HOPOPTS; - break; - - case EXT_ROUTING: - cmd->arg1 |= EXT_ROUTING; - break; - - case EXT_DSTOPTS: - cmd->arg1 |= EXT_DSTOPTS; - break; - - case EXT_AH: - cmd->arg1 |= EXT_AH; - break; - - case EXT_ESP: - cmd->arg1 |= EXT_ESP; - break; - - case EXT_RTHDR0: - cmd->arg1 |= EXT_RTHDR0; - break; - - case EXT_RTHDR2: - cmd->arg1 |= EXT_RTHDR2; - break; - - default: - errx( EX_DATAERR, "invalid option for ipv6 exten header" ); - break; - } - } - if (cmd->arg1 == 0 ) - return 0; - cmd->opcode = O_EXT_HDR; - cmd->len |= F_INSN_SIZE( ipfw_insn ); - return 1; + cmd->arg1 = 0; + while(s) { + av = strsep( &s, ",") ; + tok = match_token(ext6hdrcodes, av); + switch (tok) { + case EXT_FRAGMENT: + cmd->arg1 |= EXT_FRAGMENT; + break; + case EXT_HOPOPTS: + cmd->arg1 |= EXT_HOPOPTS; + break; + case EXT_ROUTING: + cmd->arg1 |= EXT_ROUTING; + break; + case EXT_DSTOPTS: + cmd->arg1 |= EXT_DSTOPTS; + break; + case EXT_AH: + cmd->arg1 |= EXT_AH; + break; + case EXT_ESP: + cmd->arg1 |= EXT_ESP; + break; + case EXT_RTHDR0: + cmd->arg1 |= EXT_RTHDR0; + break; + case EXT_RTHDR2: + cmd->arg1 |= EXT_RTHDR2; + break; + default: + errx(EX_DATAERR, + "invalid option for ipv6 exten header"); + break; + } + } + if (cmd->arg1 == 0) + return (0); + cmd->opcode = O_EXT_HDR; + cmd->len |= F_INSN_SIZE(ipfw_insn); + return (1); } void print_ext6hdr(struct buf_pr *bp, ipfw_insn *cmd ) { - char sep = ' '; + char sep = ' '; - bprintf(bp, " extension header:"); - if (cmd->arg1 & EXT_FRAGMENT ) { - bprintf(bp, "%cfragmentation", sep); - sep = ','; - } - if (cmd->arg1 & EXT_HOPOPTS ) { - bprintf(bp, "%chop options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ROUTING ) { - bprintf(bp, "%crouting options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR0 ) { - bprintf(bp, "%crthdr0", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR2 ) { - bprintf(bp, "%crthdr2", sep); - sep = ','; - } - if (cmd->arg1 & EXT_DSTOPTS ) { - bprintf(bp, "%cdestination options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_AH ) { - bprintf(bp, "%cauthentication header", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ESP ) { - bprintf(bp, "%cencapsulated security payload", sep); - } + bprintf(bp, " extension header:"); + if (cmd->arg1 & EXT_FRAGMENT) { + bprintf(bp, "%cfragmentation", sep); + sep = ','; + } + if (cmd->arg1 & EXT_HOPOPTS) { + bprintf(bp, "%chop options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_ROUTING) { + bprintf(bp, "%crouting options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR0) { + bprintf(bp, "%crthdr0", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR2) { + bprintf(bp, "%crthdr2", sep); + sep = ','; + } + if (cmd->arg1 & EXT_DSTOPTS) { + bprintf(bp, "%cdestination options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_AH) { + bprintf(bp, "%cauthentication header", sep); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***